Migrate repo to use JVM toolchains Gradle feature.
^KT-46972 Fixed
This commit is contained in:
@@ -3,8 +3,7 @@ plugins {
|
||||
id("jps-compatible")
|
||||
}
|
||||
|
||||
jvmTarget = "1.6"
|
||||
javaHome = rootProject.extra["JDK_16"] as String
|
||||
project.configureJvmToolchain(JdkMajorVersion.JDK_1_6)
|
||||
|
||||
dependencies {
|
||||
api(project(":core:compiler.common"))
|
||||
@@ -15,11 +14,6 @@ sourceSets {
|
||||
"test" {}
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile> {
|
||||
sourceCompatibility = "1.6"
|
||||
targetCompatibility = "1.6"
|
||||
}
|
||||
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs += "-Xsuppress-deprecated-jvm-target-warning"
|
||||
|
||||
@@ -3,8 +3,7 @@ plugins {
|
||||
id("jps-compatible")
|
||||
}
|
||||
|
||||
jvmTarget = "1.6"
|
||||
javaHome = rootProject.extra["JDK_16"] as String
|
||||
project.configureJvmToolchain(JdkMajorVersion.JDK_1_6)
|
||||
|
||||
dependencies {
|
||||
compile(project(":core:util.runtime"))
|
||||
@@ -17,11 +16,6 @@ sourceSets {
|
||||
"test" {}
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile> {
|
||||
sourceCompatibility = "1.6"
|
||||
targetCompatibility = "1.6"
|
||||
}
|
||||
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs += "-Xsuppress-deprecated-jvm-target-warning"
|
||||
|
||||
@@ -3,8 +3,7 @@ plugins {
|
||||
id("jps-compatible")
|
||||
}
|
||||
|
||||
jvmTarget = "1.6"
|
||||
javaHome = rootProject.extra["JDK_16"] as String
|
||||
project.configureJvmToolchain(JdkMajorVersion.JDK_1_6)
|
||||
|
||||
dependencies {
|
||||
compile(project(":kotlin-annotations-jvm"))
|
||||
@@ -21,11 +20,6 @@ sourceSets {
|
||||
"test" {}
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile> {
|
||||
sourceCompatibility = "1.6"
|
||||
targetCompatibility = "1.6"
|
||||
}
|
||||
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs += "-Xsuppress-deprecated-jvm-target-warning"
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -3,8 +3,7 @@ plugins {
|
||||
id("jps-compatible")
|
||||
}
|
||||
|
||||
jvmTarget = "1.6"
|
||||
javaHome = rootProject.extra["JDK_16"] as String
|
||||
project.configureJvmToolchain(JdkMajorVersion.JDK_1_6)
|
||||
|
||||
dependencies {
|
||||
compile(project(":core:compiler.common"))
|
||||
@@ -18,11 +17,6 @@ sourceSets {
|
||||
"test" {}
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile> {
|
||||
sourceCompatibility = "1.6"
|
||||
targetCompatibility = "1.6"
|
||||
}
|
||||
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs += "-Xsuppress-deprecated-jvm-target-warning"
|
||||
|
||||
@@ -3,8 +3,7 @@ plugins {
|
||||
id("jps-compatible")
|
||||
}
|
||||
|
||||
jvmTarget = "1.6"
|
||||
javaHome = rootProject.extra["JDK_16"] as String
|
||||
project.configureJvmToolchain(JdkMajorVersion.JDK_1_6)
|
||||
|
||||
dependencies {
|
||||
api(project(":core:metadata.jvm"))
|
||||
@@ -17,11 +16,6 @@ sourceSets {
|
||||
"test" {}
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile> {
|
||||
sourceCompatibility = "1.6"
|
||||
targetCompatibility = "1.6"
|
||||
}
|
||||
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs += "-Xsuppress-deprecated-jvm-target-warning"
|
||||
|
||||
@@ -3,8 +3,7 @@ plugins {
|
||||
id("jps-compatible")
|
||||
}
|
||||
|
||||
jvmTarget = "1.6"
|
||||
javaHome = rootProject.extra["JDK_16"] as String
|
||||
project.configureJvmToolchain(JdkMajorVersion.JDK_1_6)
|
||||
|
||||
dependencies {
|
||||
api(project(":core:compiler.common"))
|
||||
@@ -16,11 +15,6 @@ sourceSets {
|
||||
"test" {}
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile> {
|
||||
sourceCompatibility = "1.6"
|
||||
targetCompatibility = "1.6"
|
||||
}
|
||||
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs += "-Xsuppress-deprecated-jvm-target-warning"
|
||||
|
||||
@@ -3,8 +3,7 @@ plugins {
|
||||
id("jps-compatible")
|
||||
}
|
||||
|
||||
jvmTarget = "1.6"
|
||||
javaHome = rootProject.extra["JDK_16"] as String
|
||||
project.configureJvmToolchain(JdkMajorVersion.JDK_1_6)
|
||||
|
||||
dependencies {
|
||||
compile(project(":core:metadata"))
|
||||
@@ -19,11 +18,6 @@ sourceSets {
|
||||
"test" {}
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile> {
|
||||
sourceCompatibility = "1.6"
|
||||
targetCompatibility = "1.6"
|
||||
}
|
||||
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs += "-Xsuppress-deprecated-jvm-target-warning"
|
||||
|
||||
@@ -3,8 +3,7 @@ plugins {
|
||||
id("jps-compatible")
|
||||
}
|
||||
|
||||
jvmTarget = "1.6"
|
||||
javaHome = rootProject.extra["JDK_16"] as String
|
||||
project.configureJvmToolchain(JdkMajorVersion.JDK_1_6)
|
||||
|
||||
dependencies {
|
||||
api(project(":core:metadata"))
|
||||
@@ -15,11 +14,6 @@ sourceSets {
|
||||
"test" {}
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile> {
|
||||
sourceCompatibility = "1.6"
|
||||
targetCompatibility = "1.6"
|
||||
}
|
||||
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs += "-Xsuppress-deprecated-jvm-target-warning"
|
||||
|
||||
@@ -3,8 +3,7 @@ plugins {
|
||||
id("jps-compatible")
|
||||
}
|
||||
|
||||
jvmTarget = "1.6"
|
||||
javaHome = rootProject.extra["JDK_16"] as String
|
||||
project.configureJvmToolchain(JdkMajorVersion.JDK_1_6)
|
||||
|
||||
dependencies {
|
||||
compile(protobufLite())
|
||||
@@ -16,11 +15,6 @@ sourceSets {
|
||||
"test" {}
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile> {
|
||||
sourceCompatibility = "1.6"
|
||||
targetCompatibility = "1.6"
|
||||
}
|
||||
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs += "-Xsuppress-deprecated-jvm-target-warning"
|
||||
|
||||
@@ -3,8 +3,7 @@ plugins {
|
||||
id("jps-compatible")
|
||||
}
|
||||
|
||||
jvmTarget = "1.6"
|
||||
javaHome = rootProject.extra["JDK_16"] as String
|
||||
project.configureJvmToolchain(JdkMajorVersion.JDK_1_6)
|
||||
|
||||
dependencies {
|
||||
compileOnly(kotlinStdlib())
|
||||
@@ -15,11 +14,6 @@ sourceSets {
|
||||
"test" {}
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile> {
|
||||
sourceCompatibility = "1.6"
|
||||
targetCompatibility = "1.6"
|
||||
}
|
||||
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs += "-Xsuppress-deprecated-jvm-target-warning"
|
||||
|
||||
Reference in New Issue
Block a user