OLD | NEW |
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 <stdio.h> | 5 #include <stdio.h> |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 "# Build arguments go here. Examples:\n" | 247 "# Build arguments go here. Examples:\n" |
248 "# enable_doom_melon = true\n" | 248 "# enable_doom_melon = true\n" |
249 "# crazy_something = \"absolutely\"\n"; | 249 "# crazy_something = \"absolutely\"\n"; |
250 #if defined(OS_WIN) | 250 #if defined(OS_WIN) |
251 // Use Windows lineendings for this file since it will often open in | 251 // Use Windows lineendings for this file since it will often open in |
252 // Notepad which can't handle Unix ones. | 252 // Notepad which can't handle Unix ones. |
253 ReplaceSubstringsAfterOffset(&argfile_default_contents, 0, "\n", "\r\n"); | 253 ReplaceSubstringsAfterOffset(&argfile_default_contents, 0, "\n", "\r\n"); |
254 #endif | 254 #endif |
255 base::CreateDirectory(arg_file.DirName()); | 255 base::CreateDirectory(arg_file.DirName()); |
256 base::WriteFile(arg_file, argfile_default_contents.c_str(), | 256 base::WriteFile(arg_file, argfile_default_contents.c_str(), |
257 argfile_default_contents.size()); | 257 static_cast<int>(argfile_default_contents.size())); |
258 } | 258 } |
259 | 259 |
260 ScopedTrace editor_trace(TraceItem::TRACE_SETUP, "Waiting for editor"); | 260 ScopedTrace editor_trace(TraceItem::TRACE_SETUP, "Waiting for editor"); |
261 if (!RunEditor(arg_file)) | 261 if (!RunEditor(arg_file)) |
262 return 1; | 262 return 1; |
263 } | 263 } |
264 | 264 |
265 // Now do a normal "gen" command. | 265 // Now do a normal "gen" command. |
266 OutputString("Generating files...\n"); | 266 OutputString("Generating files...\n"); |
267 std::vector<std::string> gen_commands; | 267 std::vector<std::string> gen_commands; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 "Or see \"gn help args\" for more variants.").PrintToStdout(); | 338 "Or see \"gn help args\" for more variants.").PrintToStdout(); |
339 return 1; | 339 return 1; |
340 } | 340 } |
341 | 341 |
342 if (base::CommandLine::ForCurrentProcess()->HasSwitch(kSwitchList)) | 342 if (base::CommandLine::ForCurrentProcess()->HasSwitch(kSwitchList)) |
343 return ListArgs(args[0]); | 343 return ListArgs(args[0]); |
344 return EditArgsFile(args[0]); | 344 return EditArgsFile(args[0]); |
345 } | 345 } |
346 | 346 |
347 } // namespace commands | 347 } // namespace commands |
OLD | NEW |