Only use gradle.properties to read warningsAsErrors

pull/236/head
Jolanda Verhoef 2 years ago
parent ce5875cef8
commit ac1471476a

@ -23,6 +23,6 @@ kotlin.compiler.execution.strategy=in-process
# Controls KotlinOptions.allWarningsAsErrors.
# This value used in CI and is currently set to false.
# If you want to treat warnings as errors locally, set this property
# in local.properties.
warningsAsErrors="false"
# If you want to treat warnings as errors locally, set this property to true
# in your ~/.gradle/gradle.properties file.
warningsAsErrors=false

@ -49,13 +49,9 @@ internal fun Project.configureKotlinAndroid(
kotlinOptions {
// Treat all Kotlin warnings as errors (disabled by default)
// Override locally using local.properties
val localOverrideWarningsAsErrors = gradleLocalProperties(rootDir)
.getProperty("warningsAsErrors")?.toBoolean()
// Set on CI through gradle.properties
// Override by setting warningsAsErrors=true in your ~/.gradle/gradle.properties
val warningsAsErrors: String? by project
// Prefer local.properties, gradle.properties, or default to false when both are null
allWarningsAsErrors = localOverrideWarningsAsErrors ?: warningsAsErrors.toBoolean()
allWarningsAsErrors = warningsAsErrors.toBoolean()
freeCompilerArgs = freeCompilerArgs + listOf(
"-opt-in=kotlin.RequiresOptIn",

Loading…
Cancel
Save