OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "tools/gn/commands.h" | 9 #include "tools/gn/commands.h" |
10 #include "tools/gn/header_checker.h" | 10 #include "tools/gn/header_checker.h" |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 } | 177 } |
178 | 178 |
179 // Deliberately leaked to avoid expensive process teardown. | 179 // Deliberately leaked to avoid expensive process teardown. |
180 Setup* setup = new Setup(); | 180 Setup* setup = new Setup(); |
181 if (!setup->DoSetup(args[0], false)) | 181 if (!setup->DoSetup(args[0], false)) |
182 return 1; | 182 return 1; |
183 if (!setup->Run()) | 183 if (!setup->Run()) |
184 return 1; | 184 return 1; |
185 | 185 |
186 std::vector<const Target*> all_targets = | 186 std::vector<const Target*> all_targets = |
187 setup->builder()->GetAllResolvedTargets(); | 187 setup->builder().GetAllResolvedTargets(); |
188 | 188 |
189 bool filtered_by_build_config = false; | 189 bool filtered_by_build_config = false; |
190 std::vector<const Target*> targets_to_check; | 190 std::vector<const Target*> targets_to_check; |
191 if (args.size() > 1) { | 191 if (args.size() > 1) { |
192 // Compute the targets to check. | 192 // Compute the targets to check. |
193 std::vector<std::string> inputs(args.begin() + 1, args.end()); | 193 std::vector<std::string> inputs(args.begin() + 1, args.end()); |
194 UniqueVector<const Target*> target_matches; | 194 UniqueVector<const Target*> target_matches; |
195 UniqueVector<const Config*> config_matches; | 195 UniqueVector<const Config*> config_matches; |
196 UniqueVector<const Toolchain*> toolchain_matches; | 196 UniqueVector<const Toolchain*> toolchain_matches; |
197 UniqueVector<SourceFile> file_matches; | 197 UniqueVector<SourceFile> file_matches; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 header_checker->Run(to_check, force_check, &header_errors); | 253 header_checker->Run(to_check, force_check, &header_errors); |
254 for (size_t i = 0; i < header_errors.size(); i++) { | 254 for (size_t i = 0; i < header_errors.size(); i++) { |
255 if (i > 0) | 255 if (i > 0) |
256 OutputString("___________________\n", DECORATION_YELLOW); | 256 OutputString("___________________\n", DECORATION_YELLOW); |
257 header_errors[i].PrintToStdout(); | 257 header_errors[i].PrintToStdout(); |
258 } | 258 } |
259 return header_errors.empty(); | 259 return header_errors.empty(); |
260 } | 260 } |
261 | 261 |
262 } // namespace commands | 262 } // namespace commands |
OLD | NEW |