Use GradleLocalProperties for reading warningsAsErrors from local.properties

pull/236/head
Jolanda Verhoef 2 years ago
parent 2cf02177a1
commit 31b093e6de

@ -17,6 +17,7 @@
package com.google.samples.apps.nowinandroid
import com.android.build.api.dsl.CommonExtension
import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties
import org.gradle.api.JavaVersion
import org.gradle.api.Project
import org.gradle.api.artifacts.VersionCatalogsExtension
@ -46,7 +47,7 @@ internal fun Project.configureKotlinAndroid(
kotlinOptions {
// Treat all Kotlin warnings as errors (disabled by default)
allWarningsAsErrors = properties["warningsAsErrors"] as? Boolean ?: false
allWarningsAsErrors = gradleLocalProperties(rootDir).getProperty("warningsAsErrors").toBoolean()
freeCompilerArgs = freeCompilerArgs + listOf(
"-opt-in=kotlin.RequiresOptIn",

Loading…
Cancel
Save