AAPT2: Add diff command

Adds the diff command and various small fixes to issues
discovered when diffing old AAPT built APKs with new AAPT2
built APKS.

Bug:22775504
Change-Id: I682a7fe1cf4b3efa7cbd5d18b333cf2d1046fe1b
This commit is contained in:
Adam Lesinski
2016-04-25 14:20:21 -07:00
parent 832449800e
commit 458b877488
12 changed files with 649 additions and 61 deletions

View File

@@ -189,6 +189,17 @@ std::vector<ResourceConfigValue*> ResourceEntry::findAllValues(const ConfigDescr
return results;
}
std::vector<ResourceConfigValue*> ResourceEntry::findValuesIf(
const std::function<bool(ResourceConfigValue*)>& f) {
std::vector<ResourceConfigValue*> results;
for (auto& configValue : values) {
if (f(configValue.get())) {
results.push_back(configValue.get());
}
}
return results;
}
/**
* The default handler for collisions. A return value of -1 means keep the
* existing value, 0 means fail, and +1 means take the incoming value.