-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
90 lines (75 loc) · 1.6 KB
/
build.gradle.kts
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
import io.ktor.plugin.features.*
plugins {
application
alias(libs.plugins.jvm)
alias(libs.plugins.ktor)
alias(libs.plugins.serialization)
alias(libs.plugins.openapi)
checkstyle
}
version = "0.1-b"
val javaVersion = JavaVersion.VERSION_21
repositories {
mavenCentral()
}
dependencies {
implementation(libs.jgit)
implementation(libs.kaml)
implementation(libs.snakeyaml)
implementation(libs.schema)
implementation(libs.kfswatch)
implementation(libs.bundles.ktor)
implementation(libs.bundles.logging)
implementation(libs.bundles.kotlinx)
implementation(libs.bundles.jackson)
implementation(libs.bundles.koin)
testImplementation(kotlin("test"))
}
application {
mainClass.set("org.developerden.codosseum.ChallengesService")
}
ktor {
docker {
jreVersion.set(javaVersion)
localImageName.set("challenges-service")
imageTag.set(version.toString())
portMappings.set(
listOf(
DockerPortMapping(
80,
8080,
DockerPortMappingProtocol.TCP
)
)
)
}
}
tasks.test {
useJUnitPlatform()
}
tasks.compileKotlin {
dependsOn("openApiGenerate")
}
kotlin {
jvmToolchain(javaVersion.majorVersion.toInt())
}
openApiGenerate {
generatorName.set("kotlin")
inputSpec.set("sandkasten-spec.json")
packageName.set("org.developerden.codosseum.sandkasten.api")
logToStderr = true
cleanupOutput = true
library.set("jvm-ktor")
additionalProperties.apply {
put("omitGradlePluginVersions", true)
put("omitGradleWrapper", true)
put("serializationLibrary", "kotlinx_serialization")
}
}
sourceSets {
main {
kotlin {
srcDirs("${openApiGenerate.outputDir.get()}/src/main/kotlin")
}
}
}