| 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 "base/atomicops.h" | 5 #include "base/atomicops.h" |
| 6 #include "base/bind.h" | 6 #include "base/bind.h" |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/timer/elapsed_timer.h" | 10 #include "base/timer/elapsed_timer.h" |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 return false; | 267 return false; |
| 268 } | 268 } |
| 269 | 269 |
| 270 } // namespace | 270 } // namespace |
| 271 | 271 |
| 272 const char kGen[] = "gen"; | 272 const char kGen[] = "gen"; |
| 273 const char kGen_HelpShort[] = "gen: Generate ninja files."; | 273 const char kGen_HelpShort[] = "gen: Generate ninja files."; |
| 274 const char kGen_Help[] = | 274 const char kGen_Help[] = |
| 275 R"(gn gen: Generate ninja files. | 275 R"(gn gen: Generate ninja files. |
| 276 | 276 |
| 277 gn gen [<ide options>] <out_dir> | 277 gn gen [--check] [<ide options>] <out_dir> |
| 278 | 278 |
| 279 Generates ninja files from the current tree and puts them in the given output | 279 Generates ninja files from the current tree and puts them in the given output |
| 280 directory. | 280 directory. |
| 281 | 281 |
| 282 The output directory can be a source-repo-absolute path name such as: | 282 The output directory can be a source-repo-absolute path name such as: |
| 283 //out/foo | 283 //out/foo |
| 284 Or it can be a directory relative to the current directory such as: | 284 Or it can be a directory relative to the current directory such as: |
| 285 out/foo | 285 out/foo |
| 286 | 286 |
| 287 "gn gen --check" is the same as running "gn check". See "gn help check" |
| 288 for documentation on that mode. |
| 289 |
| 287 See "gn help switches" for the common command-line switches. | 290 See "gn help switches" for the common command-line switches. |
| 288 | 291 |
| 289 IDE options | 292 IDE options |
| 290 | 293 |
| 291 GN optionally generates files for IDE. Possibilities for <ide options> | 294 GN optionally generates files for IDE. Possibilities for <ide options> |
| 292 | 295 |
| 293 --ide=<ide_name> | 296 --ide=<ide_name> |
| 294 Generate files for an IDE. Currently supported values: | 297 Generate files for an IDE. Currently supported values: |
| 295 "eclipse" - Eclipse CDT settings file. | 298 "eclipse" - Eclipse CDT settings file. |
| 296 "vs" - Visual Studio project/solution files. | 299 "vs" - Visual Studio project/solution files. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 GN DOES NOT generate Eclipse CDT projects. Instead, it generates a settings | 349 GN DOES NOT generate Eclipse CDT projects. Instead, it generates a settings |
| 347 file which can be imported into an Eclipse CDT project. The XML file contains | 350 file which can be imported into an Eclipse CDT project. The XML file contains |
| 348 a list of include paths and defines. Because GN does not generate a full | 351 a list of include paths and defines. Because GN does not generate a full |
| 349 .cproject definition, it is not possible to properly define includes/defines | 352 .cproject definition, it is not possible to properly define includes/defines |
| 350 for each file individually. Instead, one set of includes/defines is generated | 353 for each file individually. Instead, one set of includes/defines is generated |
| 351 for the entire project. This works fairly well but may still result in a few | 354 for the entire project. This works fairly well but may still result in a few |
| 352 indexer issues here and there. | 355 indexer issues here and there. |
| 353 | 356 |
| 354 Generic JSON Output | 357 Generic JSON Output |
| 355 | 358 |
| 356 Dumps target information to JSON file and optionally invokes python script on | 359 Dumps target information to a JSON file and optionally invokes a |
| 357 generated file. See comments at the beginning of json_project_writer.cc and | 360 python script on the generated file. See the comments at the beginning |
| 358 desc_builder.cc for overview of JSON file format. | 361 of json_project_writer.cc and desc_builder.cc for an overview of the JSON |
| 362 file format. |
| 359 | 363 |
| 360 --json-file-name=<json_file_name> | 364 --json-file-name=<json_file_name> |
| 361 Overrides default file name (project.json) of generated JSON file. | 365 Overrides default file name (project.json) of generated JSON file. |
| 362 | 366 |
| 363 --json-ide-script=<path_to_python_script> | 367 --json-ide-script=<path_to_python_script> |
| 364 Executes python script after the JSON file is generated. Path can be | 368 Executes python script after the JSON file is generated. Path can be |
| 365 project absolute (//), system absolute (/) or relative, in which case the | 369 project absolute (//), system absolute (/) or relative, in which case the |
| 366 output directory will be base. Path to generated JSON file will be first | 370 output directory will be base. Path to generated JSON file will be first |
| 367 argument when invoking script. | 371 argument when invoking script. |
| 368 | 372 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 setup->scheduler().input_file_manager()->GetInputFileCount()) + | 453 setup->scheduler().input_file_manager()->GetInputFileCount()) + |
| 450 " files in " + | 454 " files in " + |
| 451 base::Int64ToString(elapsed_time.InMilliseconds()) + "ms\n"; | 455 base::Int64ToString(elapsed_time.InMilliseconds()) + "ms\n"; |
| 452 OutputString(stats); | 456 OutputString(stats); |
| 453 } | 457 } |
| 454 | 458 |
| 455 return 0; | 459 return 0; |
| 456 } | 460 } |
| 457 | 461 |
| 458 } // namespace commands | 462 } // namespace commands |
| OLD | NEW |