Fixes bug in path handling of analyzer

Was using os.getcwd when it needs to use options.toplevel_dir

R=mark@chromium.org
BUG=383609
TEST=none

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

git-svn-id: http://gyp.googlecode.com/svn/trunk@1951 78cadc50-ecff-11dd-a971-7dbc132099af
Add test files for https://codereview.chromium.org/406523005/

Maybe the try failures are due to the try server not adding the new files
correctly, since the test passes for me locally. Add the test files in a
separate commit (not used by anything yet) to test this theory.


git-svn-id: http://gyp.googlecode.com/svn/trunk@1952 78cadc50-ecff-11dd-a971-7dbc132099af
ninja/win: Put common msvs_system_include_dirs into %INCLUDE% 

Paths in INCLUDE are considered system headers by clang-cl and it will suppress 
warnings from system headers. 

BUG=chromium:395405
Review URL: https://codereview.chromium.org/406523005/


git-svn-id: http://gyp.googlecode.com/svn/trunk@1953 78cadc50-ecff-11dd-a971-7dbc132099af
This CL adds support for extension in GYP.

This CL adds the extension target type and adds the link flags to
compile .appex extensions.

BUG=gyp:435
R=justincohen@chromium.org, mark@chromium.org, pkl@chromium.org, sdefresne@chromium.org

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

git-svn-id: http://gyp.googlecode.com/svn/trunk@1954 78cadc50-ecff-11dd-a971-7dbc132099af
ninja: Add support for 'ninja_use_console' in actions/rules

Setting this to 1 will make ninja use 'pool = console' for the action/rule.

BUG=
R=thakis@chromium.org

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

git-svn-id: http://gyp.googlecode.com/svn/trunk@1955 78cadc50-ecff-11dd-a971-7dbc132099af
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