-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathbuild.gradle.kts
100 lines (84 loc) · 2.69 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
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
buildscript {
dependencies {
classpath(kotlin("gradle-plugin", version = "1.9.22"))
classpath("com.github.johnrengelman:shadow:8.1.1")
}
}
plugins {
kotlin("jvm") version "1.9.22"
id("jacoco-report-aggregation")
}
val cacheVersion = "1.2.0"
allprojects {
apply(plugin = "kotlin")
apply(plugin = "idea")
apply(plugin = "org.jetbrains.kotlin.jvm")
apply(plugin = "jacoco")
group = "world.gregs.void"
version = System.getenv("GITHUB_REF_NAME") ?: "dev"
java.sourceCompatibility = JavaVersion.VERSION_19
java.targetCompatibility = java.sourceCompatibility
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
testImplementation("org.junit.jupiter:junit-jupiter-api:${findProperty("junitVersion")}")
testImplementation("org.junit.jupiter:junit-jupiter-engine:${findProperty("junitVersion")}")
}
tasks {
compileKotlin {
kotlinOptions.jvmTarget = java.sourceCompatibility.toString()
// https://youtrack.jetbrains.com/issue/KT-4779/Generate-default-methods-for-implementations-in-interfaces
kotlinOptions.freeCompilerArgs = listOf("-Xinline-classes", "-Xcontext-receivers", "-Xjvm-default=all-compatibility", "-Xallow-any-scripts-in-source-roots")
}
compileTestKotlin {
kotlinOptions.jvmTarget = java.sourceCompatibility.toString()
kotlinOptions.freeCompilerArgs = listOf("-Xinline-classes", "-Xcontext-receivers", "-Xjvm-default=all-compatibility", "-Xallow-any-scripts-in-source-roots")
}
}
if (name != "tools") {
tasks.test {
maxHeapSize = "4096m"
useJUnitPlatform()
failFast = true
testLogging {
events("passed", "skipped", "failed")
exceptionFormat = TestExceptionFormat.FULL
}
finalizedBy(tasks.jacocoTestReport)
}
tasks.jacocoTestReport {
dependsOn(tasks.test)
reports {
xml.required = true
csv.required = false
}
}
}
}
tasks.register("printVersion") {
doLast {
println(project.version)
}
}
tasks.register("printCacheVersion") {
doLast {
println(cacheVersion)
}
}
reporting {
reports {
@Suppress("UnstableApiUsage")
create("jacocoMergedReport", JacocoCoverageReport::class) {
testType = TestSuiteType.UNIT_TEST
}
}
}
dependencies {
allprojects.filter { it.name != "tools" }.forEach {
jacocoAggregation(it)
}
}