From 50c00e53bcb2e1e119c11534c67be45e94b31c69 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Tue, 25 Apr 2023 00:07:31 +0530 Subject: fix(build): simplify Kotlin JVM target handling --- .../src/main/kotlin/app/passwordstore/gradle/AndroidCommon.kt | 1 - .../src/main/kotlin/app/passwordstore/gradle/KotlinCommonPlugin.kt | 6 ++---- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'build-logic') 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 { 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 { targetCompatibility = JavaVersion.VERSION_11.toString() } withType().configureEach { - kotlinOptions { jvmTarget = JavaVersion.VERSION_11.toString() } - } - withType>().configureEach { compilerOptions { + jvmTarget.set(JvmTarget.JVM_11) allWarningsAsErrors.set(true) languageVersion.set(KotlinVersion.KOTLIN_1_5) freeCompilerArgs.addAll(ADDITIONAL_COMPILER_ARGS) -- cgit v1.2.3