-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
97 lines (78 loc) · 2.47 KB
/
build.gradle.kts
File metadata and controls
97 lines (78 loc) · 2.47 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
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
plugins {
id("application")
id("jacoco")
kotlin("jvm") version ("1.9.25")
id("com.google.devtools.ksp") version ("1.9.25-1.0.20")
}
group = property("groupId")!!
version = property("koraVersion")!!
val koraBom: Configuration by configurations.creating
configurations {
ksp.get().extendsFrom(koraBom); compileOnly.get().extendsFrom(koraBom)
api.get().extendsFrom(koraBom); implementation.get().extendsFrom(koraBom)
}
repositories {
mavenCentral()
maven { url = uri("https://central.sonatype.com/repository/maven-snapshots") }
}
dependencies {
koraBom(platform("ru.tinkoff.kora:kora-parent:${property("koraVersion")}"))
ksp("ru.tinkoff.kora:symbol-processors")
ksp("org.slf4j:slf4j-simple:2.0.16")
implementation("ru.tinkoff.kora:http-server-undertow")
implementation("ru.tinkoff.kora:config-hocon")
implementation("ru.tinkoff.kora:logging-logback")
testImplementation("io.mockk:mockk:1.13.8")
testImplementation("ru.tinkoff.kora:test-junit5")
testImplementation("org.testcontainers:junit-jupiter:1.19.8")
}
kotlin {
jvmToolchain { languageVersion.set(JavaLanguageVersion.of(17)) }
sourceSets.main { kotlin.srcDir("build/generated/ksp/main/kotlin") }
sourceSets.test { kotlin.srcDir("build/generated/ksp/test/kotlin") }
}
application {
applicationName = "application"
mainClass.set("ru.tinkoff.kora.kotlin.ApplicationKt")
applicationDefaultJvmArgs = listOf("-Dfile.encoding=UTF-8")
}
tasks.distTar {
archiveFileName.set("application.tar")
}
tasks.withType<JavaExec> {
environment(
"" to "",
)
}
val jacocoExcludeSet = setOf("**/generated/**", "**/Application*", "**/\$*")
tasks.test {
dependsOn("distTar")
jvmArgs(
"-XX:+TieredCompilation",
"-XX:TieredStopAtLevel=1",
)
useJUnitPlatform()
testLogging {
showStandardStreams = true
events("passed", "skipped", "failed")
exceptionFormat = TestExceptionFormat.FULL
}
exclude("**/\$*")
reports {
html.required = false
junitXml.required = false
}
jacoco {
jacocoExcludeSet.forEach { exclude(it) }
}
}
tasks.jacocoTestReport {
reports {
xml.required = true
html.outputLocation = layout.buildDirectory.dir("jacocoHtml")
}
classDirectories.setFrom(sourceSets.main.get().output.asFileTree.matching {
jacocoExcludeSet.forEach { exclude(it) }
})
}