Skip to content

Commit

Permalink
Allow builds with more recent JDKs again
Browse files Browse the repository at this point in the history
  • Loading branch information
JojOatXGME committed May 3, 2024
1 parent 5fc28d3 commit 8811d96
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import org.jetbrains.changelog.Changelog
import org.jetbrains.changelog.markdownToHTML
import org.jetbrains.intellij.tasks.RunPluginVerifierTask.FailureLevel
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import java.util.EnumSet

plugins {
Expand All @@ -27,9 +28,16 @@ group = pluginGroup
version = pluginVersion

java {
toolchain {
// Set JVM version targeted by Java and Kotlin
languageVersion = JavaLanguageVersion.of(17)
// Don't use Gradle's toolchain feature as it prevents building the project with more recent JDKs. Related issues:
// https://github.com/gradle/gradle/issues/16256 - Ability to set a min language version for a toolchain
// https://github.com/gradle/gradle/issues/17444 - Toolchains feature does not appear to treat Java as backwards compatible
// https://github.com/gradle/gradle/issues/18894 - More flexibility in querying Java toolchains
sourceCompatibility = JavaVersion.VERSION_17
}

kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
}
}

Expand Down

0 comments on commit 8811d96

Please sign in to comment.