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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
236 | 236 |
237 // Ensure the file exists. Need to normalize path separators since on | 237 // Ensure the file exists. Need to normalize path separators since on |
238 // Windows they can come out as forward slashes here, and that confuses some | 238 // Windows they can come out as forward slashes here, and that confuses some |
239 // of the commands. | 239 // of the commands. |
240 base::FilePath arg_file = | 240 base::FilePath arg_file = |
241 setup.build_settings().GetFullPath(setup.GetBuildArgFile()) | 241 setup.build_settings().GetFullPath(setup.GetBuildArgFile()) |
242 .NormalizePathSeparators(); | 242 .NormalizePathSeparators(); |
243 if (!base::PathExists(arg_file)) { | 243 if (!base::PathExists(arg_file)) { |
244 std::string argfile_default_contents = | 244 std::string argfile_default_contents = |
245 "# Build arguments go here. Examples:\n" | 245 "# Build arguments go here. Examples:\n" |
246 "# enable_doom_melon = true\n" | 246 "# is_component_build = true\n" |
247 "# crazy_something = \"absolutely\"\n"; | 247 "# is_debug = false\n" |
248 "# See \"gn args --list\" for available build arguments.\n"; | |
scottmg
2014/12/12 23:29:20
I think this has to be "gn args out/gn --list".
mdempsky
2014/12/12 23:41:37
I changed it to
# See "gn args <dir_name> --lis
| |
248 #if defined(OS_WIN) | 249 #if defined(OS_WIN) |
249 // Use Windows lineendings for this file since it will often open in | 250 // Use Windows lineendings for this file since it will often open in |
250 // Notepad which can't handle Unix ones. | 251 // Notepad which can't handle Unix ones. |
251 ReplaceSubstringsAfterOffset(&argfile_default_contents, 0, "\n", "\r\n"); | 252 ReplaceSubstringsAfterOffset(&argfile_default_contents, 0, "\n", "\r\n"); |
252 #endif | 253 #endif |
253 base::CreateDirectory(arg_file.DirName()); | 254 base::CreateDirectory(arg_file.DirName()); |
254 base::WriteFile(arg_file, argfile_default_contents.c_str(), | 255 base::WriteFile(arg_file, argfile_default_contents.c_str(), |
255 static_cast<int>(argfile_default_contents.size())); | 256 static_cast<int>(argfile_default_contents.size())); |
256 } | 257 } |
257 | 258 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
336 "Or see \"gn help args\" for more variants.").PrintToStdout(); | 337 "Or see \"gn help args\" for more variants.").PrintToStdout(); |
337 return 1; | 338 return 1; |
338 } | 339 } |
339 | 340 |
340 if (base::CommandLine::ForCurrentProcess()->HasSwitch(kSwitchList)) | 341 if (base::CommandLine::ForCurrentProcess()->HasSwitch(kSwitchList)) |
341 return ListArgs(args[0]); | 342 return ListArgs(args[0]); |
342 return EditArgsFile(args[0]); | 343 return EditArgsFile(args[0]); |
343 } | 344 } |
344 | 345 |
345 } // namespace commands | 346 } // namespace commands |
OLD | NEW |