diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2022-12-22 10:27:09 +0100 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2022-12-22 14:00:39 +0100 |
commit | 4baaf93a0387f30cef93a39b5a6841218c42c308 (patch) | |
tree | 914cbd60cffdd82ecc9461ff31d81cebe9cf8a2d /src/buildtool/main/main.cpp | |
parent | 1c953b099d37363452f7ecce5bdec1097c66b920 (diff) | |
download | justbuild-4baaf93a0387f30cef93a39b5a6841218c42c308.tar.gz |
Add option --dump-export-targets
... dumping only the configured targets that are export targets.
Those targets are of particular interest as those are the targets,
as they are the high-level caching points and also often serve
as interface between projects.
Diffstat (limited to 'src/buildtool/main/main.cpp')
-rw-r--r-- | src/buildtool/main/main.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/buildtool/main/main.cpp b/src/buildtool/main/main.cpp index fbbef488..0c9f047a 100644 --- a/src/buildtool/main/main.cpp +++ b/src/buildtool/main/main.cpp @@ -787,7 +787,8 @@ void DumpTrees(std::string const& file_path, AnalysisResult const& result) { } void DumpTargets(std::string const& file_path, - std::vector<Target::ConfiguredTarget> const& target_ids) { + std::vector<Target::ConfiguredTarget> const& target_ids, + std::string const& target_qualifier = "") { auto repo_map = nlohmann::json::object(); auto conf_list = [&repo_map](Base::EntityName const& ref) -> nlohmann::json& { @@ -813,12 +814,14 @@ void DumpTargets(std::string const& file_path, }); auto const dump_string = IndentListsOnlyUntilDepth(repo_map, 2); if (file_path == "-") { - Logger::Log(LogLevel::Info, "List of analysed targets:"); + Logger::Log( + LogLevel::Info, "List of analysed {}targets:", target_qualifier); std::cout << dump_string << std::endl; } else { Logger::Log(LogLevel::Info, - "Dumping list of analysed targets to file '{}'.", + "Dumping list of analysed {}targets to file '{}'.", + target_qualifier, file_path); std::ofstream os(file_path); os << dump_string << std::endl; @@ -941,6 +944,10 @@ void DumpNodes(std::string const& file_path, AnalysisResult const& result) { if (clargs.dump_targets) { DumpTargets(*clargs.dump_targets, result_map.ConfiguredTargets()); } + if (clargs.dump_export_targets) { + DumpTargets( + *clargs.dump_export_targets, result_map.ExportTargets(), "export "); + } if (clargs.dump_targets_graph) { auto graph = result_map.ConfiguredTargetsGraph().dump(2); Logger::Log(LogLevel::Info, |