-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle.kts
87 lines (75 loc) · 2.86 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
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
import org.jlleitschuh.gradle.ktlint.KtlintExtension
import org.jlleitschuh.gradle.ktlint.KtlintPlugin
plugins {
id("org.jetbrains.kotlin.jvm") version "2.1.10"
id("org.jlleitschuh.gradle.ktlint") version "12.1.2"
id("com.vanniktech.maven.publish") version "0.30.0"
id("org.jetbrains.changelog") version "2.2.1"
}
version = property("VERSION_NAME").toString()
changelog.path.set("changelog.md")
subprojects {
apply<KtlintPlugin>()
configure<KtlintExtension> {
version.set("1.3.1")
}
pluginManager.withPlugin("org.jetbrains.kotlin.jvm") {
configure<KotlinJvmProjectExtension> {
compilerOptions.jvmTarget.set(JvmTarget.JVM_17)
}
configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}
tasks.withType<Test> {
useJUnitPlatform()
testLogging {
exceptionFormat = TestExceptionFormat.FULL
showExceptions = true
showCauses = true
}
addTestListener(
object : TestListener {
override fun afterSuite(
suite: TestDescriptor,
result: TestResult,
) {
if (suite.parent == null) {
val output =
buildString {
append("| Results: ")
append(result.resultType)
append(" (")
append(result.testCount)
append(" tests, ")
append(result.successfulTestCount)
append(" passed, ")
append(result.failedTestCount)
append(" failed, ")
append(result.skippedTestCount)
append(" skipped) |")
}
val border = "-".repeat(output.length)
logger.lifecycle(
"""
$border
$output
$border
""".trimIndent(),
)
}
}
override fun afterTest(
testDescriptor: TestDescriptor?,
result: TestResult?,
) {}
override fun beforeTest(testDescriptor: TestDescriptor?) {}
override fun beforeSuite(suite: TestDescriptor?) {}
},
)
}
}