0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-20 03:52:15 +02:00
Anki-Android/lint.gradle
Mike Hardy cb7737770f Vary lint config debug vs release, CI allows debug lint
We want to expose when the lint results change vs current baseline, but
we can't hard fail on them because they are subject to false-positive just because
line numbers changed

For the smaller set of things that we classify as release blockers we do want
CI to check and hard fail for

Also updated the current debug baseline
2020-05-16 16:38:34 -05:00

23 lines
994 B
Groovy

tasks.whenTaskAdded { task ->
if (task.name.startsWith("lint")) {
if (task.name.toLowerCase().endsWith("release")) {
task.doFirst {
android.lintOptions.abortOnError = true
android.lintOptions.warningsAsErrors true
android.lintOptions.check 'NewApi', 'InlinedApi'
}
} else {
task.doFirst {
// move the baseline by deleting api/baseline.xml and AnkiDroid/baseline.xml then ./gradlew lintDebug
android.lintOptions.baseline file('./lint-baseline.xml')
android.lintOptions.abortOnError true
android.lintOptions.checkAllWarnings true
android.lintOptions.warningsAsErrors true
android.lintOptions.showAll true
android.lintOptions.textReport true
android.lintOptions.textOutput 'stdout'
android.lintOptions.htmlReport true
}
}
}
}