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

Unified Diff: tools/gn/command_gen.cc

Issue 165823003: GN: Change gen command syntax, support relative dirs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments fixes Created 6 years, 10 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_args.cc ('k') | tools/gn/command_gyp.cc » ('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 f4fefcc5c925e56975722dcf32f0752f4ba13838..5be018aa4eee131d60004ef509b99030f2ca98e8 100644
--- a/tools/gn/command_gen.cc
+++ b/tools/gn/command_gen.cc
@@ -50,8 +50,17 @@ const char kGen[] = "gen";
const char kGen_HelpShort[] =
"gen: Generate ninja files.";
const char kGen_Help[] =
- "gn gen\n"
- " Generates ninja files from the current tree.\n"
+ "gn gen: Generate ninja files.\n"
+ "\n"
+ " gn gen <output_directory>\n"
+ "\n"
+ " Generates ninja files from the current tree and puts them in the given\n"
+ " output directory.\n"
+ "\n"
+ " The output directory can be a source-repo-absolute path name such as:\n"
+ " //out/foo\n"
+ " Or it can be a directory relative to the current directory such as:\n"
+ " out/foo\n"
"\n"
" See \"gn help\" for the common command-line switches.\n";
@@ -59,9 +68,16 @@ const char kGen_Help[] =
int RunGen(const std::vector<std::string>& args) {
base::ElapsedTimer timer;
+ if (args.size() != 1) {
+ Err(Location(), "Need exactly one build directory to generate.",
+ "I expected something more like \"gn gen out/foo\"\n"
+ "You can also see \"gn help gen\".").PrintToStdout();
+ return 1;
+ }
+
// Deliberately leaked to avoid expensive process teardown.
- Setup* setup = new Setup;
- if (!setup->DoSetup())
+ Setup* setup = new Setup();
+ if (!setup->DoSetup(args[0]))
return 1;
// Cause the load to also generate the ninja files for each target. We wrap
« no previous file with comments | « tools/gn/command_args.cc ('k') | tools/gn/command_gyp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698