Chromium Code Reviews| Index: tools/gn/desc_builder.cc |
| diff --git a/tools/gn/desc_builder.cc b/tools/gn/desc_builder.cc |
| index 965ec921f10a12be760ee51aba699debb71b5a23..9080c3024faffe6df55397290e977f4a8ae9d16a 100644 |
| --- a/tools/gn/desc_builder.cc |
| +++ b/tools/gn/desc_builder.cc |
| @@ -406,6 +406,15 @@ class TargetDescBuilder : public BaseDescBuilder { |
| if (what(variables::kDeps)) |
| res->SetWithoutPathExpansion(variables::kDeps, RenderDeps()); |
| + // By default RenderDeps only renders Target::DEPS_PRIVATE, in that case |
| + // the output should be enriched also with Target::DEPS_PUBLIC. |
| + if (!tree_ && !all_) { |
| + if (what(variables::kPublicDeps)) { |
| + res->SetWithoutPathExpansion(variables::kPublicDeps, |
| + RenderPublicDeps()); |
| + } |
| + } |
| + |
| // Runtime deps are special, print only when explicitly asked for and not in |
| // overview mode. |
| if (what_.find("runtime_deps") != what_.end()) |
| @@ -511,7 +520,7 @@ class TargetDescBuilder : public BaseDescBuilder { |
| } else { |
| // Show direct dependencies only. |
| std::vector<const Target*> deps; |
| - for (const auto& pair : target_->GetDeps(Target::DEPS_ALL)) |
| + for (const auto& pair : target_->GetDeps(Target::DEPS_PRIVATE)) |
| deps.push_back(pair.ptr); |
| std::sort(deps.begin(), deps.end()); |
|
brettw
2017/06/07 19:59:14
I think we should delete this line (see below).
mbonadei1
2017/06/08 11:37:45
Done.
|
| commands::FilterAndPrintTargets(&deps, res.get()); |
| @@ -521,6 +530,19 @@ class TargetDescBuilder : public BaseDescBuilder { |
| return std::move(res); |
| } |
| + ValuePtr RenderPublicDeps() { |
| + auto res = base::MakeUnique<base::ListValue>(); |
| + |
| + std::vector<const Target*> deps; |
| + for (const auto& pair : target_->GetDeps(Target::DEPS_PUBLIC)) |
| + deps.push_back(pair.ptr); |
| + |
| + std::sort(deps.begin(), deps.end()); |
|
brettw
2017/06/07 19:59:14
I don't think we should be sorting these in either
mbonadei1
2017/06/08 11:37:45
Yes, it makes sense. I have removed sorting from b
|
| + commands::FilterAndPrintTargets(&deps, res.get()); |
| + |
| + return std::move(res); |
| + } |
| + |
| ValuePtr RenderRuntimeDeps() { |
| auto res = base::MakeUnique<base::ListValue>(); |