Skip to content

Commit ad7f8ba

Browse files
committed
gradle: Build with JDK 21
Checkstyle was already requiring JDK 21 and now about libraries need it too Use the kotlin extension method as it will also configure it for java code Ref: https://kotlinlang.org/docs/gradle-configure-project.html#gradle-java-toolchains-support Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
1 parent ff597f8 commit ad7f8ba

1 file changed

Lines changed: 1 addition & 13 deletions

File tree

app/build.gradle.kts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,8 @@ val gitWorkingBranch = providers.exec {
2020
commandLine("git", "rev-parse", "--abbrev-ref", "HEAD")
2121
}.standardOutput.asText.map { it.trim() }
2222

23-
java {
24-
toolchain {
25-
languageVersion = JavaLanguageVersion.of(17)
26-
}
27-
}
28-
2923
kotlin {
24+
jvmToolchain(21)
3025
compilerOptions {
3126
// TODO: Drop annotation default target when it is stable
3227
freeCompilerArgs.addAll(
@@ -137,13 +132,6 @@ ksp {
137132
// Custom dependency configuration for ktlint
138133
val ktlint by configurations.creating
139134

140-
// https://checkstyle.org/#JRE_and_JDK
141-
tasks.withType<Checkstyle>().configureEach {
142-
javaLauncher = javaToolchains.launcherFor {
143-
languageVersion = JavaLanguageVersion.of(21)
144-
}
145-
}
146-
147135
checkstyle {
148136
configDirectory = rootProject.file("checkstyle")
149137
isIgnoreFailures = false

0 commit comments

Comments
 (0)