diff options
author | Adam Lesinski <adamlesinski@google.com> | 2015-05-12 20:40:48 -0700 |
---|---|---|
committer | Adam Lesinski <adamlesinski@google.com> | 2015-05-12 20:45:20 -0700 |
commit | d13fb249865703901b77f48c5fed1864f06e1c63 (patch) | |
tree | 55c4b18e7c0e068a82c5c726cda0326348c5ca1f /tools/aapt2/Main.cpp | |
parent | bdaa092a193d8ddccbd9ad8434be97878e6ded59 (diff) |
AAPT2: Debug: Dump only targetted style
Change-Id: Id7c5a4b5d0880520e1fea05e5a31d398946c5f05
Diffstat (limited to 'tools/aapt2/Main.cpp')
-rw-r--r-- | tools/aapt2/Main.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tools/aapt2/Main.cpp b/tools/aapt2/Main.cpp index e0977b8bb88a..025ede559acd 100644 --- a/tools/aapt2/Main.cpp +++ b/tools/aapt2/Main.cpp @@ -293,6 +293,10 @@ struct AaptOptions { // referencing attributes defined in a newer SDK // level than the style or layout is defined for. bool versionStylesAndLayouts = true; + + // The target style that will have it's style hierarchy dumped + // when the phase is DumpStyleGraph. + ResourceName dumpStyleTarget; }; bool compileXml(const AaptOptions& options, const std::shared_ptr<ResourceTable>& table, @@ -1001,6 +1005,17 @@ static AaptOptions prepareArgs(int argc, char** argv) { flag::requiredFlag("-o", "Output path", [&options](const StringPiece& arg) { options.output = Source{ arg.toString() }; }); + } else if (options.phase == AaptOptions::Phase::DumpStyleGraph) { + flag::requiredFlag("--style", "Name of the style to dump", + [&options](const StringPiece& arg, std::string* outError) -> bool { + Reference styleReference; + if (!ResourceParser::parseStyleParentReference(util::utf8ToUtf16(arg), + &styleReference, outError)) { + return false; + } + options.dumpStyleTarget = styleReference.name; + return true; + }); } bool help = false; @@ -1062,7 +1077,7 @@ static bool doDump(const AaptOptions& options) { if (options.phase == AaptOptions::Phase::Dump) { Debug::printTable(table); } else if (options.phase == AaptOptions::Phase::DumpStyleGraph) { - Debug::printStyleGraph(table); + Debug::printStyleGraph(table, options.dumpStyleTarget); } } return true; |