diff --git a/build-logic/src/main/kotlin/com/droidknights/app/KotlinAndroid.kt b/build-logic/src/main/kotlin/com/droidknights/app/KotlinAndroid.kt index c2048504..aa52b9f9 100644 --- a/build-logic/src/main/kotlin/com/droidknights/app/KotlinAndroid.kt +++ b/build-logic/src/main/kotlin/com/droidknights/app/KotlinAndroid.kt @@ -7,8 +7,10 @@ import org.gradle.api.Project import org.gradle.kotlin.dsl.dependencies import org.gradle.kotlin.dsl.getByType import org.gradle.kotlin.dsl.provideDelegate +import org.gradle.kotlin.dsl.withType import org.jetbrains.kotlin.gradle.dsl.JvmTarget -import org.jetbrains.kotlin.gradle.dsl.KotlinAndroidProjectExtension +import org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile /** * https://github.com/android/nowinandroid/blob/main/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/KotlinAndroid.kt @@ -52,7 +54,7 @@ internal fun Project.configureKotlinAndroid() { } internal fun Project.configureKotlin() { - extensions.getByType().apply { + tasks.withType().configureEach { compilerOptions { jvmTarget.set(JvmTarget.JVM_17) // Treat all Kotlin warnings as errors (disabled by default) @@ -65,6 +67,8 @@ internal fun Project.configureKotlin() { ) ) } + } + extensions.getByType().apply { sourceSets.all { languageSettings.enableLanguageFeature("ExplicitBackingFields") }