diff options
-rw-r--r-- | share/man/just.1.md | 5 | ||||
-rw-r--r-- | src/buildtool/common/cli.hpp | 6 | ||||
-rw-r--r-- | src/buildtool/main/main.cpp | 6 |
3 files changed, 17 insertions, 0 deletions
diff --git a/share/man/just.1.md b/share/man/just.1.md index dd585920..e981d633 100644 --- a/share/man/just.1.md +++ b/share/man/just.1.md @@ -439,6 +439,11 @@ File path for writing the action graph description to. See **`just-graph-file`**(5) for more details. Supported by: analyse|build|install|rebuild. +**`--dump-plain-graph`** *`PATH`* +File path for writing the action graph description to, however without +the additional `"origins"` key. See **`just-graph-file`**(5) for more details. +Supported by: analyse|build|install|rebuild. + **`-f`**, **`--log-file`** *`PATH`* Path to local log file. **`just`** will store the information printed on stderr in the log file along with the thread id and timestamp when the diff --git a/src/buildtool/common/cli.hpp b/src/buildtool/common/cli.hpp index 0571acb8..7f935364 100644 --- a/src/buildtool/common/cli.hpp +++ b/src/buildtool/common/cli.hpp @@ -71,6 +71,7 @@ struct AnalysisArguments { std::optional<std::filesystem::path> rule_root; std::optional<std::filesystem::path> expression_root; std::optional<std::filesystem::path> graph_file; + std::optional<std::filesystem::path> graph_file_plain; std::optional<std::filesystem::path> artifacts_to_build_file; std::optional<std::filesystem::path> serve_errors_file; }; @@ -343,6 +344,11 @@ static inline auto SetupAnalysisArguments( clargs->graph_file, "File path for writing the action graph description to.") ->type_name("PATH"); + app->add_option("--dump-plain-graph", + clargs->graph_file_plain, + "File path for writing the action graph description " + "(without origins) to.") + ->type_name("PATH"); app->add_option("--dump-artifacts-to-build", clargs->artifacts_to_build_file, "File path for writing the artifacts to build to.") diff --git a/src/buildtool/main/main.cpp b/src/buildtool/main/main.cpp index 6a2c8525..bada208a 100644 --- a/src/buildtool/main/main.cpp +++ b/src/buildtool/main/main.cpp @@ -1148,6 +1148,12 @@ auto main(int argc, char* argv[]) -> int { result_map.ToFile( *arguments.analysis.graph_file, &stats, &progress); } + if (arguments.analysis.graph_file_plain) { + result_map.ToFile</*kIncludeOrigins=*/false>( + *arguments.analysis.graph_file_plain, + &stats, + &progress); + } auto const [artifacts, runfiles] = ReadOutputArtifacts(result->target); if (arguments.analysis.artifacts_to_build_file) { |