From 72c113e15eb21214503019ec93844712bc526314 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Fri, 5 Aug 2022 12:18:30 +0200 Subject: dump-targets: don't dump source trees We have to include explicit tree references into our target-result map, as these targets can provide a tree definition, if the root is not a git root or compatible mode is used. Nevertheless, from a user's persepective, trees are just source references, like files. Therefore, do not include them, when dumping the map of analyzed targets. In this way, we also avoid the ambiguity in the dump between an explicit tree reference and a defined target with the same name. --- src/buildtool/main/main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/buildtool/main/main.cpp b/src/buildtool/main/main.cpp index c1a7c4ef..b7b22056 100644 --- a/src/buildtool/main/main.cpp +++ b/src/buildtool/main/main.cpp @@ -766,7 +766,11 @@ void DumpTargets(std::string const& file_path, }; std::for_each( target_ids.begin(), target_ids.end(), [&conf_list](auto const& id) { - conf_list(id.target).push_back(id.config.ToJson()); + if ((not id.target.IsNamedTarget()) or + id.target.GetNamedTarget().reference_t == + BuildMaps::Base::ReferenceType::kTarget) { + conf_list(id.target).push_back(id.config.ToJson()); + } }); auto const dump_string = IndentListsOnlyUntilDepth(repo_map, 2); if (file_path == "-") { -- cgit v1.2.3