Filter products during compile phase
Unfortunately there is no good way to deal with products in the link phase.
Products are like preprocessor defines in that they are processed early
and change the composition of the compiled unit.
Change-Id: I6d5e15ef60d29df8e83e059ba857c09333993779
diff --git a/tools/aapt2/ResourceTable.h b/tools/aapt2/ResourceTable.h
index a00c142..60fed2f 100644
--- a/tools/aapt2/ResourceTable.h
+++ b/tools/aapt2/ResourceTable.h
@@ -176,9 +176,9 @@
bool markPublicAllowMangled(const ResourceNameRef& name, const ResourceId resId,
const Source& source, IDiagnostics* diag);
struct SearchResult {
- ResourceTablePackage* package;
- ResourceTableType* type;
- ResourceEntry* entry;
+ ResourceTablePackage* package;
+ ResourceTableType* type;
+ ResourceEntry* entry;
};
Maybe<SearchResult> findResource(const ResourceNameRef& name);
@@ -208,7 +208,7 @@
ResourceTablePackage* findPackageById(uint8_t id);
- ResourceTablePackage* createPackage(const StringPiece16& name, uint8_t id);
+ ResourceTablePackage* createPackage(const StringPiece16& name, Maybe<uint8_t> id = {});
private:
ResourceTablePackage* findOrCreatePackage(const StringPiece16& name);