diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2023-05-08 10:43:40 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2023-05-09 15:37:33 +0200 |
commit | 00df206af5c80aba31bf7d180bdf03d617071e94 (patch) | |
tree | 00a637e6d78e7f8e9de323a0804df59c403120ef /libbuild2/parser.cxx | |
parent | 7a458f210f296cb3cc1551a4606f0cf025003f3a (diff) |
Add support for dumping build system state in JSON format (GH issue #182)
Specifically:
1. New --dump-format option. Valid values are `buildfile` and `json-v0.1`.
2. The --dump option now recognizes two additional values: `match-pre` and
`match-post` to dump the state of pre/post-operations. The `match` value
now only triggers dumping of the main operation.
Diffstat (limited to 'libbuild2/parser.cxx')
-rw-r--r-- | libbuild2/parser.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libbuild2/parser.cxx b/libbuild2/parser.cxx index 6f212da..3e8b30a 100644 --- a/libbuild2/parser.cxx +++ b/libbuild2/parser.cxx @@ -4702,8 +4702,10 @@ namespace build2 if (ns.empty ()) { + // Indent two spaces. + // if (scope_ != nullptr) - dump (scope_, nullopt /* action */, " "); // Indent two spaces. + dump (scope_, nullopt /* action */, dump_format::buildfile, " "); else os << " <no current scope>" << endl; } @@ -4721,8 +4723,10 @@ namespace build2 const target* t (enter_target::find_target (*this, n, o, l, trace)); + // Indent two spaces. + // if (t != nullptr) - dump (t, nullopt /* action */, " "); // Indent two spaces. + dump (t, nullopt /* action */, dump_format::buildfile, " "); else { os << " <no target " << n; |