Use GradleLocalProperties for reading warningsAsErrors from local.properties

pull/246/head
Jolanda Verhoef 2 years ago committed by Robert
parent 619e99b77e
commit bd0d1d25fb

@ -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