-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
116 lines (99 loc) · 3.13 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
import org.gradle.jvm.toolchain.JvmVendorSpec.ADOPTIUM
import org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompilerOptions
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_1
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
import java.time.Duration
plugins {
java
jacoco
kotlin("jvm")
id("io.github.gradle-nexus.publish-plugin")
}
tasks.wrapper {
gradleVersion = "8.12"
distributionSha256Sum = "7ebdac923867a3cec0098302416d1e3c6c0c729fc4e2e05c10637a8af33a76c5"
distributionType = Wrapper.DistributionType.ALL
}
kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(21))
vendor.set(ADOPTIUM)
}
}
repositories {
mavenCentral()
}
subprojects {
repositories {
mavenLocal()
mavenCentral()
maven(url = "https://repo.gradle.org/gradle/repo")
maven(url = "https://artifactory.cronapp.io/public-release")
}
apply(plugin = "java")
apply(plugin = "jacoco")
apply(plugin = "maven-publish") // required to upload to sonatype
tasks {
withType<KotlinCompilationTask<KotlinJvmCompilerOptions>>().configureEach {
compilerOptions {
jvmTarget.set(JVM_1_8)
apiVersion.set(KOTLIN_2_1)
languageVersion.set(KOTLIN_2_1)
allWarningsAsErrors.set(true)
freeCompilerArgs.addAll("-Xjsr305=strict", "-progressive")
}
}
withType<JavaCompile>().configureEach {
options.release.set(8)
options.compilerArgs.addAll(arrayOf("-Xlint:all:_", "-Werror"))
}
@Suppress("UnstableApiUsage")
testing {
suites {
named<JvmTestSuite>("test") {
useJUnitJupiter("5.10.0")
dependencies {
implementation(Testing.kotest.assertions.core)
}
targets.all {
testTask.configure {
testLogging {
exceptionFormat = FULL
}
}
}
}
}
}
named<JacocoReport>("jacocoTestReport").configure {
group = "Reporting"
reports {
xml.required.set(true)
csv.required.set(false)
}
}
register("listProjects") {
doLast {
subprojects
.forEach { System.err.println(it.name) }
}
}
}
}
val nexusUsername: String? by project
val nexusPassword: String? by project
version = project.properties["releaseVersion"] ?: "LOCAL"
group = "dev.forkhandles"
description = "Kotlin DSL for Kubernetes manifests"
nexusPublishing {
repositories.sonatype {
username.set(nexusUsername)
password.set(nexusPassword)
}
transitionCheckOptions {
maxRetries.set(150)
delayBetween.set(Duration.ofSeconds(5))
}
}