Skip to content

Commit

Permalink
[Build] Don't set deprecated LV for modules during JPS import
Browse files Browse the repository at this point in the history
JPS doesn't support running compilation with kotlin compiler of the
  version different from the one specified in `.idea/compiler.xml`.
  And the latest bootstrap doesn't support LV=1.5
  • Loading branch information
demiurg906 authored and qodana-bot committed Oct 7, 2024
1 parent ee5bf98 commit 4659797
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class KotlinToolingVersion(
}

val maturity: Maturity = run {
@Suppress("DEPRECATION_ERROR") // needed when compiled with AV > 1.4
val classifier = this.classifier?.toLowerCase(Locale.ROOT)
when {
classifier == null || classifier.matches(Regex("""(release-)?\d+""")) -> Maturity.STABLE
Expand Down Expand Up @@ -129,6 +130,7 @@ class KotlinToolingVersion(
if (this.major != other.major) return false
if (this.minor != other.minor) return false
if (this.patch != other.patch) return false
@Suppress("DEPRECATION_ERROR") // needed when compiled with AV > 1.4
if (this.classifier?.toLowerCase(Locale.ROOT) != other.classifier?.toLowerCase(Locale.ROOT)) return false
return true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -543,11 +543,13 @@ private fun Project.commonVariantAttributes(): Action<Configuration> = Action<Co
fun Project.configureKotlinCompileTasksGradleCompatibility() {
tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
// check https://docs.gradle.org/current/userguide/compatibility.html#kotlin for Kotlin-Gradle versions matrix
@Suppress("DEPRECATION", "DEPRECATION_ERROR") // we can't use language version greater than 1.5 as minimal supported Gradle embeds Kotlin 1.4
languageVersion.set(KotlinVersion.KOTLIN_1_5)
@Suppress("DEPRECATION", "DEPRECATION_ERROR") // we can't use api version greater than 1.4 as minimal supported Gradle version uses kotlin-stdlib 1.4
apiVersion.set(KotlinVersion.KOTLIN_1_4)
if (!kotlinBuildProperties.isInJpsBuildIdeaSync) {
// check https://docs.gradle.org/current/userguide/compatibility.html#kotlin for Kotlin-Gradle versions matrix
@Suppress("DEPRECATION", "DEPRECATION_ERROR") // we can't use language version greater than 1.5 as minimal supported Gradle embeds Kotlin 1.4
languageVersion.set(KotlinVersion.KOTLIN_1_5)
@Suppress("DEPRECATION", "DEPRECATION_ERROR") // we can't use api version greater than 1.4 as minimal supported Gradle version uses kotlin-stdlib 1.4
apiVersion.set(KotlinVersion.KOTLIN_1_4)
}
freeCompilerArgs.addAll(
listOf(
"-Xskip-prerelease-check",
Expand Down

0 comments on commit 4659797

Please sign in to comment.