Skip to content

Commit

Permalink
Remove API/language version override checks
Browse files Browse the repository at this point in the history
These aren't necessary since kotlin-dsl is not applied to the project
anymore. There is nothing else that is setting the API or language version.
  • Loading branch information
3flex committed Jan 20, 2024
1 parent 0037ff7 commit f569894
Showing 1 changed file with 6 additions and 22 deletions.
28 changes: 6 additions & 22 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -165,34 +165,18 @@ sourceSets {
}
}

// Supporting Gradle 6.2+ needs to use Kotlin 1.3.
// See https://docs.gradle.org/current/userguide/compatibility.html
// For future maintainer: Kotlin 1.9.0 dropped support for Kotlin 1.3, it'll only support 1.4+.
// This means Gradle 7.0 will be the lowest supportable version for plugins.
val usedKotlinVersion = @Suppress("DEPRECATION") KotlinVersion.KOTLIN_1_3

kotlin.target.compilations.configureEach {
compileTaskProvider.configure {
// Validate that we're using the right version.
doFirst {
val api = compilerOptions.apiVersion.get()
val language = compilerOptions.languageVersion.get()
if (api != usedKotlinVersion || language != usedKotlinVersion) {
TODO(
"There's mismatch between configured and actual versions:\n" +
"apiVersion=${api}, languageVersion=${language}, configured=${usedKotlinVersion}."
)
}
}
}
}

tasks {
withType<KotlinCompilationTask<*>>().configureEach {
compilerOptions {
// Suppress "Language version 1.3 is deprecated and its support will be removed in a future version of Kotlin".
freeCompilerArgs.add("-Xsuppress-version-warnings")

// Supporting Gradle 6.2+ needs to use Kotlin 1.3.
// See https://docs.gradle.org/current/userguide/compatibility.html
// For future maintainer: Kotlin 1.9.0 dropped support for Kotlin 1.3, it'll only support 1.4+.
// This means Gradle 7.0 will be the lowest supportable version for plugins.
val usedKotlinVersion = @Suppress("DEPRECATION") KotlinVersion.KOTLIN_1_3

apiVersion = usedKotlinVersion
// Theoretically we could use newer language version here,
// but sadly the @kotlin.Metadata created on the classes would be incompatible with older consumers.
Expand Down

0 comments on commit f569894

Please sign in to comment.