diff options
author | Adam Lesinski <adamlesinski@google.com> | 2015-05-04 17:40:56 -0700 |
---|---|---|
committer | Adam Lesinski <adamlesinski@google.com> | 2015-05-12 20:41:31 -0700 |
commit | 330edcdf1316ed599fe0eb16a64330821fd92f18 (patch) | |
tree | 8a9bddd59f53efc836b787565ba206a1d78383e3 /tools/aapt2/ResourceTable.h | |
parent | a4492b418d23e3bcdb077aab5d48eb24e932fc13 (diff) |
AAPT2: Support static lib referencing static lib
When a static library A references static library B,
and app C references both A and B, we get the following symbol merging,
symbols from library B get imported twice.
We must only check that symbol references to library B are valid
when building library A. We should only merge all the symbols
when building final app C.
Change-Id: I23cba33b0901dcbb5328d9c9dfaa6a979c073c36
Diffstat (limited to 'tools/aapt2/ResourceTable.h')
-rw-r--r-- | tools/aapt2/ResourceTable.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/aapt2/ResourceTable.h b/tools/aapt2/ResourceTable.h index 94bacd80bbb2..706f56a2776f 100644 --- a/tools/aapt2/ResourceTable.h +++ b/tools/aapt2/ResourceTable.h @@ -143,11 +143,21 @@ public: bool addResource(const ResourceNameRef& name, const ConfigDescription& config, const SourceLine& source, std::unique_ptr<Value> value); + /** + * Same as addResource, but doesn't verify the validity of the name. This is used + * when loading resources from an existing binary resource table that may have mangled + * names. + */ + bool addResourceAllowMangled(const ResourceNameRef& name, const ConfigDescription& config, + const SourceLine& source, std::unique_ptr<Value> value); + bool addResource(const ResourceNameRef& name, const ResourceId resId, const ConfigDescription& config, const SourceLine& source, std::unique_ptr<Value> value); bool markPublic(const ResourceNameRef& name, const ResourceId resId, const SourceLine& source); + bool markPublicAllowMangled(const ResourceNameRef& name, const ResourceId resId, + const SourceLine& source); /* * Merges the resources from `other` into this table, mangling the names of the resources @@ -176,6 +186,12 @@ private: std::unique_ptr<ResourceEntry>& findOrCreateEntry(std::unique_ptr<ResourceTableType>& type, const StringPiece16& name); + bool addResourceImpl(const ResourceNameRef& name, const ResourceId resId, + const ConfigDescription& config, const SourceLine& source, + std::unique_ptr<Value> value, const char16_t* validChars); + bool markPublicImpl(const ResourceNameRef& name, const ResourceId resId, + const SourceLine& source, const char16_t* validChars); + std::u16string mPackage; size_t mPackageId; |