AAPT2: Support building, linking, and merging static libraries

Android static libraries are like APKs but they contain much more debugging
and source information. We need to treat them differently in 3 ways:

1) When building a static library, we skip things like ID assignment and
   product/config stripping. Source information is emitted as well.
2) When building a static library and linking against another
   static library, we don't want to merge, we want to simply reference.
3) When building an app that uses static libraries, we want to merge
   the static library under the same package with or without mangling.

Bug:25958912
Change-Id: I425e032857936a3e83173c1edc2a6cdc6020b842
This commit is contained in:
Adam Lesinski
2016-02-18 18:33:06 -08:00
parent bd4b217a28
commit 64587af817
67 changed files with 1396 additions and 786 deletions

View File

@@ -223,8 +223,10 @@ bool JavaClassGenerator::writeEntriesForClass(ClassDefinitionWriter* outClassDef
continue;
}
ResourceId id(package->id.value(), type->id.value(), entry->id.value());
assert(id.isValid());
ResourceId id;
if (package->id && type->id && entry->id) {
id = ResourceId(package->id.value(), type->id.value(), entry->id.value());
}
std::u16string unmangledPackage;
std::u16string unmangledName = entry->name;