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

Unified Diff: tools/gn/command_gen.cc

Issue 2160533004: Revert of [GN] Add JSON project writer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/command_desc.cc ('k') | tools/gn/commands.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/command_gen.cc
diff --git a/tools/gn/command_gen.cc b/tools/gn/command_gen.cc
index 06b99ca1124d6a63fb92907b190fbe3874dca054..3d442745c393970e383074971a14c0f1e33db26d 100644
--- a/tools/gn/command_gen.cc
+++ b/tools/gn/command_gen.cc
@@ -11,7 +11,6 @@
#include "tools/gn/build_settings.h"
#include "tools/gn/commands.h"
#include "tools/gn/eclipse_writer.h"
-#include "tools/gn/json_project_writer.h"
#include "tools/gn/ninja_target_writer.h"
#include "tools/gn/ninja_writer.h"
#include "tools/gn/qt_creator_writer.h"
@@ -37,14 +36,10 @@
const char kSwitchIdeValueVs2013[] = "vs2013";
const char kSwitchIdeValueVs2015[] = "vs2015";
const char kSwitchIdeValueXcode[] = "xcode";
-const char kSwitchIdeValueJson[] = "json";
const char kSwitchNinjaExtraArgs[] = "ninja-extra-args";
const char kSwitchRootTarget[] = "root-target";
const char kSwitchSln[] = "sln";
const char kSwitchWorkspace[] = "workspace";
-const char kSwitchJsonFileName[] = "json-file-name";
-const char kSwitchJsonIdeScript[] = "json-ide-script";
-const char kSwitchJsonIdeScriptArgs[] = "json-ide-script-args";
// Called on worker thread to write the ninja file.
void BackgroundDoWrite(const Target* target) {
@@ -118,7 +113,7 @@
if (generator) {
err += "but this file was not generated by any dependencies of the " +
- target_str + ". The target\nthat generates the file is:\n ";
+ target_str + ". The target\nthat generates the file is:\n ";
err += generator->label().GetUserVisibleName(show_toolchains);
} else {
err += "but no targets in the build generate that file.";
@@ -171,12 +166,11 @@
Err* err) {
const base::CommandLine* command_line =
base::CommandLine::ForCurrentProcess();
- bool quiet = command_line->HasSwitch(switches::kQuiet);
base::ElapsedTimer timer;
if (ide == kSwitchIdeValueEclipse) {
bool res = EclipseWriter::RunAndWriteFile(build_settings, builder, err);
- if (res && !quiet) {
+ if (res && !command_line->HasSwitch(switches::kQuiet)) {
OutputString("Generating Eclipse settings took " +
base::Int64ToString(timer.Elapsed().InMilliseconds()) +
"ms\n");
@@ -195,7 +189,7 @@
filters = command_line->GetSwitchValueASCII(kSwitchFilters);
bool res = VisualStudioWriter::RunAndWriteFiles(
build_settings, builder, version, sln_name, filters, err);
- if (res && !quiet) {
+ if (res && !command_line->HasSwitch(switches::kQuiet)) {
OutputString("Generating Visual Studio projects took " +
base::Int64ToString(timer.Elapsed().InMilliseconds()) +
"ms\n");
@@ -208,7 +202,7 @@
command_line->GetSwitchValueASCII(kSwitchNinjaExtraArgs),
command_line->GetSwitchValueASCII(kSwitchFilters), build_settings,
builder, err);
- if (res && !quiet) {
+ if (res && !command_line->HasSwitch(switches::kQuiet)) {
OutputString("Generating Xcode projects took " +
base::Int64ToString(timer.Elapsed().InMilliseconds()) +
"ms\n");
@@ -220,32 +214,12 @@
root_target = command_line->GetSwitchValueASCII(kSwitchRootTarget);
bool res = QtCreatorWriter::RunAndWriteFile(build_settings, builder, err,
root_target);
- if (res && !quiet) {
+ if (res && !command_line->HasSwitch(switches::kQuiet)) {
OutputString("Generating QtCreator projects took " +
base::Int64ToString(timer.Elapsed().InMilliseconds()) +
"ms\n");
}
return res;
- } else if (ide == kSwitchIdeValueJson) {
- std::string file_name =
- command_line->GetSwitchValueASCII(kSwitchJsonFileName);
- if (file_name.empty())
- file_name = "project.json";
- std::string exec_script =
- command_line->GetSwitchValueASCII(kSwitchJsonIdeScript);
- std::string exec_script_extra_args =
- command_line->GetSwitchValueASCII(kSwitchJsonIdeScriptArgs);
- std::string filters = command_line->GetSwitchValueASCII(kSwitchFilters);
-
- bool res = JSONProjectWriter::RunAndWriteFiles(
- build_settings, builder, file_name, exec_script, exec_script_extra_args,
- filters, quiet, err);
- if (res && !quiet) {
- OutputString("Generating JSON projects took " +
- base::Int64ToString(timer.Elapsed().InMilliseconds()) +
- "ms\n");
- }
- return res;
}
*err = Err(Location(), "Unknown IDE: " + ide);
@@ -255,7 +229,8 @@
} // namespace
const char kGen[] = "gen";
-const char kGen_HelpShort[] = "gen: Generate ninja files.";
+const char kGen_HelpShort[] =
+ "gen: Generate ninja files.";
const char kGen_Help[] =
"gn gen: Generate ninja files.\n"
"\n"
@@ -284,13 +259,12 @@
" \"vs2015\" - Visual Studio 2015 project/solution files.\n"
" \"xcode\" - Xcode workspace/solution files.\n"
" \"qtcreator\" - QtCreator project files.\n"
- " \"json\" - JSON file containing target information\n"
"\n"
" --filters=<path_prefixes>\n"
" Semicolon-separated list of label patterns used to limit the set\n"
" of generated projects (see \"gn help label_pattern\"). Only\n"
" matching targets and their dependencies will be included in the\n"
- " solution. Only used for Visual Studio, Xcode and JSON.\n"
+ " solution. Only used for Visual Studio and Xcode.\n"
"\n"
"Visual Studio Flags\n"
"\n"
@@ -331,27 +305,7 @@
" properly define includes/defines for each file individually.\n"
" Instead, one set of includes/defines is generated for the entire\n"
" project. This works fairly well but may still result in a few indexer\n"
- " issues here and there.\n"
- "\n"
- "Generic JSON Output\n"
- "\n"
- " Dumps target information to JSON file and optionally invokes python\n"
- " script on generated file. \n"
- " See comments at the beginning of json_project_writer.cc and\n"
- " desc_builder.cc for overview of JSON file format.\n"
- "\n"
- " --json-file-name=<json_file_name>\n"
- " Overrides default file name (project.json) of generated JSON file.\n"
- "\n"
- " --json-ide-script=<path_to_python_script>\n"
- " Executes python script after the JSON file is generated.\n"
- " Path can be project absolute (//), system absolute (/) or\n"
- " relative, in which case the output directory will be base.\n"
- " Path to generated JSON file will be first argument when invoking\n"
- " script.\n"
- "\n"
- " --json-ide-script-args=<argument>\n"
- " Optional second argument that will passed to executed script.\n";
+ " issues here and there.\n";
int RunGen(const std::vector<std::string>& args) {
base::ElapsedTimer timer;
« no previous file with comments | « tools/gn/command_desc.cc ('k') | tools/gn/commands.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698