Loading tools/aapt2/Flags.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -69,6 +69,17 @@ Flags& Flags::optionalFlagList(const StringPiece& name, const StringPiece& descr return *this; } Flags& Flags::optionalFlagList(const StringPiece& name, const StringPiece& description, std::unordered_set<std::string>* value) { auto func = [value](const StringPiece& arg) -> bool { value->insert(arg.toString()); return true; }; mFlags.push_back(Flag{ name.toString(), description.toString(), func, false, 1, false }); return *this; } Flags& Flags::optionalSwitch(const StringPiece& name, const StringPiece& description, bool* value) { auto func = [value](const StringPiece& arg) -> bool { Loading tools/aapt2/Flags.h +3 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include <functional> #include <ostream> #include <string> #include <unordered_set> #include <vector> namespace aapt { Loading @@ -37,6 +38,8 @@ public: Maybe<std::string>* value); Flags& optionalFlagList(const StringPiece& name, const StringPiece& description, std::vector<std::string>* value); Flags& optionalFlagList(const StringPiece& name, const StringPiece& description, std::unordered_set<std::string>* value); Flags& optionalSwitch(const StringPiece& name, const StringPiece& description, bool* value); Loading tools/aapt2/link/Link.cpp +11 −2 Original line number Diff line number Diff line Loading @@ -73,7 +73,7 @@ struct LinkOptions { bool outputToDirectory = false; bool autoAddOverlay = false; bool doNotCompressAnything = false; std::vector<std::string> extensionsToNotCompress; std::unordered_set<std::string> extensionsToNotCompress; Maybe<std::string> privateSymbols; ManifestFixerOptions manifestFixerOptions; std::unordered_set<std::string> products; Loading Loading @@ -287,7 +287,7 @@ struct ResourceFileFlattenerOptions { bool keepRawValues = false; bool doNotCompressAnything = false; bool updateProguardSpec = false; std::vector<std::string> extensionsToNotCompress; std::unordered_set<std::string> extensionsToNotCompress; }; class ResourceFileFlattener { Loading Loading @@ -1728,6 +1728,15 @@ int link(const std::vector<StringPiece>& args) { } } // Populate some default no-compress extensions that are already compressed. options.extensionsToNotCompress.insert({ ".jpg", ".jpeg", ".png", ".gif", ".wav", ".mp2", ".mp3", ".ogg", ".aac", ".mpg", ".mpeg", ".mid", ".midi", ".smf", ".jet", ".rtttl", ".imy", ".xmf", ".mp4", ".m4a", ".m4v", ".3gp", ".3gpp", ".3g2", ".3gpp2", ".amr", ".awb", ".wma", ".wmv", ".webm", ".mkv"}); // Turn off auto versioning for static-libs. if (options.staticLib) { options.noAutoVersion = true; Loading Loading
tools/aapt2/Flags.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -69,6 +69,17 @@ Flags& Flags::optionalFlagList(const StringPiece& name, const StringPiece& descr return *this; } Flags& Flags::optionalFlagList(const StringPiece& name, const StringPiece& description, std::unordered_set<std::string>* value) { auto func = [value](const StringPiece& arg) -> bool { value->insert(arg.toString()); return true; }; mFlags.push_back(Flag{ name.toString(), description.toString(), func, false, 1, false }); return *this; } Flags& Flags::optionalSwitch(const StringPiece& name, const StringPiece& description, bool* value) { auto func = [value](const StringPiece& arg) -> bool { Loading
tools/aapt2/Flags.h +3 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include <functional> #include <ostream> #include <string> #include <unordered_set> #include <vector> namespace aapt { Loading @@ -37,6 +38,8 @@ public: Maybe<std::string>* value); Flags& optionalFlagList(const StringPiece& name, const StringPiece& description, std::vector<std::string>* value); Flags& optionalFlagList(const StringPiece& name, const StringPiece& description, std::unordered_set<std::string>* value); Flags& optionalSwitch(const StringPiece& name, const StringPiece& description, bool* value); Loading
tools/aapt2/link/Link.cpp +11 −2 Original line number Diff line number Diff line Loading @@ -73,7 +73,7 @@ struct LinkOptions { bool outputToDirectory = false; bool autoAddOverlay = false; bool doNotCompressAnything = false; std::vector<std::string> extensionsToNotCompress; std::unordered_set<std::string> extensionsToNotCompress; Maybe<std::string> privateSymbols; ManifestFixerOptions manifestFixerOptions; std::unordered_set<std::string> products; Loading Loading @@ -287,7 +287,7 @@ struct ResourceFileFlattenerOptions { bool keepRawValues = false; bool doNotCompressAnything = false; bool updateProguardSpec = false; std::vector<std::string> extensionsToNotCompress; std::unordered_set<std::string> extensionsToNotCompress; }; class ResourceFileFlattener { Loading Loading @@ -1728,6 +1728,15 @@ int link(const std::vector<StringPiece>& args) { } } // Populate some default no-compress extensions that are already compressed. options.extensionsToNotCompress.insert({ ".jpg", ".jpeg", ".png", ".gif", ".wav", ".mp2", ".mp3", ".ogg", ".aac", ".mpg", ".mpeg", ".mid", ".midi", ".smf", ".jet", ".rtttl", ".imy", ".xmf", ".mp4", ".m4a", ".m4v", ".3gp", ".3gpp", ".3g2", ".3gpp2", ".amr", ".awb", ".wma", ".wmv", ".webm", ".mkv"}); // Turn off auto versioning for static-libs. if (options.staticLib) { options.noAutoVersion = true; Loading