Status Update
Comments
uc...@google.com <uc...@google.com>
ga...@google.com <ga...@google.com>
sp...@google.com <sp...@google.com> #2
OP, do you know if this is still an issue in more recent versions of AGP (e.g., the latest stable version 7.2.2)?
I'll investigate, but I wanted to check first in case you know whether it's already been resolved.
pa...@gmail.com <pa...@gmail.com> #3
It should be trivial to upgrade the repro project and see, let me know if not.
da...@gmail.com <da...@gmail.com> #4
I can confirm that this is an issue using AGP 7.1.3 - used build comparisons in Gradle Enterprise to see that changes in the {module}/lint.xml did not show as changes between build 1 and build 2, but would show changes by using the above to supply the lint.xml path as an input to the task.
Will try it out on AGP 7.2.2 to see if this behavior changes and post back.
Edit, ran a test using AGP 7.2.2 and did the following:
- Ran lint as it is
- Edited a ${module}/lint.xml
- Build comparison in Gradle Enterprise used.
Result: ${module}/lint.xml changes not picked up as differences.
Project set up:
root
|--> customLint
|--> module
|--> app (depends on module)
In module
, lintPublish project(':customLint')
and lintChecks project(':customLint')
are in module's dependencies {}
block in module/build.gradle
Just adding the set up as insight into what our structure looks like.
ts...@vewd.com <ts...@vewd.com> #5
As a workaround, I have added
lintConfig file("lint.xml")
in lintOptions and this seems to have made things better. Still seems like a bug, if the file is used by default it should be considered an input by the build.
pa...@gmail.com <pa...@gmail.com> #6
It's possible that even with setting a globally unique config (rootProject.file(lint.xml)), it would still pick up individual lint.xml in modules as override. I observed this years ago, not sure if it's still the case.
sp...@google.com <sp...@google.com> #7
This has been fixed with Change-Id: I9bcab62058870fec88023f888b0889c3d42262f8.
The fix will be in AGP 8.0.0-alpha09.
Description
DESCRIBE THE ISSUE IN DETAIL:
It is possible to put
lint.xml
s in therootProject
and in every module individually. These will be considered together to set up configuration for each module. In the attach project the structure is:app
lint.xml
missing, will use../lint.xml
lib
lint.xml
exists, but empty (will be modified by step 6)lint.xml
exists, and suppresses the clear unused resources by pattern.STEPS TO REPRODUCE:
gradlew lint
:lib:lintDebug
telling us there's an unused resource called "unused" inlib/build/reports/lint-results-debug.html
gradlew lint
lib/lint.xml
and uncomment<ignore>
gradlew lint
Actual: Observe nothing was executed, everything up-to-date.
Expected: lint analysis re-executes and updates the HTML report with the findings based on the newly changed config file.
Bonus steps to prove that the uncommenting should have an effect:
gradlew clean lint --no-build-cache
Workaround
polyfill missing setup