Bump language version for Gradle plugins' dependencies to 1.5
#KT-58569 Fixed
This commit is contained in:
committed by
Space Team
parent
3de59e3f17
commit
44d9a2136b
@@ -29,6 +29,7 @@ import org.jetbrains.dokka.DokkaVersion
|
|||||||
import org.jetbrains.dokka.gradle.DokkaTask
|
import org.jetbrains.dokka.gradle.DokkaTask
|
||||||
import org.jetbrains.dokka.gradle.GradleExternalDocumentationLinkBuilder
|
import org.jetbrains.dokka.gradle.GradleExternalDocumentationLinkBuilder
|
||||||
import org.jetbrains.kotlin.gradle.dsl.KotlinSingleJavaTargetExtension
|
import org.jetbrains.kotlin.gradle.dsl.KotlinSingleJavaTargetExtension
|
||||||
|
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
|
||||||
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
|
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
|
||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||||
import plugins.configureDefaultPublishing
|
import plugins.configureDefaultPublishing
|
||||||
@@ -504,15 +505,25 @@ private fun Project.commonVariantAttributes(): Action<Configuration> = Action<Co
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun Project.configureKotlinCompileTasksGradleCompatibility() {
|
fun Project.configureKotlinCompileTasksGradleCompatibility() {
|
||||||
@Suppress("DEPRECATION")
|
|
||||||
tasks.withType<KotlinCompile>().configureEach {
|
tasks.withType<KotlinCompile>().configureEach {
|
||||||
kotlinOptions.languageVersion = "1.4"
|
compilerOptions {
|
||||||
kotlinOptions.apiVersion = "1.4"
|
// check https://docs.gradle.org/current/userguide/compatibility.html#kotlin for Kotlin-Gradle versions matrix
|
||||||
kotlinOptions.freeCompilerArgs += listOf(
|
@Suppress("DEPRECATION") // we can't use language version greater than 1.5 as minimal supported Gradle embeds Kotlin 1.4
|
||||||
"-Xskip-prerelease-check",
|
languageVersion.set(KotlinVersion.KOTLIN_1_5)
|
||||||
"-Xsuppress-version-warnings",
|
@Suppress("DEPRECATION") // we can't use api version greater than 1.4 as minimal supported Gradle version uses kotlin-stdlib 1.4
|
||||||
"-Xuse-ir" // Needed as long as languageVersion is less than 1.5.
|
apiVersion.set(KotlinVersion.KOTLIN_1_4)
|
||||||
)
|
freeCompilerArgs.addAll(
|
||||||
|
listOf(
|
||||||
|
"-Xskip-prerelease-check",
|
||||||
|
"-Xsuppress-version-warnings",
|
||||||
|
// We have to override the default value for `-Xsam-conversions` to `class`
|
||||||
|
// otherwise the compiler would compile lambdas using invokedynamic,
|
||||||
|
// such lambdas are not serializable so are not compatible with Gradle configuration cache.
|
||||||
|
// It doesn't lead to a significant difference in binaries sizes, and previously (before LV 1.5) the `class` value was set by default.
|
||||||
|
"-Xsam-conversions=class",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,15 +14,7 @@ sourceSets {
|
|||||||
"test" { projectDefault() }
|
"test" { projectDefault() }
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
configureKotlinCompileTasksGradleCompatibility()
|
||||||
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
|
|
||||||
kotlinOptions {
|
|
||||||
languageVersion = "1.4"
|
|
||||||
apiVersion = "1.4"
|
|
||||||
freeCompilerArgs += listOf("-Xsuppress-version-warnings", "-Xinline-classes")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
publish()
|
publish()
|
||||||
|
|
||||||
|
|||||||
@@ -18,13 +18,7 @@ sourceSets {
|
|||||||
"test" { projectDefault() }
|
"test" { projectDefault() }
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType<KotlinCompile>().configureEach {
|
configureKotlinCompileTasksGradleCompatibility()
|
||||||
kotlinOptions {
|
|
||||||
languageVersion = "1.4"
|
|
||||||
apiVersion = "1.4"
|
|
||||||
freeCompilerArgs += listOf("-Xsuppress-version-warnings")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
publish()
|
publish()
|
||||||
|
|
||||||
|
|||||||
@@ -24,13 +24,7 @@ projectTest(jUnitMode = JUnitMode.JUnit5) {
|
|||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType<KotlinJvmCompile>().configureEach {
|
configureKotlinCompileTasksGradleCompatibility()
|
||||||
kotlinOptions {
|
|
||||||
languageVersion = "1.4"
|
|
||||||
apiVersion = "1.4"
|
|
||||||
freeCompilerArgs += listOf("-Xskip-prerelease-check", "-Xsuppress-version-warnings")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.named<KotlinJvmCompile>("compileTestFixturesKotlin") {
|
tasks.named<KotlinJvmCompile>("compileTestFixturesKotlin") {
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
|
|||||||
@@ -9,11 +9,6 @@ sourcesJar()
|
|||||||
javadocJar()
|
javadocJar()
|
||||||
configureKotlinCompileTasksGradleCompatibility()
|
configureKotlinCompileTasksGradleCompatibility()
|
||||||
|
|
||||||
kotlin.sourceSets.configureEach {
|
|
||||||
languageSettings.apiVersion = "1.4"
|
|
||||||
languageSettings.languageVersion = "1.4"
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api(platform(project(":kotlin-gradle-plugins-bom")))
|
api(platform(project(":kotlin-gradle-plugins-bom")))
|
||||||
compileOnly(kotlinStdlib())
|
compileOnly(kotlinStdlib())
|
||||||
|
|||||||
@@ -22,15 +22,9 @@ sourceSets {
|
|||||||
"test" { projectDefault() }
|
"test" { projectDefault() }
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
configureKotlinCompileTasksGradleCompatibility()
|
||||||
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
|
|
||||||
kotlinOptions {
|
|
||||||
languageVersion = "1.4"
|
|
||||||
apiVersion = "1.4"
|
|
||||||
freeCompilerArgs += "-Xsuppress-version-warnings"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
tasks {
|
||||||
withType<Test>().configureEach {
|
withType<Test>().configureEach {
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user