Changes analyzer to search for targets

Here's a list of the changes:
. I'm changing input file to be a JSON file. This allows for passing
  in more information, such as the set of targets to search for.
. Changing output format to be JSON as well. This allows for more
  structure in outputting other random data. I'm a bit iffy on whether
  this is good, but it's requested by the recipes side of things which
  uses analyzer.
. You can now specify a set of targets to search for in addition to
  files. This is intended for things like 'unittests' so that only the
  set of targets that are effected by the change get run.

To enable the new functionality you have to pass in a new switch. Once
I integrate these changes into the rest of the stack. I'll remove the
old flow.

BUG=109173
TEST=covered by tests
R=mark@chromium.org

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

git-svn-id: http://gyp.googlecode.com/svn/trunk@1956 78cadc50-ecff-11dd-a971-7dbc132099af
Enable custom suffixes for Mac bundles.

Patch by Johannes Sartisohn <jsartisohn@google.com>

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


git-svn-id: http://gyp.googlecode.com/svn/trunk@1957 78cadc50-ecff-11dd-a971-7dbc132099af
Avoid infinite recursion with identity variables.

Some generators like gypd and gypsh define the generator_default_variables
as an identity expansion. For example, the variable 'INTERMEDIATE_DIR'
would expand to '<(INTERMEDIATE_DIR)' which lends to an infinite recursion
if a .gyp file uses any of those variables.

This patch detects trivial infinite recursive variable expansions like
this one and leaves them that way.

Patch by Alejandro Deymonnaz <deymo@chromium.org>

BUG=141
TEST=`gyp --debug=variables --format=gypd test.gyp` shows avoiding
infinite recursion message when test.gyp has an INTERMEDIATE_DIR
variable expansion.

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


git-svn-id: http://gyp.googlecode.com/svn/trunk@1958 78cadc50-ecff-11dd-a971-7dbc132099af
Updates analyzer to output to a file

File is specified by way of analyzer_output_path. I'm also changing
from a hard error if a target can't be found to a warning.

I'm also including a new set of tests. I forgot to svn add this last
time around.

BUG=109173
TEST=covered by tests
R=mark@chromium.org

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

git-svn-id: http://gyp.googlecode.com/svn/trunk@1959 78cadc50-ecff-11dd-a971-7dbc132099af
Guard against configurations without 'xcode_settings'

e.g. test/generator-output/src/prog1.gyp

TEST=Run
    ./gyptest.py -f xcode-ninja test/generator-output/gyptest-top-all.py

Expected to fail with
    OSError: [Errno 13] Permission denied: 'prog1.ninja.xcworkspace'
(instead of KeyError: 'xcode_settings')

R=sdefresne@chromium.org, justincohen@chromium.org

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

git-svn-id: http://gyp.googlecode.com/svn/trunk@1960 78cadc50-ecff-11dd-a971-7dbc132099af
Pull in relevant targets when using xcode-ninja

The tests gyptest-actions, gyptest-copies and gyptest-rules fail when
using the xcode-ninja generator because xcode-ninja (by design) only
creates targets for proper executables. In order for these three tests
to pass, the targets they rely on need to be included explicitly.

BUG=gyp:442

TEST=Run
    ./gyptest.py -f xcode-ninja test/generator-output/

Expected: all tests pass (instead of failing the three mentioned above).

R=sdefresne@chromium.org, justincohen@chromium.org

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

git-svn-id: http://gyp.googlecode.com/svn/trunk@1961 78cadc50-ecff-11dd-a971-7dbc132099af
Currently I've special cased gyp* file modifications higher in the
stack. By that I mean if a gyp* file has been modified I don't run
analyze and assume everything has changed. This change adds support
for modification to gyp* files. If a gyp* file has changed it assumes
all targets in the file are modified. Similarly if an included file
has been modified all targets in the file that did the include are
considered modified. Lastly, if one of the modified files is specified
on the command line via -I the I early out and assume everything needs
to be recompiled.

BUG=109173
R=scottmg@chromium.org

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

git-svn-id: http://gyp.googlecode.com/svn/trunk@1962 78cadc50-ecff-11dd-a971-7dbc132099af
Style changes for analyzer
__ -> _
and lots of single newlines to double newlines.

BUG=none
R=scottmg@chromium.org

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

git-svn-id: http://gyp.googlecode.com/svn/trunk@1963 78cadc50-ecff-11dd-a971-7dbc132099af
Provide a way to suppress implicit MIDL generation rules for actions

For IDL files, GYP ninja normally generates rules to build MIDL
unless there are explicit rules. This special casing only works
for rules, but not actions.
In blink, we are going to add an action which runs blink's IDL compiler
to generate IDL dictionary implementation .h/.cpp files, which means
that we need a way to similar logic for actions.
This CL introduces 'explicit_idl_action' flag for such purpose.

Patch from bashi@chromium.org.

R=scottmg@chromium.org

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

git-svn-id: http://gyp.googlecode.com/svn/trunk@1964 78cadc50-ecff-11dd-a971-7dbc132099af
Removes old way to specify files to look for

This was from the first version and is no longer used. Also cleaned up
tests as well.

BUG=none
TEST=none
R=scottmg@chromium.org

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

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