1
0
Fork 0
petclinic/backend-model/build.gradle.kts

71 lines
1.9 KiB
Text
Raw Permalink Normal View History

2024-11-21 21:42:41 -05:00
plugins {
java
id("io.spring.dependency-management") version "1.1.6"
id("org.openapi.generator") version "7.10.0"
}
group = "org.springframework.samples"
2024-11-24 20:14:24 -05:00
val apiArtifact by configurations.creating {
isCanBeConsumed = false
}
2024-11-21 21:42:41 -05:00
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
dependencyManagement {
imports {
mavenBom ("org.springframework.boot:spring-boot-dependencies:3.3.6")
}
}
repositories {
mavenCentral()
}
dependencies {
2024-11-24 20:14:24 -05:00
apiArtifact(project(":api", "apiArtifact"))
2024-11-21 21:42:41 -05:00
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-validation")
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.6.0")
}
tasks.withType<JavaCompile> {
dependsOn(tasks.openApiGenerate)
}
java.sourceSets["main"].java {
srcDir(layout.buildDirectory.dir("generated/sources/openapi/src/main/java"))
}
openApiGenerate {
2024-11-24 20:14:24 -05:00
inputSpec.set(apiArtifact.singleFile.absolutePath)
2024-11-21 21:42:41 -05:00
outputDir.set(layout.buildDirectory.dir("generated/sources/openapi").map { it.asFile.absolutePath })
generatorName.set("spring")
library.set("spring-boot")
modelNameSuffix.set("Dto")
apiPackage.set("org.springframework.samples.petclinic.rest.api")
modelPackage.set("org.springframework.samples.petclinic.rest.dto")
supportingFilesConstrainedTo.set(listOf("ApiUtil.java"))
globalProperties.set(
mapOf(
"apis" to "",
"models" to ""
)
)
configOptions.set(
mutableMapOf(
"verbose" to "true",
"interfaceOnly" to "true",
"performBeanValidation" to "true",
"dateLibrary" to "java8",
"useSpringBoot3" to "true",
"openApiNullable" to "false",
"serializationLibrary" to "jackson",
"documentationProvider" to "springdoc",
)
)
}