diff options
| author | 2015-05-13 21:41:38 +0000 | |
|---|---|---|
| committer | 2015-05-13 21:41:47 +0000 | |
| commit | 45fefaef008c16af42256fb2d8eab183245d030d (patch) | |
| tree | 090879c6100951f81cd7c9345ac73a0347694e6e /tools/aapt2/Main.cpp | |
| parent | 68727a0b2074d6a9c03cff967c28da069deedae3 (diff) | |
| parent | d13fb249865703901b77f48c5fed1864f06e1c63 (diff) | |
Merge "AAPT2: Debug: Dump only targetted style" into mnc-dev
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; |