Skip to content

Commit 7a99420

Browse files
committed
Make sure Gradle Module Metadata targets the appropriate JVM version
irrespective of the JDK used for the build (as this is all Kotlin anyway).
1 parent 46cdc01 commit 7a99420

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

build.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ dependencyLocking {
2222

2323
group = "net.ltgt.gradle"
2424

25+
// Make sure Gradle Module Metadata targets the appropriate JVM version
26+
tasks.withType<JavaCompile>().configureEach {
27+
options.release.set(kotlinDslPluginOptions.jvmTarget.map { JavaVersion.toVersion(it).majorVersion.toInt() })
28+
}
29+
2530
tasks.withType<KotlinCompile>().configureEach {
2631
kotlinOptions.allWarningsAsErrors = true
2732
}

0 commit comments

Comments
 (0)