| 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 18 matching lines...) Expand all Loading... |
| 29 namespace { | 29 namespace { |
| 30 | 30 |
| 31 const char kSwitchCheck[] = "check"; | 31 const char kSwitchCheck[] = "check"; |
| 32 const char kSwitchFilters[] = "filters"; | 32 const char kSwitchFilters[] = "filters"; |
| 33 const char kSwitchIde[] = "ide"; | 33 const char kSwitchIde[] = "ide"; |
| 34 const char kSwitchIdeValueEclipse[] = "eclipse"; | 34 const char kSwitchIdeValueEclipse[] = "eclipse"; |
| 35 const char kSwitchIdeValueQtCreator[] = "qtcreator"; | 35 const char kSwitchIdeValueQtCreator[] = "qtcreator"; |
| 36 const char kSwitchIdeValueVs[] = "vs"; | 36 const char kSwitchIdeValueVs[] = "vs"; |
| 37 const char kSwitchIdeValueVs2013[] = "vs2013"; | 37 const char kSwitchIdeValueVs2013[] = "vs2013"; |
| 38 const char kSwitchIdeValueVs2015[] = "vs2015"; | 38 const char kSwitchIdeValueVs2015[] = "vs2015"; |
| 39 const char kSwitchIdeValueVs2017[] = "vs2017"; |
| 39 const char kSwitchIdeValueXcode[] = "xcode"; | 40 const char kSwitchIdeValueXcode[] = "xcode"; |
| 40 const char kSwitchIdeValueJson[] = "json"; | 41 const char kSwitchIdeValueJson[] = "json"; |
| 41 const char kSwitchNinjaExtraArgs[] = "ninja-extra-args"; | 42 const char kSwitchNinjaExtraArgs[] = "ninja-extra-args"; |
| 42 const char kSwitchNoDeps[] = "no-deps"; | 43 const char kSwitchNoDeps[] = "no-deps"; |
| 43 const char kSwitchRootTarget[] = "root-target"; | 44 const char kSwitchRootTarget[] = "root-target"; |
| 44 const char kSwitchSln[] = "sln"; | 45 const char kSwitchSln[] = "sln"; |
| 45 const char kSwitchWorkspace[] = "workspace"; | 46 const char kSwitchWorkspace[] = "workspace"; |
| 46 const char kSwitchJsonFileName[] = "json-file-name"; | 47 const char kSwitchJsonFileName[] = "json-file-name"; |
| 47 const char kSwitchJsonIdeScript[] = "json-ide-script"; | 48 const char kSwitchJsonIdeScript[] = "json-ide-script"; |
| 48 const char kSwitchJsonIdeScriptArgs[] = "json-ide-script-args"; | 49 const char kSwitchJsonIdeScriptArgs[] = "json-ide-script-args"; |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 | 187 |
| 187 if (ide == kSwitchIdeValueEclipse) { | 188 if (ide == kSwitchIdeValueEclipse) { |
| 188 bool res = EclipseWriter::RunAndWriteFile(build_settings, builder, err); | 189 bool res = EclipseWriter::RunAndWriteFile(build_settings, builder, err); |
| 189 if (res && !quiet) { | 190 if (res && !quiet) { |
| 190 OutputString("Generating Eclipse settings took " + | 191 OutputString("Generating Eclipse settings took " + |
| 191 base::Int64ToString(timer.Elapsed().InMilliseconds()) + | 192 base::Int64ToString(timer.Elapsed().InMilliseconds()) + |
| 192 "ms\n"); | 193 "ms\n"); |
| 193 } | 194 } |
| 194 return res; | 195 return res; |
| 195 } else if (ide == kSwitchIdeValueVs || ide == kSwitchIdeValueVs2013 || | 196 } else if (ide == kSwitchIdeValueVs || ide == kSwitchIdeValueVs2013 || |
| 196 ide == kSwitchIdeValueVs2015) { | 197 ide == kSwitchIdeValueVs2015 || ide == kSwitchIdeValueVs2017) { |
| 197 VisualStudioWriter::Version version = | 198 VisualStudioWriter::Version version = VisualStudioWriter::Version::Vs2015; |
| 198 ide == kSwitchIdeValueVs2013 ? VisualStudioWriter::Version::Vs2013 | 199 if (ide == kSwitchIdeValueVs2013) |
| 199 : VisualStudioWriter::Version::Vs2015; | 200 version = VisualStudioWriter::Version::Vs2013; |
| 201 else if (ide == kSwitchIdeValueVs2017) |
| 202 version = VisualStudioWriter::Version::Vs2017; |
| 203 |
| 200 std::string sln_name; | 204 std::string sln_name; |
| 201 if (command_line->HasSwitch(kSwitchSln)) | 205 if (command_line->HasSwitch(kSwitchSln)) |
| 202 sln_name = command_line->GetSwitchValueASCII(kSwitchSln); | 206 sln_name = command_line->GetSwitchValueASCII(kSwitchSln); |
| 203 std::string filters; | 207 std::string filters; |
| 204 if (command_line->HasSwitch(kSwitchFilters)) | 208 if (command_line->HasSwitch(kSwitchFilters)) |
| 205 filters = command_line->GetSwitchValueASCII(kSwitchFilters); | 209 filters = command_line->GetSwitchValueASCII(kSwitchFilters); |
| 206 bool no_deps = command_line->HasSwitch(kSwitchNoDeps); | 210 bool no_deps = command_line->HasSwitch(kSwitchNoDeps); |
| 207 bool res = VisualStudioWriter::RunAndWriteFiles( | 211 bool res = VisualStudioWriter::RunAndWriteFiles( |
| 208 build_settings, builder, version, sln_name, filters, no_deps, err); | 212 build_settings, builder, version, sln_name, filters, no_deps, err); |
| 209 if (res && !quiet) { | 213 if (res && !quiet) { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 | 290 |
| 287 GN optionally generates files for IDE. Possibilities for <ide options> | 291 GN optionally generates files for IDE. Possibilities for <ide options> |
| 288 | 292 |
| 289 --ide=<ide_name> | 293 --ide=<ide_name> |
| 290 Generate files for an IDE. Currently supported values: | 294 Generate files for an IDE. Currently supported values: |
| 291 "eclipse" - Eclipse CDT settings file. | 295 "eclipse" - Eclipse CDT settings file. |
| 292 "vs" - Visual Studio project/solution files. | 296 "vs" - Visual Studio project/solution files. |
| 293 (default Visual Studio version: 2015) | 297 (default Visual Studio version: 2015) |
| 294 "vs2013" - Visual Studio 2013 project/solution files. | 298 "vs2013" - Visual Studio 2013 project/solution files. |
| 295 "vs2015" - Visual Studio 2015 project/solution files. | 299 "vs2015" - Visual Studio 2015 project/solution files. |
| 300 "vs2017" - Visual Studio 2017 project/solution files. |
| 296 "xcode" - Xcode workspace/solution files. | 301 "xcode" - Xcode workspace/solution files. |
| 297 "qtcreator" - QtCreator project files. | 302 "qtcreator" - QtCreator project files. |
| 298 "json" - JSON file containing target information | 303 "json" - JSON file containing target information |
| 299 | 304 |
| 300 --filters=<path_prefixes> | 305 --filters=<path_prefixes> |
| 301 Semicolon-separated list of label patterns used to limit the set of | 306 Semicolon-separated list of label patterns used to limit the set of |
| 302 generated projects (see "gn help label_pattern"). Only matching targets | 307 generated projects (see "gn help label_pattern"). Only matching targets |
| 303 and their dependencies will be included in the solution. Only used for | 308 and their dependencies will be included in the solution. Only used for |
| 304 Visual Studio, Xcode and JSON. | 309 Visual Studio, Xcode and JSON. |
| 305 | 310 |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 setup->scheduler().input_file_manager()->GetInputFileCount()) + | 449 setup->scheduler().input_file_manager()->GetInputFileCount()) + |
| 445 " files in " + | 450 " files in " + |
| 446 base::Int64ToString(elapsed_time.InMilliseconds()) + "ms\n"; | 451 base::Int64ToString(elapsed_time.InMilliseconds()) + "ms\n"; |
| 447 OutputString(stats); | 452 OutputString(stats); |
| 448 } | 453 } |
| 449 | 454 |
| 450 return 0; | 455 return 0; |
| 451 } | 456 } |
| 452 | 457 |
| 453 } // namespace commands | 458 } // namespace commands |
| OLD | NEW |