[Build] Pin api and language level to 1.8 in Kotlin compiler modules used by KGP
This is required to be able to compile KGP and it's dependencies which set LV to 1.4 when repo will use LV 1.9. This caused by the change how enums are compiled (KT-48872).
This commit is contained in:
committed by
Space Team
parent
4ab39b908e
commit
0cad069522
@@ -1,3 +1,6 @@
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion as GradleKotlinVersion
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
|
||||
|
||||
description = "Kotlin Build Common"
|
||||
|
||||
plugins {
|
||||
@@ -46,3 +49,10 @@ projectTest(parallel = true)
|
||||
projectTest("testJUnit5", jUnitMode = JUnitMode.JUnit5, parallel = true) {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
// 1.9 level breaks Kotlin Gradle plugins via changes in enums (KT-48872)
|
||||
// We limit api and LV until KGP will stop using Kotlin compiler directly (KT-56574)
|
||||
tasks.withType<KotlinCompilationTask<*>>().configureEach {
|
||||
compilerOptions.apiVersion.value(GradleKotlinVersion.KOTLIN_1_8).finalizeValueOnRead()
|
||||
compilerOptions.languageVersion.value(GradleKotlinVersion.KOTLIN_1_8).finalizeValueOnRead()
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("jps-compatible")
|
||||
@@ -27,3 +30,10 @@ tasks.getByName<Jar>("jar") {
|
||||
//excludes unused bunch files
|
||||
exclude("META-INF/extensions/*.xml.**")
|
||||
}
|
||||
|
||||
// 1.9 level breaks Kotlin Gradle plugins via changes in enums (KT-48872)
|
||||
// We limit api and LV until KGP will stop using Kotlin compiler directly (KT-56574)
|
||||
tasks.withType<KotlinCompilationTask<*>>().configureEach {
|
||||
compilerOptions.apiVersion.value(KotlinVersion.KOTLIN_1_8).finalizeValueOnRead()
|
||||
compilerOptions.languageVersion.value(KotlinVersion.KOTLIN_1_8).finalizeValueOnRead()
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("jps-compatible")
|
||||
@@ -13,3 +16,10 @@ sourceSets {
|
||||
"main" { projectDefault() }
|
||||
"test" { }
|
||||
}
|
||||
|
||||
// 1.9 level breaks Kotlin Gradle plugins via changes in enums (KT-48872)
|
||||
// We limit api and LV until KGP will stop using Kotlin compiler directly (KT-56574)
|
||||
tasks.withType<KotlinCompilationTask<*>>().configureEach {
|
||||
compilerOptions.apiVersion.value(KotlinVersion.KOTLIN_1_8).finalizeValueOnRead()
|
||||
compilerOptions.languageVersion.value(KotlinVersion.KOTLIN_1_8).finalizeValueOnRead()
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
|
||||
|
||||
description = "Kotlin Daemon Client"
|
||||
|
||||
plugins {
|
||||
@@ -35,11 +38,14 @@ dependencies {
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
|
||||
kotlinOptions {
|
||||
tasks.withType<KotlinCompilationTask<*>> {
|
||||
compilerOptions {
|
||||
// This module is being run from within Gradle, older versions of which only have older kotlin-stdlib in the runtime classpath.
|
||||
apiVersion = "1.4"
|
||||
freeCompilerArgs += "-Xsuppress-version-warnings"
|
||||
@Suppress("DEPRECATION")
|
||||
apiVersion.set(KotlinVersion.KOTLIN_1_4)
|
||||
@Suppress("DEPRECATION")
|
||||
languageVersion.set(KotlinVersion.KOTLIN_1_4)
|
||||
freeCompilerArgs.add("-Xsuppress-version-warnings")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("jps-compatible")
|
||||
@@ -16,3 +19,11 @@ sourceSets {
|
||||
"main" { projectDefault() }
|
||||
"test" {}
|
||||
}
|
||||
|
||||
// 1.9 level breaks Kotlin Gradle plugins via changes in enums (KT-48872)
|
||||
// We limit api and LV until KGP will stop using Kotlin compiler directly (KT-56574)
|
||||
tasks.withType<KotlinCompilationTask<*>>().configureEach {
|
||||
compilerOptions.apiVersion.value(KotlinVersion.KOTLIN_1_8).finalizeValueOnRead()
|
||||
compilerOptions.languageVersion.value(KotlinVersion.KOTLIN_1_8).finalizeValueOnRead()
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
|
||||
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("jps-compatible")
|
||||
@@ -14,3 +18,10 @@ sourceSets {
|
||||
"main" { projectDefault() }
|
||||
"test" {}
|
||||
}
|
||||
|
||||
// 1.9 level breaks Kotlin Gradle plugins via changes in enums (KT-48872)
|
||||
// We limit api and LV until KGP will stop using Kotlin compiler directly (KT-56574)
|
||||
tasks.withType<KotlinCompilationTask<*>>().configureEach {
|
||||
compilerOptions.apiVersion.value(KotlinVersion.KOTLIN_1_8).finalizeValueOnRead()
|
||||
compilerOptions.languageVersion.value(KotlinVersion.KOTLIN_1_8).finalizeValueOnRead()
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
@@ -53,3 +55,10 @@ projectTest("testJvmICWithJdk11", parallel = true) {
|
||||
}
|
||||
|
||||
testsJar()
|
||||
|
||||
// 1.9 level breaks Kotlin Gradle plugins via changes in enums (KT-48872)
|
||||
// We limit api and LV until KGP will stop using Kotlin compiler directly (KT-56574)
|
||||
tasks.withType<KotlinCompilationTask<*>>().configureEach {
|
||||
compilerOptions.apiVersion.value(KotlinVersion.KOTLIN_1_8).finalizeValueOnRead()
|
||||
compilerOptions.languageVersion.value(KotlinVersion.KOTLIN_1_8).finalizeValueOnRead()
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion as GradleKotlinVersion
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("jps-compatible")
|
||||
@@ -21,3 +24,10 @@ sourceSets {
|
||||
}
|
||||
"test" {}
|
||||
}
|
||||
|
||||
// 1.9 level breaks Kotlin Gradle plugins via changes in enums (KT-48872)
|
||||
// We limit api and LV until KGP will stop using Kotlin compiler directly (KT-56574)
|
||||
tasks.withType<KotlinCompilationTask<*>>().configureEach {
|
||||
compilerOptions.apiVersion.value(GradleKotlinVersion.KOTLIN_1_8).finalizeValueOnRead()
|
||||
compilerOptions.languageVersion.value(GradleKotlinVersion.KOTLIN_1_8).finalizeValueOnRead()
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("jps-compatible")
|
||||
@@ -15,3 +18,10 @@ sourceSets {
|
||||
"main" { projectDefault() }
|
||||
"test" {}
|
||||
}
|
||||
|
||||
// 1.9 level breaks Kotlin Gradle plugins via changes in enums (KT-48872)
|
||||
// We limit api and LV until KGP will stop using Kotlin compiler directly (KT-56574)
|
||||
tasks.withType<KotlinCompilationTask<*>>().configureEach {
|
||||
compilerOptions.apiVersion.value(KotlinVersion.KOTLIN_1_8).finalizeValueOnRead()
|
||||
compilerOptions.languageVersion.value(KotlinVersion.KOTLIN_1_8).finalizeValueOnRead()
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("jps-compatible")
|
||||
@@ -13,3 +16,10 @@ sourceSets {
|
||||
"main" { projectDefault() }
|
||||
"test" {}
|
||||
}
|
||||
|
||||
// 1.9 level breaks Kotlin Gradle plugins via changes in enums (KT-48872)
|
||||
// We limit api and LV until KGP will stop using Kotlin compiler directly (KT-56574)
|
||||
tasks.withType<KotlinCompilationTask<*>>().configureEach {
|
||||
compilerOptions.apiVersion.value(KotlinVersion.KOTLIN_1_8).finalizeValueOnRead()
|
||||
compilerOptions.languageVersion.value(KotlinVersion.KOTLIN_1_8).finalizeValueOnRead()
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("jps-compatible")
|
||||
@@ -27,3 +30,10 @@ publish()
|
||||
runtimeJar()
|
||||
sourcesJar()
|
||||
javadocJar()
|
||||
|
||||
// 1.9 level breaks Kotlin Gradle plugins via changes in enums (KT-48872)
|
||||
// We limit api and LV until KGP will stop using Kotlin compiler directly (KT-56574)
|
||||
tasks.withType<KotlinCompilationTask<*>>().configureEach {
|
||||
compilerOptions.apiVersion.value(KotlinVersion.KOTLIN_1_8).finalizeValueOnRead()
|
||||
compilerOptions.languageVersion.value(KotlinVersion.KOTLIN_1_8).finalizeValueOnRead()
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
|
||||
import plugins.KotlinBuildPublishingPlugin.Companion.ADHOC_COMPONENT_NAME
|
||||
|
||||
plugins {
|
||||
@@ -7,9 +9,16 @@ plugins {
|
||||
id("org.jetbrains.kotlinx.binary-compatibility-validator")
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
tasks.withType<KotlinCompilationTask<*>>().configureEach {
|
||||
compilerOptions {
|
||||
apiVersion.value(KotlinVersion.KOTLIN_1_5).finalizeValueOnRead()
|
||||
languageVersion.value(KotlinVersion.KOTLIN_1_5).finalizeValueOnRead()
|
||||
freeCompilerArgs.add("-Xsuppress-version-warnings")
|
||||
}
|
||||
}
|
||||
|
||||
kotlin.sourceSets.configureEach {
|
||||
languageSettings.apiVersion = "1.4"
|
||||
languageSettings.languageVersion = "1.4"
|
||||
languageSettings.optIn("org.jetbrains.kotlin.gradle.InternalKotlinGradlePluginApi")
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
}
|
||||
@@ -36,3 +39,10 @@ projectTest(parallel = false) {
|
||||
runtimeJar()
|
||||
sourcesJar()
|
||||
javadocJar()
|
||||
|
||||
// 1.9 level breaks Kotlin Gradle plugins via changes in enums (KT-48872)
|
||||
// We limit api and LV until KGP will stop using Kotlin compiler directly (KT-56574)
|
||||
tasks.withType<KotlinCompilationTask<*>>().configureEach {
|
||||
compilerOptions.apiVersion.value(KotlinVersion.KOTLIN_1_8).finalizeValueOnRead()
|
||||
compilerOptions.languageVersion.value(KotlinVersion.KOTLIN_1_8).finalizeValueOnRead()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user