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 "tools/gn/commands.h" | 5 #include "tools/gn/commands.h" |
6 #include "tools/gn/header_checker.h" | 6 #include "tools/gn/header_checker.h" |
7 #include "tools/gn/setup.h" | 7 #include "tools/gn/setup.h" |
8 #include "tools/gn/standard_out.h" | 8 #include "tools/gn/standard_out.h" |
9 #include "tools/gn/trace.h" | 9 #include "tools/gn/trace.h" |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 int RunCheck(const std::vector<std::string>& args) { | 45 int RunCheck(const std::vector<std::string>& args) { |
46 if (args.size() != 1 && args.size() != 2) { | 46 if (args.size() != 1 && args.size() != 2) { |
47 Err(Location(), "You're holding it wrong.", | 47 Err(Location(), "You're holding it wrong.", |
48 "Usage: \"gn check <out_dir> [<target_label>]\"").PrintToStdout(); | 48 "Usage: \"gn check <out_dir> [<target_label>]\"").PrintToStdout(); |
49 return 1; | 49 return 1; |
50 } | 50 } |
51 | 51 |
52 // Deliberately leaked to avoid expensive process teardown. | 52 // Deliberately leaked to avoid expensive process teardown. |
53 Setup* setup = new Setup(); | 53 Setup* setup = new Setup(); |
54 if (!setup->DoSetup(args[0])) | 54 if (!setup->DoSetup(args[0], false)) |
55 return 1; | 55 return 1; |
56 if (!setup->Run()) | 56 if (!setup->Run()) |
57 return 1; | 57 return 1; |
58 | 58 |
59 std::vector<const Target*> targets_to_check; | 59 std::vector<const Target*> targets_to_check; |
60 if (args.size() == 2) { | 60 if (args.size() == 2) { |
61 // Compute the target to check (empty means everything). | 61 // Compute the target to check (empty means everything). |
62 if (!ResolveTargetsFromCommandLinePattern(setup, args[1], false, | 62 if (!ResolveTargetsFromCommandLinePattern(setup, args[1], false, |
63 &targets_to_check)) | 63 &targets_to_check)) |
64 return 1; | 64 return 1; |
(...skipping 29 matching lines...) Expand all Loading... |
94 header_checker->Run(to_check, force_check, &header_errors); | 94 header_checker->Run(to_check, force_check, &header_errors); |
95 for (size_t i = 0; i < header_errors.size(); i++) { | 95 for (size_t i = 0; i < header_errors.size(); i++) { |
96 if (i > 0) | 96 if (i > 0) |
97 OutputString("___________________\n", DECORATION_YELLOW); | 97 OutputString("___________________\n", DECORATION_YELLOW); |
98 header_errors[i].PrintToStdout(); | 98 header_errors[i].PrintToStdout(); |
99 } | 99 } |
100 return header_errors.empty(); | 100 return header_errors.empty(); |
101 } | 101 } |
102 | 102 |
103 } // namespace commands | 103 } // namespace commands |
OLD | NEW |