diff options
| author | 2019-03-07 16:40:03 +0000 | |
|---|---|---|
| committer | 2019-03-07 16:40:03 +0000 | |
| commit | b496d6150c8d2c5bea199dc35c4b21e3f699e6f2 (patch) | |
| tree | 5c39c8e05a12edb91b37139d9c8455cb199f5508 /tools/aapt2/Main.cpp | |
| parent | e2060f2cd3ebf70e57d41d87fac94583de2098c8 (diff) | |
| parent | 2d34e76daceaac41a8c578d7fa02aca864019dbb (diff) | |
Merge "Add --trace_folder to aapt2"
Diffstat (limited to 'tools/aapt2/Main.cpp')
| -rw-r--r-- | tools/aapt2/Main.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/aapt2/Main.cpp b/tools/aapt2/Main.cpp index adf85b0ea8e8..39eb9879f86d 100644 --- a/tools/aapt2/Main.cpp +++ b/tools/aapt2/Main.cpp @@ -37,6 +37,7 @@ #include "cmd/Link.h" #include "cmd/Optimize.h" #include "io/FileStream.h" +#include "trace/TraceBuffer.h" #include "util/Files.h" #include "util/Util.h" @@ -107,9 +108,12 @@ class DaemonCommand : public Command { : Command("daemon", "m"), out_(out), diagnostics_(diagnostics) { SetDescription("Runs aapt in daemon mode. Each subsequent line is a single parameter to the\n" "command. The end of an invocation is signaled by providing an empty line."); + AddOptionalFlag("--trace_folder", "Generate systrace json trace fragment to specified folder.", + &trace_folder_); } - int Action(const std::vector<std::string>& /* args */) override { + int Action(const std::vector<std::string>& arguments) override { + TRACE_FLUSH_ARGS(trace_folder_ ? trace_folder_.value() : "", "daemon", arguments); text::Printer printer(out_); std::cout << "Ready" << std::endl; @@ -150,6 +154,7 @@ class DaemonCommand : public Command { private: io::FileOutputStream* out_; IDiagnostics* diagnostics_; + Maybe<std::string> trace_folder_; }; } // namespace aapt |