diff options
author | 2016-01-06 15:45:28 -0800 | |
---|---|---|
committer | 2016-01-06 16:18:40 -0800 | |
commit | 7751afc796842bbb24bfbb19bd0fee4a7b7c8a4e (patch) | |
tree | fad12506e9f244038a186dd8dbe31e87f6bafafe /tools/aapt2/ResourceParser.h | |
parent | 198ce1a5e6fbe2cb84263e427032e9715e27379f (diff) |
AAPT2: Fix product support
Previously the default product wasn't tried if 'default' wasn't specified on the command line.
Also adds support for multiple products.
Change-Id: I1e4872b34bb8d609b6444841a4e7e4dbb3bbb76b
Diffstat (limited to 'tools/aapt2/ResourceParser.h')
-rw-r--r-- | tools/aapt2/ResourceParser.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/aapt2/ResourceParser.h b/tools/aapt2/ResourceParser.h index 29b1bc188b56..9ad749e27dbc 100644 --- a/tools/aapt2/ResourceParser.h +++ b/tools/aapt2/ResourceParser.h @@ -34,11 +34,11 @@ struct ParsedResource; struct ResourceParserOptions { /** - * Optional product name by which to filter resources. + * Optional product names by which to filter resources. * This is like a preprocessor definition in that we strip out resources * that don't match before we compile them. */ - Maybe<std::u16string> product; + std::vector<std::u16string> products; /** * Whether the default setting for this parser is to allow translation. @@ -101,6 +101,9 @@ private: bool parseArrayImpl(xml::XmlPullParser* parser, ParsedResource* outResource, uint32_t typeMask); bool parsePlural(xml::XmlPullParser* parser, ParsedResource* outResource); + bool shouldStripResource(const ResourceNameRef& name, + const Maybe<std::u16string>& product) const; + IDiagnostics* mDiag; ResourceTable* mTable; Source mSource; |