From a86cc3d695a35d5a5da7969f1b86fb8e3bbd3d29 Mon Sep 17 00:00:00 2001 From: Username404 Date: Wed, 27 Oct 2021 23:58:05 +0200 Subject: [PATCH] Revert "Use gradle toolchains in the buildscript" This reverts commit 84ea864e --- build.gradle.kts | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index e12044a..ef19160 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -32,7 +32,6 @@ version = "0.3.2" val groupAndName = "${rootProject.group}.${rootProject.name.toLowerCase()}" val javaVer: String = "8" -val sourceJavaVer: String = "16" val kotlinVer: String by rootProject val kotlinBaseVer = kotlinVer.substring(0..2) val serializationVer: String by rootProject @@ -41,10 +40,6 @@ val mcBase: String = (rootProject.property("minecraft") as String).also { }.substring(0..3) val kotlinX: String = "org.jetbrains.kotlinx" -val toolchainJavaVersion = Action { - languageVersion.set(JavaLanguageVersion.of(sourceJavaVer.toInt())) -} - subprojects { group = rootProject.group.toString() apply(plugin = "org.cqfn.diktat.diktat-gradle-plugin") @@ -196,8 +191,6 @@ allprojects { apply(plugin = "java") apply(plugin = "org.jetbrains.kotlin.jvm") apply(plugin = "architectury-plugin") - val compiler = javaToolchains.compilerFor(toolchainJavaVersion) - val launcher = javaToolchains.launcherFor(toolchainJavaVersion) dependencies { implementation(kotlin("stdlib-jdk8", kotlinVer)) implementation(kotlin("reflect", kotlinVer)) @@ -205,7 +198,6 @@ allprojects { } tasks { withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class) { - kotlinJavaToolchain.toolchain.use(launcher) with(kotlinOptions) { // https://github.com/JetBrains/kotlin/blob/master/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt freeCompilerArgs = listOf( @@ -224,10 +216,9 @@ allprojects { encoding = "UTF-8" isFork = true release.set(javaVer.toInt()) - javaCompiler.set(compiler) - sourceCompatibility = sourceJavaVer + sourceCompatibility = "11" targetCompatibility = javaVer - compilerArgs.addAll(listOf("-Xplugin:jabel")) + compilerArgs.add("-Xplugin:jabel") } } withType(ProcessResources::class) {