Skip to content

Commit bbbbd9c

Browse files
committed
Extract modular Java toolchain version to a property
1 parent ab24af3 commit bbbbd9c

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

build.gradle.kts

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ infra {
1515
}
1616

1717
val mainJavaToolchainVersion by ext(project.property("java.mainToolchainVersion"))
18+
val modularJavaToolchainVersion by ext(project.property("java.modularToolchainVersion"))
1819

1920
allprojects {
2021
repositories {

core/build.gradle.kts

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ base {
1919
}
2020

2121
val mainJavaToolchainVersion: String by project
22+
val modularJavaToolchainVersion: String by project
2223
val serializationVersion: String by project
2324

2425
java {
@@ -214,7 +215,7 @@ tasks {
214215
val targetDir = compileKotlinJvm.destinationDir.resolve("../java9/")
215216

216217
// Use a Java 11 compiler for the module info.
217-
javaCompiler.set(project.javaToolchains.compilerFor { languageVersion.set(JavaLanguageVersion.of(11)) })
218+
javaCompiler.set(project.javaToolchains.compilerFor { languageVersion.set(JavaLanguageVersion.of(modularJavaToolchainVersion)) })
218219

219220
// Always compile kotlin classes before the module descriptor.
220221
dependsOn(compileKotlinJvm)

gradle.properties

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ kotlinVersion=1.5.30
99
serializationVersion=1.3.0
1010

1111
java.mainToolchainVersion=8
12+
java.modularToolchainVersion=11
1213

1314
kotlin.mpp.enableGranularSourceSetsMetadata=true
1415
kotlin.mpp.enableCompatibilityMetadataVariant=true

0 commit comments

Comments
 (0)