Skip to content

Commit 392b485

Browse files
committed
add junit-platform-launcher and junit-platform-runner
1 parent 4d9a08b commit 392b485

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

build.gradle.kts

+29-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
22

33
plugins {
4-
kotlin("jvm") version "1.9.25"
4+
kotlin("jvm") version "2.1.20"
55
id("com.adarshr.test-logger") version "3.2.0"
66
id("com.diffplug.spotless") version "6.25.0"
77
}
@@ -13,6 +13,8 @@ repositories {
1313

1414
dependencies {
1515
testImplementation("org.junit.jupiter:junit-jupiter:5.12.2")
16+
testImplementation("org.junit.platform:junit-platform-launcher:1.12.1")
17+
testImplementation("org.junit.platform:junit-platform-runner:1.12.1")
1618
testImplementation("org.amshove.kluent:kluent:1.73")
1719
}
1820

@@ -35,8 +37,32 @@ tasks.test {
3537
}
3638
}
3739

38-
kotlin {
39-
jvmToolchain(19)
40+
41+
// configuring java version
42+
java {
43+
sourceCompatibility = JavaVersion.VERSION_11
44+
targetCompatibility = JavaVersion.VERSION_11
45+
}
46+
47+
// alternate way
48+
//kotlin {
49+
// jvmToolchain(11)
50+
//}
51+
52+
53+
// extension level
54+
//kotlin {
55+
// compilerOptions {
56+
// jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11
57+
// }
58+
//}
59+
60+
// or
61+
62+
// task level
63+
// overriding Compile kotlin task
64+
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
65+
compilerOptions.jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11)
4066
}
4167

4268
spotless {

0 commit comments

Comments
 (0)