Skip to content

Commit 776c88f

Browse files
committed
Improved Gradle JVM Test Suite Plugin configuration.
1 parent 11263aa commit 776c88f

File tree

1 file changed

+23
-21
lines changed

1 file changed

+23
-21
lines changed

build-logic/src/main/kotlin/org.sdkotlin.buildlogic.test.unit-test-suite.gradle.kts

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,29 @@ plugins {
88
@Suppress("UnstableApiUsage")
99
testing {
1010
suites {
11-
named<JvmTestSuite>("test") {
12-
13-
// Version catalog not available in precompiled script plugins:
14-
// https://github.com/gradle/gradle/issues/15383
15-
//val junitVersion = libs.version.junit.get()
16-
val junitVersion = "5.9.2" // Duplicated in libs.versions.toml.
17-
18-
useJUnitJupiter(junitVersion)
19-
20-
targets {
21-
all {
22-
testTask.configure {
23-
testLogging {
24-
showStandardStreams = true
25-
events(
26-
PASSED,
27-
SKIPPED,
28-
FAILED,
29-
STANDARD_OUT,
30-
STANDARD_ERROR
31-
)
11+
configureEach {
12+
if (this is JvmTestSuite) {
13+
14+
// Version catalog not available in precompiled script plugins:
15+
// https://github.com/gradle/gradle/issues/15383
16+
//val junitVersion = libs.version.junit.get()
17+
val junitVersion = "5.9.2" // Duplicated in libs.versions.toml.
18+
19+
useJUnitJupiter(junitVersion)
20+
21+
targets {
22+
all {
23+
testTask.configure {
24+
testLogging {
25+
showStandardStreams = true
26+
events(
27+
PASSED,
28+
SKIPPED,
29+
FAILED,
30+
STANDARD_OUT,
31+
STANDARD_ERROR
32+
)
33+
}
3234
}
3335
}
3436
}

0 commit comments

Comments
 (0)