Add `newLintBaseline` task (#3925)
Add a task to regenerate the lint baseline.
This commit is contained in:
parent
5d4c14aed9
commit
498c7646b0
|
@ -60,8 +60,7 @@ android {
|
||||||
|
|
||||||
lint {
|
lint {
|
||||||
lintConfig file("lint.xml")
|
lintConfig file("lint.xml")
|
||||||
// Regenerate by deleting app/lint-baseline.xml, then run:
|
// Regenerate by running `./gradlew app:newLintBaseline`
|
||||||
// ./gradlew lintBlueDebug
|
|
||||||
baseline = file("lint-baseline.xml")
|
baseline = file("lint-baseline.xml")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,3 +202,18 @@ tasks.withType(org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask) {
|
||||||
"--add-opens", "jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED",
|
"--add-opens", "jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED",
|
||||||
"--add-opens", "jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED"])
|
"--add-opens", "jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED"])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.register("newLintBaseline") {
|
||||||
|
description 'Deletes and then recreates the lint baseline'
|
||||||
|
|
||||||
|
// This task should always run, irrespective of caching
|
||||||
|
notCompatibleWithConfigurationCache("Is always out of date")
|
||||||
|
outputs.upToDateWhen { false }
|
||||||
|
|
||||||
|
doLast {
|
||||||
|
delete android.lint.baseline.path
|
||||||
|
}
|
||||||
|
|
||||||
|
// Regenerate the lint baseline
|
||||||
|
it.finalizedBy tasks.named("lintBlueDebug")
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue