[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:
Yahor Berdnikau
2023-02-10 19:59:01 +01:00
committed by Space Team
parent 4ab39b908e
commit 0cad069522
13 changed files with 132 additions and 6 deletions
+10
View File
@@ -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()
}