OSDN Git Service
Clean up layout and menu file scanning code
This changeset fixes some issues around the new lazy scanning of
layout and menu files.
First, it partly fixes "19657: AAPT errors aren't shown when adding an
error to a valid XML file". With the new optimization of not running
aapt on layout files where no ids have changed, we would no longer
pick up changes where an invalid or nonexistent resource is added. We
now perform some basic validation of resources as well as XML parsing
errors.
Second, it fixes a bug in the id before and after comparison used to
determine if aapt needs to run: The code would call map.keySet()
before and after the ids were added, but this resolved to the same
keyset so the equals comparison was always true regardless of the
content.
Third, it fixes an infinite loop issue with library projects, and
avoids doing unnecessary classpath modifications when there are no
changed projects.
Finally, it changes the "needsId" flag. The state of whether aapt
needs to be run was stored per repository, and there is a bug where it
does not get cleared properly which can yield a compilation loop. This
changeset introduces a new "ScanningContext" object which is passed
down to the various resource file updater methods. This context object
now holds the needsId state object (which is renamed to
"needsFullAapt"), and it is also the object where errors can be
registered.
Change-Id: I5632612c2d93e2f10f0803e9223921adb67602be
19 files changed: