From 258fc5c0a4707d85d808a752442aeddc739545e2 Mon Sep 17 00:00:00 2001 From: Matthew Haughton <3flex@users.noreply.github.com> Date: Sat, 20 Jan 2024 14:10:09 +1100 Subject: [PATCH] Remove API/language version override checks 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. --- build.gradle.kts | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index f3e7def5..6adba23d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -170,34 +170,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>().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.