Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(544)

Side by Side Diff: tools/gn/command_refs.cc

Issue 2164773002: Make `gn refs` look at script files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stddef.h> 5 #include <stddef.h>
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 } 138 }
139 for (const auto& cur_file : target->inputs()) { 139 for (const auto& cur_file : target->inputs()) {
140 if (cur_file == file) 140 if (cur_file == file)
141 return true; 141 return true;
142 } 142 }
143 for (const auto& cur_file : target->data()) { 143 for (const auto& cur_file : target->data()) {
144 if (cur_file == file.value()) 144 if (cur_file == file.value())
145 return true; 145 return true;
146 } 146 }
147 147
148 if (target->action_values().script().value() == file.value())
149 return true;
150
148 std::vector<SourceFile> outputs; 151 std::vector<SourceFile> outputs;
149 target->action_values().GetOutputsAsSourceFiles(target, &outputs); 152 target->action_values().GetOutputsAsSourceFiles(target, &outputs);
150 for (const auto& cur_file : outputs) { 153 for (const auto& cur_file : outputs) {
151 if (cur_file == file) 154 if (cur_file == file)
152 return true; 155 return true;
153 } 156 }
154 return false; 157 return false;
155 } 158 }
156 159
157 void GetTargetsContainingFile(Setup* setup, 160 void GetTargetsContainingFile(Setup* setup,
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 477
475 // If you ask for the references of a valid target, but that target has 478 // If you ask for the references of a valid target, but that target has
476 // nothing referencing it, we'll get here without having printed anything. 479 // nothing referencing it, we'll get here without having printed anything.
477 if (!quiet && cnt == 0) 480 if (!quiet && cnt == 0)
478 OutputString("Nothing references this.\n", DECORATION_YELLOW); 481 OutputString("Nothing references this.\n", DECORATION_YELLOW);
479 482
480 return 0; 483 return 0;
481 } 484 }
482 485
483 } // namespace commands 486 } // namespace commands
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698