Skip to content

Commit

Permalink
Merge pull request #33063 from snazy/gradle-java-20
Browse files Browse the repository at this point in the history
Gradle modules build: Allow Java 20
  • Loading branch information
gsmet authored May 4, 2023
2 parents 7950ca5 + 5e1b9da commit 113b0bd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions devtools/gradle/build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,13 @@ dependencies {
implementation(plugin("com.gradle.plugin-publish", "1.2.0"))
}

java { toolchain {
// this is fine, even for Java 1.x
val javaMajor = JavaVersion.current().majorVersion.toInt()
// Need to limit the Java version for Kotlin to 17, because 20 doesn't work.
// Also prefer the current version to prevent JDK downloads.
languageVersion.set(JavaLanguageVersion.of(javaMajor.coerceAtMost(17)))
} }

fun DependencyHandler.plugin(id: String, version: String) =
create("$id:$id.gradle.plugin:$version")

0 comments on commit 113b0bd

Please sign in to comment.