ninja: Write gypcmd files into the output directory instead of the tree.

gyp r789 added a filelist feature, where

  <(file.foo arg1 arg2 arg3)

would write "arg1 arg2 arg3" into file "file.foo" and evaluate to "file.foo".
This is used to write very long commands into files to work around command line
length limitations. The files written by this are just written into the source
tree. (They are only written if they are different from the previous version of
the file.)

One problem with this is that the filenames are free form and so can't be
reliably added to .gitignore -- and so our bots delete them all on sync, because
they delete unknown files. So build edges using gyp filelists are always dirty
on the bots.

The filelist stuff is evaluated before generators run, and -- worse -- most
generators rely on the build system creating the build directory at build
time. Most build systems have a facility to change the build directory for
every build (setting SYMROOT for xcodebuild, builddir for make, OutputDirectory
for msvs). So it's not trivial to write filelist files into the build directory.

For ninja, the output directory is known at gyp file however. So add an
optional generator_file_path() function that generators can use to map
filelist paths to paths in the build directory, and implement that for ninja.
That way, gypcmd files won't clutter the src directory with the ninja generator
at least.

This should speed up incremental builds on most bots (== all bots using ninja)
by a few minutes. It also makes filelists with work better with -Goutput_dir,
as each output_dir now has an independent set of filelists.

The make generator could use --generator-output-dir to do something similar,
if someone feels motivated.

Also add a better test for filelists. The existing test only used the gypd
generator and compared to a golden file, which didn't catch several bugs that
I introduced while writing this. The new test caught them all.

BUG=chromium:297186,gyp:316
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/27418008

git-svn-id: http://gyp.googlecode.com/svn/trunk@1762 78cadc50-ecff-11dd-a971-7dbc132099af
Build fix after r1782

Not sure why try jobs where green.

TBR=scottmg@chromium.org



git-svn-id: http://gyp.googlecode.com/svn/trunk@1763 78cadc50-ecff-11dd-a971-7dbc132099af