diff --git a/build.gradle.kts b/build.gradle.kts index 2a255b5f..fd391070 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -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 { @@ -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) } }