I want to use different lint.xml files for release and debug build types in Android Studio. So, how can this be achieved?
When
With kotlin build scripts (build.gradle.kts
):
tasks.withType().configureEach {
// doFirst is required else we get a Null Pointer Exception on lintOption
doFirst {
// This will override the lintOptions from the android extension
lintOptions.run {
if (name.toLowerCase().contains("debug")) {
// Do your configuration here
// isAbortOnError = true
// baselineFile = file("baseline.xml")
// isWarningsAsErrors = true
// isCheckDependencies = true
// ignore("MissingTranslation")
// setLintConfig(file("lint.xml"))
}
}
}
}