Use JDK toolchains to explicitly use JDK 17

Explicitly mark that we want version 17 of the JDK as the compiler. Previously
we implicitly relied on Gradle getting this right. This means devs and
CI will all use the same JDK explicitly rather than implicitly.

Pin the target JDK version in build.gradle.kts, this should apply to all
targets (including Kotlin) to version 1.8 to maintain compatibility with
older devices
This commit is contained in:
David Fairbrother authored and Niels van Velzen committed 2023-04-13 21:56:26 +02:00
1 parent 45e7e6456c
commit 4bb2158cc0
2 files changed
+13

No files matched your search

+7
View File
@@ -1,5 +1,6 @@
plugins {
alias(libs.plugins.detekt)
java
}
buildscript {
@@ -9,6 +10,12 @@ buildscript {
}
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of("17"))
}
}
subprojects {
// Configure linting
apply<io.gitlab.arturbosch.detekt.DetektPlugin>()
+6
View File
@@ -2,6 +2,12 @@ plugins {
`kotlin-dsl`
}
kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of("17"))
}
}
repositories {
mavenCentral()
}