diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2023-04-25 00:07:31 +0530 |
---|---|---|
committer | Harsh Shandilya <me@msfjarvis.dev> | 2023-04-25 00:07:31 +0530 |
commit | 50c00e53bcb2e1e119c11534c67be45e94b31c69 (patch) | |
tree | fd3ea950ff6c21c9da36f650dd7e142c22186e4e | |
parent | 27d53714721796ce3f3c8e3bcf969c00721d8f16 (diff) |
fix(build): simplify Kotlin JVM target handling
-rw-r--r-- | build-logic/src/main/kotlin/app/passwordstore/gradle/AndroidCommon.kt | 1 | ||||
-rw-r--r-- | build-logic/src/main/kotlin/app/passwordstore/gradle/KotlinCommonPlugin.kt | 6 |
2 files changed, 2 insertions, 5 deletions
diff --git a/build-logic/src/main/kotlin/app/passwordstore/gradle/AndroidCommon.kt b/build-logic/src/main/kotlin/app/passwordstore/gradle/AndroidCommon.kt index 0d6b5cf7..ca324ccf 100644 --- a/build-logic/src/main/kotlin/app/passwordstore/gradle/AndroidCommon.kt +++ b/build-logic/src/main/kotlin/app/passwordstore/gradle/AndroidCommon.kt @@ -12,7 +12,6 @@ import org.gradle.kotlin.dsl.configure import org.gradle.kotlin.dsl.findByType import org.gradle.kotlin.dsl.withType -@Suppress("UnstableApiUsage") object AndroidCommon { fun configure(project: Project) { project.extensions.configure<TestedExtension> { diff --git a/build-logic/src/main/kotlin/app/passwordstore/gradle/KotlinCommonPlugin.kt b/build-logic/src/main/kotlin/app/passwordstore/gradle/KotlinCommonPlugin.kt index e7ca2219..067cadfc 100644 --- a/build-logic/src/main/kotlin/app/passwordstore/gradle/KotlinCommonPlugin.kt +++ b/build-logic/src/main/kotlin/app/passwordstore/gradle/KotlinCommonPlugin.kt @@ -16,8 +16,8 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent import org.gradle.kotlin.dsl.configure import org.gradle.kotlin.dsl.withType import org.gradle.language.base.plugins.LifecycleBasePlugin +import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.dsl.KotlinVersion -import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask import org.jetbrains.kotlin.gradle.tasks.KotlinCompile @Suppress("Unused") @@ -45,10 +45,8 @@ class KotlinCommonPlugin : Plugin<Project> { targetCompatibility = JavaVersion.VERSION_11.toString() } withType<KotlinCompile>().configureEach { - kotlinOptions { jvmTarget = JavaVersion.VERSION_11.toString() } - } - withType<KotlinCompilationTask<*>>().configureEach { compilerOptions { + jvmTarget.set(JvmTarget.JVM_11) allWarningsAsErrors.set(true) languageVersion.set(KotlinVersion.KOTLIN_1_5) freeCompilerArgs.addAll(ADDITIONAL_COMPILER_ARGS) |