| Index: tools/gn/ninja_build_writer.cc
|
| diff --git a/tools/gn/ninja_build_writer.cc b/tools/gn/ninja_build_writer.cc
|
| index b7cfdd797cdb620617fc8dd5a8ed9d393a7d44f0..a7752453ec27d9bb8bdbd72acf19bf4520cb14d1 100644
|
| --- a/tools/gn/ninja_build_writer.cc
|
| +++ b/tools/gn/ninja_build_writer.cc
|
| @@ -136,9 +136,26 @@ void NinjaBuildWriter::WriteNinjaRules() {
|
| out_ << " command = " << GetSelfInvocationCommand(build_settings_) << "\n";
|
| out_ << " description = Regenerating ninja files\n\n";
|
|
|
| + // This rule will regenerate the ninja files when any input file has changed.
|
| out_ << "build build.ninja: gn\n"
|
| << " depfile = build.ninja.d\n";
|
|
|
| + // Provide a way to force regenerating ninja files if the user is suspicious
|
| + // something is out-of-date. This will be "ninja refresh".
|
| + out_ << "\nbuild refresh: gn\n";
|
| +
|
| + // Provide a way to see what flags are associated with this build:
|
| + // This will be "ninja show".
|
| + const CommandLine& our_cmdline = *CommandLine::ForCurrentProcess();
|
| + std::string args = our_cmdline.GetSwitchValueASCII("args");
|
| + out_ << "rule echo\n";
|
| + out_ << " command = echo $text\n";
|
| + out_ << " description = ECHO $desc\n";
|
| + out_ << "build show: echo\n";
|
| + out_ << " desc = build arguments:\n";
|
| + out_ << " text = " << (args.empty() ? std::string("<default args>") : args)
|
| + << "\n";
|
| +
|
| // Input build files. These go in the ".d" file. If we write them as
|
| // dependencies in the .ninja file itself, ninja will expect the files to
|
| // exist and will error if they don't. When files are listed in a depfile,
|
|
|