From 64587af8179affd38ee26543b748f2d63b7f67bb Mon Sep 17 00:00:00 2001 From: Adam Lesinski Date: Thu, 18 Feb 2016 18:33:06 -0800 Subject: 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 --- tools/aapt2/java/JavaClassGenerator.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tools/aapt2/java/JavaClassGenerator.cpp') diff --git a/tools/aapt2/java/JavaClassGenerator.cpp b/tools/aapt2/java/JavaClassGenerator.cpp index 6e340a2a2742..9e94d4276f5e 100644 --- a/tools/aapt2/java/JavaClassGenerator.cpp +++ b/tools/aapt2/java/JavaClassGenerator.cpp @@ -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; -- cgit v1.2.3