Explicitly use language version 1.9 for K2-unsupported parts
This commit explicitly sets LV 1.9 for all projects with disabled FIR bootstrap, as well as for libraries, including Native stdlib. Related to KT-59171
This commit is contained in:
committed by
Space Team
parent
648c1f4599
commit
e76cf24d01
@@ -589,6 +589,8 @@ konanArtifacts {
|
|||||||
"-opt-in=kotlin.contracts.ExperimentalContracts",
|
"-opt-in=kotlin.contracts.ExperimentalContracts",
|
||||||
"-opt-in=kotlin.ExperimentalMultiplatform",
|
"-opt-in=kotlin.ExperimentalMultiplatform",
|
||||||
"-opt-in=kotlin.native.internal.InternalForKotlinNative",
|
"-opt-in=kotlin.native.internal.InternalForKotlinNative",
|
||||||
|
"-language-version",
|
||||||
|
"1.9",
|
||||||
)
|
)
|
||||||
|
|
||||||
commonStdlibSrcDirs.forEach { commonSrcDir(it) }
|
commonStdlibSrcDirs.forEach { commonSrcDir(it) }
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import org.gradle.api.plugins.BasePluginExtension
|
|||||||
import org.gradle.api.tasks.compile.JavaCompile
|
import org.gradle.api.tasks.compile.JavaCompile
|
||||||
import org.gradle.kotlin.dsl.*
|
import org.gradle.kotlin.dsl.*
|
||||||
import org.gradle.process.CommandLineArgumentProvider
|
import org.gradle.process.CommandLineArgumentProvider
|
||||||
|
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
|
||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
|
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
|
||||||
|
|
||||||
@@ -71,8 +72,14 @@ fun Project.configureFrontendIr() = tasks.withType<KotlinJvmCompile>().configure
|
|||||||
if (project.kotlinBuildProperties.useFirForLibraries) {
|
if (project.kotlinBuildProperties.useFirForLibraries) {
|
||||||
freeCompilerArgs.add("-Xuse-k2")
|
freeCompilerArgs.add("-Xuse-k2")
|
||||||
allWarningsAsErrors.set(false)
|
allWarningsAsErrors.set(false)
|
||||||
} else if (project.kotlinBuildProperties.useFir) {
|
} else {
|
||||||
freeCompilerArgs.add("-Xskip-prerelease-check")
|
if (project.kotlinBuildProperties.useFir) {
|
||||||
|
freeCompilerArgs.add("-Xskip-prerelease-check")
|
||||||
|
}
|
||||||
|
if (languageVersion.get() >= KotlinVersion.KOTLIN_2_0) {
|
||||||
|
languageVersion.set(KotlinVersion.KOTLIN_1_9)
|
||||||
|
progressiveMode.set(false)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val renderDiagnosticNames by extra(project.kotlinBuildProperties.renderDiagnosticNames)
|
val renderDiagnosticNames by extra(project.kotlinBuildProperties.renderDiagnosticNames)
|
||||||
|
|||||||
+5
@@ -1,4 +1,5 @@
|
|||||||
import org.gradle.internal.deprecation.DeprecatableConfiguration
|
import org.gradle.internal.deprecation.DeprecatableConfiguration
|
||||||
|
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
|
||||||
import org.jetbrains.kotlin.gradle.plugin.KotlinBasePluginWrapper
|
import org.jetbrains.kotlin.gradle.plugin.KotlinBasePluginWrapper
|
||||||
|
|
||||||
// Contains common configuration that should be applied to all projects
|
// Contains common configuration that should be applied to all projects
|
||||||
@@ -196,6 +197,10 @@ fun Project.configureKotlinCompilationOptions() {
|
|||||||
freeCompilerArgs += "-Xskip-prerelease-check"
|
freeCompilerArgs += "-Xskip-prerelease-check"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (KotlinVersion.DEFAULT >= KotlinVersion.KOTLIN_2_0 && project.path in projectsWithDisabledFirBootstrap) {
|
||||||
|
languageVersion = "1.9"
|
||||||
|
options.progressiveMode.set(false)
|
||||||
|
}
|
||||||
if (renderDiagnosticNames) {
|
if (renderDiagnosticNames) {
|
||||||
freeCompilerArgs += "-Xrender-internal-diagnostic-names"
|
freeCompilerArgs += "-Xrender-internal-diagnostic-names"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user