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

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

Issue 2492273002: GN: Always check for bad items. (Closed)
Patch Set: Created 4 years, 1 month 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
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 <algorithm> 5 #include <algorithm>
6 #include <iterator> 6 #include <iterator>
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 } 100 }
101 101
102 std::string input; 102 std::string input;
103 bool ret = base::ReadFileToString(UTF8ToFilePath(args[1]), &input); 103 bool ret = base::ReadFileToString(UTF8ToFilePath(args[1]), &input);
104 if (!ret) { 104 if (!ret) {
105 Err(Location(), "Input file " + args[1] + " not found.").PrintToStdout(); 105 Err(Location(), "Input file " + args[1] + " not found.").PrintToStdout();
106 return 1; 106 return 1;
107 } 107 }
108 108
109 Setup* setup = new Setup; 109 Setup* setup = new Setup;
110 setup->build_settings().set_check_for_bad_items(false);
111 if (!setup->DoSetup(args[0], false) || !setup->Run()) 110 if (!setup->DoSetup(args[0], false) || !setup->Run())
112 return 1; 111 return 1;
113 112
114 Analyzer analyzer(setup->builder()); 113 Analyzer analyzer(setup->builder());
115 114
116 Err err; 115 Err err;
117 std::string output = Analyzer(setup->builder()).Analyze(input, &err); 116 std::string output = Analyzer(setup->builder()).Analyze(input, &err);
118 if (err.has_error()) { 117 if (err.has_error()) {
119 err.PrintToStdout(); 118 err.PrintToStdout();
120 return 1; 119 return 1;
121 } 120 }
122 121
123 WriteFile(UTF8ToFilePath(args[2]), output, &err); 122 WriteFile(UTF8ToFilePath(args[2]), output, &err);
124 if (err.has_error()) { 123 if (err.has_error()) {
125 err.PrintToStdout(); 124 err.PrintToStdout();
126 return 1; 125 return 1;
127 } 126 }
128 127
129 return 0; 128 return 0;
130 } 129 }
131 130
132 } // namespace commands 131 } // namespace commands
OLDNEW
« no previous file with comments | « tools/gn/build_settings.cc ('k') | tools/gn/command_args.cc » ('j') | tools/gn/command_args.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698