-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
101 lines (81 loc) · 3.34 KB
/
build.gradle.kts
File metadata and controls
101 lines (81 loc) · 3.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import org.springframework.boot.gradle.tasks.bundling.BootJar
plugins {
id("java")
id("io.spring.dependency-management") version "1.1.2"
id("org.openapi.generator").version("7.0.0-beta")
id("org.springframework.boot").version("2.7.6")
id("com.palantir.docker").version("0.35.0")
}
springBoot {
mainClass.set("de.pixolution.embeddingsGrid.invoker.OpenApiGeneratorApplication")
}
java {
group = "de.pixolution.embeddingsGrid"
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
repositories {
mavenCentral()
}
var appVer = "0.9.0"
val springboot_version="2.7.6"
val springdoc_version="1.6.14"
val swagger_ui_version="4.15.5"
dependencies {
// used by SOM algorithm implementation
implementation("it.unimi.dsi:fastutil:8.5.6")
// spring boot environment
implementation("org.springframework.boot:spring-boot-starter-web:${springboot_version}")
implementation("org.springframework.data:spring-data-commons:${springboot_version}")
implementation("org.springframework.boot:spring-boot-starter-validation:${springboot_version}")
implementation("org.springdoc:springdoc-openapi-ui:${springdoc_version}")
implementation("com.google.code.findbugs:jsr305:3.0.2")
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.13.2")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.2")
implementation("com.fasterxml.jackson.core:jackson-databind:2.13.2")
implementation("org.openapitools:jackson-databind-nullable:0.2.6")
// for proper escape of ECMA/JSON in tests
testImplementation("org.apache.commons:commons-text:1.10.0")
// testing for spring application
testImplementation("org.springframework.boot:spring-boot-starter-test:${springboot_version}")
// include all jars in libs/ folder for tests
//testImplementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
}
// add the openapi generated source folder to main source set
java.sourceSets["main"].java {
srcDir("src/openapi/java")
}
val spec = "$rootDir/openapi/openapi.yaml"
val generatedSourcesDir = "$rootDir/generated_openapi/"
// For openApiGenerate see https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-gradle-plugin/README.adoc
// For configOptions see: https://openapi-generator.tech/docs/generators/spring/
openApiGenerate {
generatorName.set("spring")
inputSpec.set(spec)
outputDir.set(generatedSourcesDir)
apiPackage.set("de.pixolution.embeddingsGrid.api")
invokerPackage.set("de.pixolution.embeddingsGrid.invoker")
modelPackage.set("de.pixolution.embeddingsGrid.model")
modelNameSuffix = "Json"
configOptions.set(mapOf(
"dateLibrary" to "java17",
"delegatePattern" to "true",
"developerEmail" to "info@pixolution.de",
"developerName" to "Sebastian Lutter",
"developerOrganization" to "pixolution GmbH Berlin",
"developerOrganizationUrl" to "https://pixolution.org",
"hideGenerationTimestamp" to "true",
"dateLibrary" to "java.util.Date",
"useJakartaEe" to "false",
"unhandledException" to "false",
))
}
val bootJar: BootJar by tasks
tasks {
docker {
name = "${project.name}"
files(bootJar.get().archiveFile)
noCache(true)
dependsOn(bootJar.get())
}
}