Description[GN] Lint Android resources
Lint is still run only within android_library/android_apk targets but resources
folders and generated resources ZIPs from direct dependencies are added to this
run. ZIPs are extracted to temporary folders during linting.
This approach requires a big rewrite of existing dependencies. Before the patch
every library that needs to reference something from R.java of the other library
has to directly depend on the resource target that generates this R.java, for
example chrome_java depended on ui_java_resources while also dependening on
ui_java. This is the only way to get R.java from ui_java_resources in
chrome_java. This causes Lint to lint ui_java_resources twice (within
chrome_java and ui_java) and may produce false positives. This patch changes
these R.java dependencies to transitives, so chrome_java only depends on ui_java
and still gets all R.java from its resources.
Only resources that are the part of the library/APK should be direct
dependencies of this library otherwise Lint will not work properly.
Resource folders/ZIPs are propagated to dependent libraries via build_config
files. Each android_resources target publishes its resource folders in its
build_config; it also writes list of resources_zips of direct dependencies which
have no own package names - these are generated resources, conceptually part of
the same target. Library/APK targets expose list of folders and ZIPs from
dependencies via their own build_config which is read by Lint.
BUG=595810
Committed: https://crrev.com/18749bd362a7a8b7f4c1185c838d724dea5fad85
Cr-Commit-Position: refs/heads/master@{#400727}
Patch Set 1 #
Total comments: 1
Dependent Patchsets: Messages
Total messages: 23 (10 generated)
|