Skip to content

Commit

Permalink
[feature/droidknights#306] Fix build error
Browse files Browse the repository at this point in the history
  • Loading branch information
l2hyunwoo committed May 30, 2024
1 parent fa5fbd4 commit c13a8c4
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -52,7 +54,7 @@ internal fun Project.configureKotlinAndroid() {
}

internal fun Project.configureKotlin() {
extensions.getByType<KotlinAndroidProjectExtension>().apply {
tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
// Treat all Kotlin warnings as errors (disabled by default)
Expand All @@ -65,6 +67,8 @@ internal fun Project.configureKotlin() {
)
)
}
}
extensions.getByType<KotlinProjectExtension>().apply {
sourceSets.all {
languageSettings.enableLanguageFeature("ExplicitBackingFields")
}
Expand Down

0 comments on commit c13a8c4

Please sign in to comment.