Skip to content

Commit 4199972

Browse files
jselboJoshua Selbo
andauthored
Use jvmToolchain API to configure builds (#572)
Co-authored-by: Joshua Selbo <jselbo@meta.com>
1 parent 3b5498c commit 4199972

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

mockito-kotlin/build.gradle

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,8 @@ dokkaHtml.configure {
4343
}
4444
}
4545

46-
tasks.withType(KotlinCompile).configureEach {
47-
compilerOptions {
48-
jvmTarget.set(JvmTarget.JVM_11)
49-
targetCompatibility = "11"
50-
}
46+
kotlin {
47+
jvmToolchain(11) // This handles Kotlin compilation, Java compilation, and Gradle attributes automatically
5148
}
5249

5350
javadoc.dependsOn dokkaHtml

tests/build.gradle

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ dependencies {
2323
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.10.2"
2424
}
2525

26-
tasks.withType(KotlinCompile).configureEach {
27-
compilerOptions {
28-
jvmTarget.set(JvmTarget.JVM_11)
29-
targetCompatibility = "11"
30-
}
26+
kotlin {
27+
jvmToolchain(11) // This handles Kotlin compilation, Java compilation, and Gradle attributes automatically
3128
}

0 commit comments

Comments
 (0)