Skip to content

Commit 43f40c4

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 c992b85 commit 43f40c4

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
@@ -24,13 +24,8 @@ val gitWorkingBranch = providers.exec {
2424
commandLine("git", "rev-parse", "--abbrev-ref", "HEAD")
2525
}.standardOutput.asText.map { it.trim() }
2626

27-
java {
28-
toolchain {
29-
languageVersion = JavaLanguageVersion.of(17)
30-
}
31-
}
32-
3327
kotlin {
28+
jvmToolchain(21)
3429
compilerOptions {
3530
// TODO: Drop annotation default target when it is stable
3631
freeCompilerArgs.addAll(
@@ -142,13 +137,6 @@ ksp {
142137
// Custom dependency configuration for ktlint
143138
val ktlint by configurations.creating
144139

145-
// https://checkstyle.org/#JRE_and_JDK
146-
tasks.withType<Checkstyle>().configureEach {
147-
javaLauncher = javaToolchains.launcherFor {
148-
languageVersion = JavaLanguageVersion.of(21)
149-
}
150-
}
151-
152140
checkstyle {
153141
configDirectory = rootProject.file("checkstyle")
154142
isIgnoreFailures = false

0 commit comments

Comments
 (0)