diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2023-03-01 17:16:02 +0530 |
---|---|---|
committer | Harsh Shandilya <me@msfjarvis.dev> | 2023-03-01 17:16:02 +0530 |
commit | bdf81cba521803bbf33ece7f3bdfe8b4220e5937 (patch) | |
tree | 392adb55b350de602d2110c2c2db639d87750404 /build-logic | |
parent | b707eed4d33768f804961c5ca124517ca0c3fc2e (diff) |
feat(build): configure Lint baselines for all compatible projects
Diffstat (limited to 'build-logic')
-rw-r--r-- | build-logic/src/main/kotlin/app/passwordstore/gradle/AndroidCommon.kt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/build-logic/src/main/kotlin/app/passwordstore/gradle/AndroidCommon.kt b/build-logic/src/main/kotlin/app/passwordstore/gradle/AndroidCommon.kt index 5e38b6eb..0d6b5cf7 100644 --- a/build-logic/src/main/kotlin/app/passwordstore/gradle/AndroidCommon.kt +++ b/build-logic/src/main/kotlin/app/passwordstore/gradle/AndroidCommon.kt @@ -1,11 +1,15 @@ package app.passwordstore.gradle import app.passwordstore.gradle.flavors.configureSlimTests +import com.android.build.api.dsl.ApplicationExtension +import com.android.build.api.dsl.LibraryExtension +import com.android.build.api.dsl.Lint import com.android.build.gradle.TestedExtension import org.gradle.api.JavaVersion import org.gradle.api.Project import org.gradle.api.tasks.testing.Test import org.gradle.kotlin.dsl.configure +import org.gradle.kotlin.dsl.findByType import org.gradle.kotlin.dsl.withType @Suppress("UnstableApiUsage") @@ -51,5 +55,14 @@ object AndroidCommon { project.configureSlimTests() } + project.extensions.findByType<ApplicationExtension>()?.run { lint.configureLint(project) } + project.extensions.findByType<LibraryExtension>()?.run { lint.configureLint(project) } } } + +private fun Lint.configureLint(project: Project) { + abortOnError = false + checkReleaseBuilds = false + warningsAsErrors = false + baseline = project.file("lint-baseline.xml") +} |