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

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

Issue 558763002: Require build directories exist for some GN commands. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: file path literal Created 6 years, 3 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 | « tools/gn/command_args.cc ('k') | tools/gn/command_desc.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « tools/gn/command_args.cc ('k') | tools/gn/command_desc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698