Migrate repo to use JVM toolchains Gradle feature.
^KT-46972 Fixed
This commit is contained in:
@@ -1,10 +1,24 @@
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
import org.jetbrains.kotlin.gradle.tasks.UsesKotlinJavaToolchain
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("jps-compatible")
|
||||
}
|
||||
|
||||
// Only compilation tasks should use JDK 1.6
|
||||
project.disableDeprecatedJvmTargetWarning()
|
||||
tasks
|
||||
.matching { it.name == "compileKotlin" && it is UsesKotlinJavaToolchain }
|
||||
.configureEach {
|
||||
(this as UsesKotlinJavaToolchain).kotlinJavaToolchain.toolchain.use(project.getToolchainLauncherFor(JdkMajorVersion.JDK_1_6))
|
||||
}
|
||||
|
||||
tasks
|
||||
.matching { it.name == "compileJava" && it is JavaCompile }
|
||||
.configureEach {
|
||||
(this as JavaCompile).javaCompiler.set(project.getToolchainCompilerFor(JdkMajorVersion.JDK_1_6))
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly(project(":core:util.runtime"))
|
||||
compileOnly(project(":core:descriptors"))
|
||||
@@ -23,19 +37,6 @@ sourceSets {
|
||||
"test" { projectDefault() }
|
||||
}
|
||||
|
||||
val compileJava by tasks.getting(JavaCompile::class) {
|
||||
sourceCompatibility = "1.6"
|
||||
targetCompatibility = "1.6"
|
||||
}
|
||||
|
||||
val compileKotlin by tasks.getting(KotlinCompile::class) {
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.6"
|
||||
jdkHome = rootProject.extra["JDK_16"] as String
|
||||
freeCompilerArgs += "-Xsuppress-deprecated-jvm-target-warning"
|
||||
}
|
||||
}
|
||||
|
||||
val generateTests by generator("org.jetbrains.kotlin.generators.tests.GenerateRuntimeDescriptorTestsKt")
|
||||
|
||||
projectTest(parallel = true) {
|
||||
|
||||
Reference in New Issue
Block a user