build: Use `updateLintBaseline` task (#209)

There's a well-hidden `updateLintBaseline` task that does what the
custom `newLintBaseline` task does. Prefer the `update...` task to
reduce the amount of custom machinery in this build.
This commit is contained in:
Nik Clayton 2023-10-30 19:03:45 +01:00 committed by GitHub
parent 9dad367f6f
commit e5a54061aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 18 deletions

View File

@ -65,7 +65,7 @@ android {
lint { lint {
lintConfig file("lint.xml") lintConfig file("lint.xml")
// Regenerate by running `./gradlew app:newLintBaseline` // Regenerate by running `./gradlew updateLintBaselineOrangeDebug`
baseline = file("lint-baseline.xml") baseline = file("lint-baseline.xml")
} }
@ -217,18 +217,3 @@ dependencies {
androidTestImplementation libs.hilt.android.testing androidTestImplementation libs.hilt.android.testing
androidTestImplementation libs.androidx.test.core.ktx androidTestImplementation libs.androidx.test.core.ktx
} }
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")
}

View File

@ -302,10 +302,10 @@ A number of pre-existing lint errors and warnings have been grandfathered in to
These are being removed over time, please do not add to them. These are being removed over time, please do not add to them.
If your PR fixes some of the existing lint issues, or moves code so that the baseline file is no longer valid you can you regenerate it with the `newLintBaseline` task. If your PR fixes some of the existing lint issues, or moves code so that the baseline file is no longer valid you can you regenerate it with the `updateLintBaselineOrangeDebug` task.
```shell ```shell
./gradlew newLintBaseline ./gradlew updateLintBaselineOrangeDebug
``` ```
#### Screenshots #### Screenshots