-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle.kts
95 lines (78 loc) · 2.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
90
91
92
93
94
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.cyclonedx.gradle.CycloneDxTask
import org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
val ktorVersion = "2.3.9"
val logbackVersion = "1.5.3"
val logstashEncoderVersion = "7.4"
val junitJupiterVersion = "5.10.2"
val kamlVersion = "0.57.0"
val micrometerVersion = "1.12.3"
val mainClassName = "io.nais.MainKt"
group = "io.nais"
version = "generatedlater"
plugins {
kotlin("jvm") version "1.9.23"
kotlin("plugin.serialization") version "1.9.23"
id("com.github.johnrengelman.shadow") version "8.1.1"
id("com.github.ben-manes.versions") version "0.51.0"
id("org.cyclonedx.bom") version "1.8.2"
}
repositories {
mavenCentral()
}
dependencies {
implementation(kotlin("stdlib"))
implementation("net.logstash.logback:logstash-logback-encoder:$logstashEncoderVersion")
implementation("ch.qos.logback:logback-classic:$logbackVersion")
implementation("com.charleskorn.kaml:kaml:$kamlVersion")
implementation("io.micrometer:micrometer-registry-prometheus:$micrometerVersion")
implementation("io.ktor:ktor-server-content-negotiation:$ktorVersion")
implementation("io.ktor:ktor-serialization-kotlinx-json:$ktorVersion")
implementation("io.ktor:ktor-server-status-pages:$ktorVersion")
implementation("io.ktor:ktor-server-core:$ktorVersion")
implementation("io.ktor:ktor-server-netty:$ktorVersion")
implementation("io.ktor:ktor-server-metrics-micrometer:$ktorVersion")
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion")
testImplementation("io.ktor:ktor-server-test-host:$ktorVersion")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion")
}
kotlin {
jvmToolchain(17)
}
tasks {
withType<Jar> {
archiveBaseName.set("app")
manifest {
attributes["Main-Class"] = "io.nais.MainKt"
attributes["Class-Path"] = configurations.runtimeClasspath.get().joinToString(separator = " ") {
it.name
}
}
doLast {
configurations.runtimeClasspath.get().forEach {
val file = File("$buildDir/libs/${it.name}")
if (!file.exists())
it.copyTo(file)
}
}
}
withType<ShadowJar>{
archiveFileName.set("app-all.jar")
}
withType<Test> {
useJUnitPlatform()
testLogging {
showExceptions = true
}
testLogging {
exceptionFormat = FULL
}
}
withType<Wrapper> {
gradleVersion = "8.4"
}
withType<CycloneDxTask> {
setOutputFormat("json")
setIncludeLicenseText(false)
}
}