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

Unified Diff: tools/gn/switches.cc

Issue 2481423002: Convert gn docstrings to C++11 raw strings. (Closed)
Patch Set: Fixes Created 4 years, 1 month 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/substitution_writer.cc ('k') | tools/gn/variables.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/switches.cc
diff --git a/tools/gn/switches.cc b/tools/gn/switches.cc
index 8884634f90635375b2ab3540be7ffadd18ce7f95..05c2a5befcad170c655da2dc8153f2f197ba14bc 100644
--- a/tools/gn/switches.cc
+++ b/tools/gn/switches.cc
@@ -10,34 +10,34 @@ const char kArgs[] = "args";
const char kArgs_HelpShort[] =
"--args: Specifies build arguments overrides.";
const char kArgs_Help[] =
- "--args: Specifies build arguments overrides.\n"
- "\n"
- " See \"gn help buildargs\" for an overview of how build arguments work.\n"
- "\n"
- " Most operations take a build directory. The build arguments are taken\n"
- " from the previous build done in that directory. If a command specifies\n"
- " --args, it will override the previous arguments stored in the build\n"
- " directory, and use the specified ones.\n"
- "\n"
- " The args specified will be saved to the build directory for subsequent\n"
- " commands. Specifying --args=\"\" will clear all build arguments.\n"
- "\n"
- "Formatting\n"
- "\n"
- " The value of the switch is interpreted in GN syntax. For typical usage\n"
- " of string arguments, you will need to be careful about escaping of\n"
- " quotes.\n"
- "\n"
- "Examples\n"
- "\n"
- " gn gen out/Default --args=\"foo=\\\"bar\\\"\"\n"
- "\n"
- " gn gen out/Default --args='foo=\"bar\" enable=true blah=7'\n"
- "\n"
- " gn check out/Default --args=\"\"\n"
- " Clears existing build args from the directory.\n"
- "\n"
- " gn desc out/Default --args=\"some_list=[1, false, \\\"foo\\\"]\"\n";
+ R"(--args: Specifies build arguments overrides.
+
+ See "gn help buildargs" for an overview of how build arguments work.
+
+ Most operations take a build directory. The build arguments are taken from
+ the previous build done in that directory. If a command specifies --args, it
+ will override the previous arguments stored in the build directory, and use
+ the specified ones.
+
+ The args specified will be saved to the build directory for subsequent
+ commands. Specifying --args="" will clear all build arguments.
+
+Formatting
+
+ The value of the switch is interpreted in GN syntax. For typical usage of
+ string arguments, you will need to be careful about escaping of quotes.
+
+Examples
+
+ gn gen out/Default --args="foo=\"bar\""
+
+ gn gen out/Default --args='foo="bar" enable=true blah=7'
+
+ gn check out/Default --args=""
+ Clears existing build args from the directory.
+
+ gn desc out/Default --args="some_list=[1, false, \"foo\"]"
+)";
#define COLOR_HELP_LONG \
"--[no]color: Forces colored output on or off.\n"\
@@ -60,37 +60,39 @@ const char kDotfile[] = "dotfile";
const char kDotfile_HelpShort[] =
"--dotfile: Override the name of the \".gn\" file.";
const char kDotfile_Help[] =
- "--dotfile: Override the name of the \".gn\" file.\n"
- "\n"
- " Normally GN loads the \".gn\"file from the source root for some basic\n"
- " configuration (see \"gn help dotfile\"). This flag allows you to\n"
- " use a different file.\n"
- "\n"
- " Note that this interacts with \"--root\" in a possibly incorrect way.\n"
- " It would be nice to test the edge cases and document or fix.\n";
+ R"(--dotfile: Override the name of the ".gn" file.
+
+ Normally GN loads the ".gn"file from the source root for some basic
+ configuration (see "gn help dotfile"). This flag allows you to
+ use a different file.
+
+ Note that this interacts with "--root" in a possibly incorrect way.
+ It would be nice to test the edge cases and document or fix.
+)";
const char kFailOnUnusedArgs[] = "fail-on-unused-args";
const char kFailOnUnusedArgs_HelpShort[] =
"--fail-on-unused-args: Treat unused build args as fatal errors.";
const char kFailOnUnusedArgs_Help[] =
- "--fail-on-unused-args: Treat unused build args as fatal errors.\n"
- "\n"
- " If you set a value in a build's \"gn args\" and never use it in the\n"
- " build (in a declare_args() block), GN will normally print an error\n"
- " but not fail the build.\n"
- "\n"
- " In many cases engineers would use build args to enable or disable\n"
- " features that would sometimes get removed. It would by annoying to\n"
- " block work for typically benign problems. In Chrome in particular,\n"
- " flags might be configured for build bots in a separate infrastructure\n"
- " repository, or a declare_args block might be changed in a third party\n"
- " repository. Treating these errors as blocking forced complex multi-\n"
- " way patches to land what would otherwise be simple changes.\n"
- "\n"
- " In some cases, such concerns are not as important, and a mismatch\n"
- " in build flags between the invoker of the build and the build files\n"
- " represents a critical mismatch that should be immediately fixed. Such\n"
- " users can set this flag to force GN to fail in that case.\n";
+ R"(--fail-on-unused-args: Treat unused build args as fatal errors.
+
+ If you set a value in a build's "gn args" and never use it in the build (in
+ a declare_args() block), GN will normally print an error but not fail the
+ build.
+
+ In many cases engineers would use build args to enable or disable features
+ that would sometimes get removed. It would by annoying to block work for
+ typically benign problems. In Chrome in particular, flags might be configured
+ for build bots in a separate infrastructure repository, or a declare_args
+ block might be changed in a third party repository. Treating these errors as
+ blocking forced complex multi- way patches to land what would otherwise be
+ simple changes.
+
+ In some cases, such concerns are not as important, and a mismatch in build
+ flags between the invoker of the build and the build files represents a
+ critical mismatch that should be immediately fixed. Such users can set this
+ flag to force GN to fail in that case.
+)";
const char kMarkdown[] = "markdown";
const char kMarkdown_HelpShort[] =
@@ -107,127 +109,135 @@ const char kScriptExecutable[] = "script-executable";
const char kScriptExecutable_HelpShort[] =
"--script-executable: Set the executable used to execute scripts.";
const char kScriptExecutable_Help[] =
- "--script-executable: Set the executable used to execute scripts.\n"
- "\n"
- " By default GN searches the PATH for Python to execute scripts in\n"
- " action targets and exec_script calls. This flag allows the\n"
- " specification of a specific Python executable or potentially\n"
- " a different language interpreter.\n";
+ R"(--script-executable: Set the executable used to execute scripts.
+
+ By default GN searches the PATH for Python to execute scripts in action
+ targets and exec_script calls. This flag allows the specification of a
+ specific Python executable or potentially a different language
+ interpreter.
+)";
const char kQuiet[] = "q";
const char kQuiet_HelpShort[] =
"-q: Quiet mode. Don't print output on success.";
const char kQuiet_Help[] =
- "-q: Quiet mode. Don't print output on success.\n"
- "\n"
- " This is useful when running as a part of another script.\n";
+ R"(-q: Quiet mode. Don't print output on success.
+
+ This is useful when running as a part of another script.
+)";
const char kRoot[] = "root";
const char kRoot_HelpShort[] =
"--root: Explicitly specify source root.";
const char kRoot_Help[] =
- "--root: Explicitly specify source root.\n"
- "\n"
- " Normally GN will look up in the directory tree from the current\n"
- " directory to find a \".gn\" file. The source root directory specifies\n"
- " the meaning of \"//\" beginning with paths, and the BUILD.gn file\n"
- " in that directory will be the first thing loaded.\n"
- "\n"
- " Specifying --root allows GN to do builds in a specific directory\n"
- " regardless of the current directory.\n"
- "\n"
- "Examples\n"
- "\n"
- " gn gen //out/Default --root=/home/baracko/src\n"
- "\n"
- " gn desc //out/Default --root=\"C:\\Users\\BObama\\My Documents\\foo\"\n";
+ R"(--root: Explicitly specify source root.
+
+ Normally GN will look up in the directory tree from the current directory to
+ find a ".gn" file. The source root directory specifies the meaning of "//"
+ beginning with paths, and the BUILD.gn file in that directory will be the
+ first thing loaded.
+
+ Specifying --root allows GN to do builds in a specific directory regardless
+ of the current directory.
+
+Examples
+
+ gn gen //out/Default --root=/home/baracko/src
+
+ gn desc //out/Default --root="C:\Users\BObama\My Documents\foo"
+)";
const char kRuntimeDepsListFile[] = "runtime-deps-list-file";
const char kRuntimeDepsListFile_HelpShort[] =
"--runtime-deps-list-file: Save runtime dependencies for targets in file.";
const char kRuntimeDepsListFile_Help[] =
- "--runtime-deps-list-file: Save runtime dependencies for targets in file.\n"
- "\n"
- " --runtime-deps-list-file=<filename>\n"
- "\n"
- " Where <filename> is a text file consisting of the labels, one per\n"
- " line, of the targets for which runtime dependencies are desired.\n"
- "\n"
- " See \"gn help runtime_deps\" for a description of how runtime\n"
- " dependencies are computed.\n"
- "\n"
- "Runtime deps output file\n"
- "\n"
- " For each target requested, GN will write a separate runtime dependency\n"
- " file. The runtime dependency file will be in the output directory\n"
- " alongside the output file of the target, with a \".runtime_deps\"\n"
- " extension. For example, if the target \"//foo:bar\" is listed in the\n"
- " input file, and that target produces an output file \"bar.so\", GN\n"
- " will create a file \"bar.so.runtime_deps\" in the build directory.\n"
- "\n"
- " If a source set, action, copy, or group is listed, the runtime deps\n"
- " file will correspond to the .stamp file corresponding to that target.\n"
- " This is probably not useful; the use-case for this feature is\n"
- " generally executable targets.\n"
- "\n"
- " The runtime dependency file will list one file per line, with no\n"
- " escaping. The files will be relative to the root_build_dir. The first\n"
- " line of the file will be the main output file of the target itself\n"
- " (in the above example, \"bar.so\").\n";
+ R"(--runtime-deps-list-file: Save runtime dependencies for targets in file.
+
+ --runtime-deps-list-file=<filename>
+
+ Where <filename> is a text file consisting of the labels, one per line, of
+ the targets for which runtime dependencies are desired.
+
+ See "gn help runtime_deps" for a description of how runtime dependencies are
+ computed.
+
+Runtime deps output file
+
+ For each target requested, GN will write a separate runtime dependency file.
+ The runtime dependency file will be in the output directory alongside the
+ output file of the target, with a ".runtime_deps" extension. For example, if
+ the target "//foo:bar" is listed in the input file, and that target produces
+ an output file "bar.so", GN will create a file "bar.so.runtime_deps" in the
+ build directory.
+
+ If a source set, action, copy, or group is listed, the runtime deps file will
+ correspond to the .stamp file corresponding to that target. This is probably
+ not useful; the use-case for this feature is generally executable targets.
+
+ The runtime dependency file will list one file per line, with no escaping.
+ The files will be relative to the root_build_dir. The first line of the file
+ will be the main output file of the target itself (in the above example,
+ "bar.so").
+)";
const char kThreads[] = "threads";
const char kThreads_HelpShort[] =
"--threads: Specify number of worker threads.";
const char kThreads_Help[] =
- "--threads: Specify number of worker threads.\n"
- "\n"
- " GN runs many threads to load and run build files. This can make\n"
- " debugging challenging. Or you may want to experiment with different\n"
- " values to see how it affects performance.\n"
- "\n"
- " The parameter is the number of worker threads. This does not count the\n"
- " main thread (so there are always at least two).\n"
- "\n"
- "Examples\n"
- "\n"
- " gen gen out/Default --threads=1\n";
+ R"(--threads: Specify number of worker threads.
+
+ GN runs many threads to load and run build files. This can make debugging
+ challenging. Or you may want to experiment with different values to see how
+ it affects performance.
+
+ The parameter is the number of worker threads. This does not count the main
+ thread (so there are always at least two).
+
+Examples
+
+ gen gen out/Default --threads=1
+)";
const char kTime[] = "time";
const char kTime_HelpShort[] =
"--time: Outputs a summary of how long everything took.";
const char kTime_Help[] =
- "--time: Outputs a summary of how long everything took.\n"
- "\n"
- " Hopefully self-explanatory.\n"
- "\n"
- "Examples\n"
- "\n"
- " gn gen out/Default --time\n";
+ R"(--time: Outputs a summary of how long everything took.
+
+ Hopefully self-explanatory.
+
+Examples
+
+ gn gen out/Default --time
+)";
const char kTracelog[] = "tracelog";
const char kTracelog_HelpShort[] =
"--tracelog: Writes a Chrome-compatible trace log to the given file.";
const char kTracelog_Help[] =
- "--tracelog: Writes a Chrome-compatible trace log to the given file.\n"
- "\n"
- " The trace log will show file loads, executions, scripts, and writes.\n"
- " This allows performance analysis of the generation step.\n"
- "\n"
- " To view the trace, open Chrome and navigate to \"chrome://tracing/\",\n"
- " then press \"Load\" and specify the file you passed to this parameter.\n"
- "\n"
- "Examples\n"
- "\n"
- " gn gen out/Default --tracelog=mytrace.trace\n";
+ R"(--tracelog: Writes a Chrome-compatible trace log to the given file.
+
+ The trace log will show file loads, executions, scripts, and writes. This
+ allows performance analysis of the generation step.
+
+ To view the trace, open Chrome and navigate to "chrome://tracing/", then
+ press "Load" and specify the file you passed to this parameter.
+
+Examples
+
+ gn gen out/Default --tracelog=mytrace.trace
+)";
const char kVerbose[] = "v";
const char kVerbose_HelpShort[] =
"-v: Verbose logging.";
const char kVerbose_Help[] =
- "-v: Verbose logging.\n"
- "\n"
- " This will spew logging events to the console for debugging issues.\n"
- " Good luck!\n";
+ R"(-v: Verbose logging.
+
+ This will spew logging events to the console for debugging issues.
+
+ Good luck!
+)";
const char kVersion[] = "version";
const char kVersion_HelpShort[] =
« no previous file with comments | « tools/gn/substitution_writer.cc ('k') | tools/gn/variables.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698