From 7cec2bc5a7d4d139c79c8267d6d54691d957e08d Mon Sep 17 00:00:00 2001 From: Matthias Gugel Date: Sat, 11 Dec 2021 23:33:18 +0100 Subject: [PATCH] Upgrade Java language level to 11 --- build.gradle.kts | 15 ++++++++++++--- gradle.properties | 3 +++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 48bfc75..cf4fc6c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + fun properties(key: String) = project.findProperty(key).toString() plugins { @@ -19,9 +21,16 @@ intellij { } tasks { - withType { - kotlinOptions { - jvmTarget = "1.8" + // Set the JVM compatibility versions + properties("javaVersion").let { + withType { + sourceCompatibility = it + targetCompatibility = it + } + withType { + kotlinOptions { + jvmTarget = it + } } } diff --git a/gradle.properties b/gradle.properties index b03bc5a..5196fe9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,6 +6,9 @@ pluginName = filename_template pluginVersion = 1.2.0-213 platformVersion = 2021.3 +# Java language level used to compile sources and to generate the files for - Java 11 is required since 2020.3 +javaVersion = 11 + gradleVersion = 7.3 # Opt-out flag for bundling Kotlin standard library.