summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/JavaClassGenerator.cpp
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2016-02-18 18:33:06 -0800
committerAdam Lesinski <adamlesinski@google.com>2016-03-04 14:39:01 -0800
commit64587af8179affd38ee26543b748f2d63b7f67bb (patch)
treebf4eb34ea2bc5ce357e23dc6ac0572d9366f7d8e /tools/aapt2/java/JavaClassGenerator.cpp
parentbd4b217a289edca382b63f2bf5d1dd2017e9cf2e (diff)
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
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator.cpp')
-rw-r--r--tools/aapt2/java/JavaClassGenerator.cpp6
1 files changed, 4 insertions, 2 deletions
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;