diff --git a/build.gradle.kts b/build.gradle.kts index 57f569e7..6e49ced1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,6 +2,7 @@ import com.github.benmanes.gradle.versions.reporter.PlainTextReporter import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask import java.nio.file.Files import java.nio.file.StandardCopyOption +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { alias(libs.plugins.kotlin.jvm) @@ -23,6 +24,14 @@ allprojects { } } +tasks.withType().configureEach { + kotlinOptions.jvmTarget = libs.versions.jvmTargetVersion.get() +} + +tasks.withType().configureEach { + options.release.set(libs.versions.jvmTargetVersion.get().toInt()) +} + tasks.withType { gradleReleaseChannel = "current" @@ -416,3 +425,4 @@ tasks.register("packageAll") { } } } + diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 20d69a2b..85aadde3 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + plugins { `kotlin-dsl-base` } @@ -11,3 +13,11 @@ kotlin { languageVersion.set(JavaLanguageVersion.of(libs.versions.jdkVersion.get())) } } + +tasks.withType().configureEach { + kotlinOptions.jvmTarget = libs.versions.jvmTargetVersion.get() +} + +tasks.withType().configureEach { + options.release.set(libs.versions.jvmTargetVersion.get().toInt()) +}