summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2022-08-05 12:18:30 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2022-08-05 15:41:00 +0200
commit72c113e15eb21214503019ec93844712bc526314 (patch)
tree9966e69404adc7d3d78537cda40f0f2e5615fa9f
parent29ba620502e05d6bd22d13fc819ddc98309c5a58 (diff)
downloadjustbuild-72c113e15eb21214503019ec93844712bc526314.tar.gz
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.
-rw-r--r--src/buildtool/main/main.cpp6
1 files changed, 5 insertions, 1 deletions
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 == "-") {