-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle.kts
73 lines (59 loc) · 1.94 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
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jlleitschuh.gradle.ktlint.KtlintExtension
group = "no.nav.mulighetsrommet"
version = "0.0.1"
plugins {
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.flyway) apply false
alias(libs.plugins.ktlint) apply false
alias(libs.plugins.shadow) apply false
alias(libs.plugins.openapi.generator) apply false
}
allprojects {
// Apply ktlint for all projects
apply(plugin = "org.jlleitschuh.gradle.ktlint")
configure<KtlintExtension> {
version = rootProject.libs.ktlint.get().version
}
tasks.withType<KotlinCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_21)
}
}
tasks.withType<JavaCompile> {
targetCompatibility = "21"
options.encoding = "UTF-8"
}
tasks.withType<Test> {
val isCI = System.getenv("CI") == "true"
failFast = isCI
useJUnitPlatform()
// Run tests in parallel
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).takeIf { it > 0 } ?: 1
testLogging {
showCauses = true
showExceptions = true
exceptionFormat = if (isCI) {
TestExceptionFormat.FULL
} else {
TestExceptionFormat.SHORT
}
events(TestLogEvent.SKIPPED, TestLogEvent.FAILED)
}
}
repositories {
mavenCentral()
maven {
// Needed for kafka
url = uri("https://packages.confluent.io/maven/")
}
maven {
// Needed for Nav-packages
url = uri("https://github-package-registry-mirror.gc.nav.no/cached/maven-release")
}
}
}