From e5a54061aa00c25986cbc954c890ff7e17387ee2 Mon Sep 17 00:00:00 2001 From: Nik Clayton Date: Mon, 30 Oct 2023 19:03:45 +0100 Subject: [PATCH] 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. --- app/build.gradle | 17 +---------------- docs/contributing/code.md | 4 ++-- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 6779413bf..4be312574 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -65,7 +65,7 @@ android { lint { lintConfig file("lint.xml") - // Regenerate by running `./gradlew app:newLintBaseline` + // Regenerate by running `./gradlew updateLintBaselineOrangeDebug` baseline = file("lint-baseline.xml") } @@ -217,18 +217,3 @@ dependencies { androidTestImplementation libs.hilt.android.testing 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") -} diff --git a/docs/contributing/code.md b/docs/contributing/code.md index ad93f41f8..983c3e09e 100644 --- a/docs/contributing/code.md +++ b/docs/contributing/code.md @@ -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. -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 -./gradlew newLintBaseline +./gradlew updateLintBaselineOrangeDebug ``` #### Screenshots