Fixed
Status Update
Comments
rm...@google.com <rm...@google.com> #2
Thank you for your feedback. Team may reach out for more feedback in reproducing or triaging this issue.
mc...@ebay.com <mc...@ebay.com> #3
This issue still manifests on AS 3.6.0-rc03 / Gradle 5.6.4.
tn...@google.com <tn...@google.com> #4
I've fixed this as part of the lint.xml overhaul in
mc...@ebay.com <mc...@ebay.com> #5
Excellent news! Thanks, Tor!
Description
When given a lintConfig, project lint.xml, and a severity override for a specific issue in the build.gradle file, other issue configurations in the project's lint.xml file are ignored. By way of example:
Given:
- An issue X that is fatal-by-default and present in the project (in the repro project, I used WrongThread)
- A lint options lintConfig that overrides this X fatal default, making it a warning
- A build.gradle which conditionally makes X fatal again by setting a severity override based on a project property presence
- Another issue Y that is present in the codebase (In the repro project I used UnusedResources)
- A lint.xml for the module that ignores the occurrence of issue Y
When the conditional property is not present, issue X is retained at the warning level, issue Y is ignored, and the build succeeds. This part is operating as expected.
When the conditional property is present, issue X is reported as a fatal issue (as expected) but issue Y is no longer ignored. This is unexpected, as issue Y configuration remains unchanged.
In our production code we use MissingTranslations as issue X, setting it to warning level during development but make it a fatal issue for release builds. Issue Y represents custom lint checks of which some files are ignored. By using the severity override in the build.gradle file, the build fails for these ignored lint checks.
To repro, I've attached a project which illustrates the issue. Unpack and then run `./gradlew :app:lintDebug`. This build will succeed. Then run `./gradlew -Prelease :app:lintDebug`. The build will fail for BOTH lint issues when it should only fail for WrongThread.