Skip to content

Commit 7c7e57a

Browse files
committed
add a way to set the java compiler version in the gradle build
1 parent e207470 commit 7c7e57a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

silabs-pti/build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ java {
2929
withJavadocJar()
3030
withSourcesJar()
3131
toolchain {
32-
languageVersion = JavaLanguageVersion.of(11)
32+
def requestedVersion = providers
33+
.systemProperty("javaVersion")
34+
.orElse(providers.environmentVariable("JAVA_VERSION"))
35+
.orElse("11") // fallback if nothing set
36+
languageVersion = JavaLanguageVersion.of(requestedVersion.get().toInteger())
3337
}
3438
}
3539

0 commit comments

Comments
 (0)