Showing with 2,225 additions and 2,139 deletions.
  1. +2 −2 Makefile
  2. +1 −1 configure
  3. +2 −0 tools/gyp/AUTHORS
  4. +0 −2 tools/gyp/DEPS
  5. +0 −21 tools/gyp/MANIFEST
  6. +0 −1 tools/gyp/PRESUBMIT.py
  7. +148 −0 tools/gyp/buildbot/buildbot_run.py
  8. +4 −15 tools/gyp/gyp
  9. +1 −1 tools/gyp/gyp.bat
  10. +18 −0 tools/gyp/gyp_main.py
  11. +15 −8 tools/gyp/gyptest.py
  12. +10 −9 tools/gyp/pylib/gyp/MSVSNew.py
  13. +6 −1 tools/gyp/pylib/gyp/MSVSSettings.py
  14. +68 −13 tools/gyp/pylib/gyp/MSVSUtil.py
  15. +38 −5 tools/gyp/pylib/gyp/MSVSVersion.py
  16. +0 −199 tools/gyp/pylib/gyp/SCons.py
  17. +65 −60 tools/gyp/pylib/gyp/__init__.py
  18. +24 −2 tools/gyp/pylib/gyp/common.py
  19. +5 −7 tools/gyp/pylib/gyp/{sun_tool.py → flock_tool.py}
  20. +49 −79 tools/gyp/pylib/gyp/generator/android.py
  21. +1 −13 tools/gyp/pylib/gyp/generator/dump_dependency_json.py
  22. +47 −16 tools/gyp/pylib/gyp/generator/eclipse.py
  23. +50 −29 tools/gyp/pylib/gyp/generator/make.py
  24. +176 −29 tools/gyp/pylib/gyp/generator/msvs.py
  25. +604 −263 tools/gyp/pylib/gyp/generator/ninja.py
  26. +24 −24 tools/gyp/pylib/gyp/generator/ninja_test.py
  27. +0 −1,072 tools/gyp/pylib/gyp/generator/scons.py
  28. +29 −44 tools/gyp/pylib/gyp/generator/xcode.py
  29. +23 −0 tools/gyp/pylib/gyp/generator/xcode_test.py
  30. +205 −75 tools/gyp/pylib/gyp/input.py
  31. +90 −0 tools/gyp/pylib/gyp/input_test.py
  32. +57 −16 tools/gyp/pylib/gyp/mac_tool.py
  33. +121 −22 tools/gyp/pylib/gyp/msvs_emulation.py
  34. +13 −5 tools/gyp/pylib/gyp/ninja_syntax.py
  35. +18 −35 tools/gyp/pylib/gyp/win_tool.py
  36. +271 −42 tools/gyp/pylib/gyp/xcode_emulation.py
  37. +37 −19 tools/gyp/pylib/gyp/xcodeproj_file.py
  38. +2 −9 tools/gyp/setup.py
  39. +1 −0 tools/gyp/tools/emacs/gyp.el
  40. 0 tools/{gyp_node → gyp_node.py}
@@ -46,9 +46,9 @@ endif
out/Makefile: common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp deps/zlib/zlib.gyp deps/v8/build/common.gypi deps/v8/tools/gyp/v8.gyp node.gyp config.gypi
ifeq ($(USE_NINJA),1)
touch out/Makefile
$(PYTHON) tools/gyp_node -f ninja
$(PYTHON) tools/gyp_node.py -f ninja
else
$(PYTHON) tools/gyp_node -f make
$(PYTHON) tools/gyp_node.py -f make
endif

config.gypi: configure
@@ -704,4 +704,4 @@ elif flavor == 'win':
else:
gyp_args = ['-f', 'make-' + flavor]

subprocess.call([sys.executable, 'tools/gyp_node'] + gyp_args)
subprocess.call([sys.executable, 'tools/gyp_node.py'] + gyp_args)
@@ -3,6 +3,8 @@

Google Inc.
Bloomberg Finance L.P.
Yandex LLC

Steven Knight <knight@baldmt.com>
Ryan Norton <rnorton10@gmail.com>
Eric N. Vander Weele <ericvw@gmail.com>
@@ -8,8 +8,6 @@ vars = {
}

deps = {
"scons":
Var("chrome_trunk") + "/src/third_party/scons@44099",
}

deps_os = {

This file was deleted.

@@ -17,7 +17,6 @@
'test/lib/TestCommon.py',
'test/lib/TestGyp.py',
# Needs style fix.
'pylib/gyp/generator/scons.py',
'pylib/gyp/generator/xcode.py',
]

@@ -0,0 +1,148 @@
#!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.


"""Argument-less script to select what to run on the buildbots."""


import os
import shutil
import subprocess
import sys


if sys.platform in ['win32', 'cygwin']:
EXE_SUFFIX = '.exe'
else:
EXE_SUFFIX = ''


BUILDBOT_DIR = os.path.dirname(os.path.abspath(__file__))
TRUNK_DIR = os.path.dirname(BUILDBOT_DIR)
ROOT_DIR = os.path.dirname(TRUNK_DIR)
ANDROID_DIR = os.path.join(ROOT_DIR, 'android')
OUT_DIR = os.path.join(TRUNK_DIR, 'out')


def CallSubProcess(*args, **kwargs):
"""Wrapper around subprocess.call which treats errors as build exceptions."""
retcode = subprocess.call(*args, **kwargs)
if retcode != 0:
print '@@@STEP_EXCEPTION@@@'
sys.exit(1)


def PrepareAndroidTree():
"""Prepare an Android tree to run 'android' format tests."""
if os.environ['BUILDBOT_CLOBBER'] == '1':
print '@@@BUILD_STEP Clobber Android checkout@@@'
shutil.rmtree(ANDROID_DIR)

# The release of Android we use is static, so there's no need to do anything
# if the directory already exists.
if os.path.isdir(ANDROID_DIR):
return

print '@@@BUILD_STEP Initialize Android checkout@@@'
os.mkdir(ANDROID_DIR)
CallSubProcess(['git', 'config', '--global', 'user.name', 'trybot'])
CallSubProcess(['git', 'config', '--global',
'user.email', 'chrome-bot@google.com'])
CallSubProcess(['git', 'config', '--global', 'color.ui', 'false'])
CallSubProcess(
['repo', 'init',
'-u', 'https://android.googlesource.com/platform/manifest',
'-b', 'android-4.2.1_r1',
'-g', 'all,-notdefault,-device,-darwin,-mips,-x86'],
cwd=ANDROID_DIR)

print '@@@BUILD_STEP Sync Android@@@'
CallSubProcess(['repo', 'sync', '-j4'], cwd=ANDROID_DIR)

print '@@@BUILD_STEP Build Android@@@'
CallSubProcess(
['/bin/bash',
'-c', 'source build/envsetup.sh && lunch full-eng && make -j4'],
cwd=ANDROID_DIR)


def GypTestFormat(title, format=None, msvs_version=None):
"""Run the gyp tests for a given format, emitting annotator tags.
See annotator docs at:
https://sites.google.com/a/chromium.org/dev/developers/testing/chromium-build-infrastructure/buildbot-annotations
Args:
format: gyp format to test.
Returns:
0 for sucesss, 1 for failure.
"""
if not format:
format = title

print '@@@BUILD_STEP ' + title + '@@@'
sys.stdout.flush()
env = os.environ.copy()
if msvs_version:
env['GYP_MSVS_VERSION'] = msvs_version
command = ' '.join(
[sys.executable, 'trunk/gyptest.py',
'--all',
'--passed',
'--format', format,
'--chdir', 'trunk'])
if format == 'android':
# gyptest needs the environment setup from envsetup/lunch in order to build
# using the 'android' backend, so this is done in a single shell.
retcode = subprocess.call(
['/bin/bash',
'-c', 'source build/envsetup.sh && lunch full-eng && cd %s && %s'
% (ROOT_DIR, command)],
cwd=ANDROID_DIR, env=env)
else:
retcode = subprocess.call(command, cwd=ROOT_DIR, env=env, shell=True)
if retcode:
# Emit failure tag, and keep going.
print '@@@STEP_FAILURE@@@'
return 1
return 0


def GypBuild():
# Dump out/ directory.
print '@@@BUILD_STEP cleanup@@@'
print 'Removing %s...' % OUT_DIR
shutil.rmtree(OUT_DIR, ignore_errors=True)
print 'Done.'

retcode = 0
# The Android gyp bot runs on linux so this must be tested first.
if os.environ['BUILDBOT_BUILDERNAME'] == 'gyp-android':
PrepareAndroidTree()
retcode += GypTestFormat('android')
elif sys.platform.startswith('linux'):
retcode += GypTestFormat('ninja')
retcode += GypTestFormat('make')
elif sys.platform == 'darwin':
retcode += GypTestFormat('ninja')
retcode += GypTestFormat('xcode')
retcode += GypTestFormat('make')
elif sys.platform == 'win32':
retcode += GypTestFormat('ninja')
if os.environ['BUILDBOT_BUILDERNAME'] == 'gyp-win64':
retcode += GypTestFormat('msvs-2010', format='msvs', msvs_version='2010')
retcode += GypTestFormat('msvs-2012', format='msvs', msvs_version='2012')
else:
raise Exception('Unknown platform')
if retcode:
# TODO(bradnelson): once the annotator supports a postscript (section for
# after the build proper that could be used for cumulative failures),
# use that instead of this. This isolates the final return value so
# that it isn't misattributed to the last stage.
print '@@@BUILD_STEP failures@@@'
sys.exit(retcode)


if __name__ == '__main__':
GypBuild()
@@ -1,18 +1,7 @@
#!/usr/bin/env python

# Copyright (c) 2009 Google Inc. All rights reserved.
#!/bin/bash
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import sys

# TODO(mark): sys.path manipulation is some temporary testing stuff.
try:
import gyp
except ImportError, e:
import os.path
sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), 'pylib'))
import gyp

if __name__ == '__main__':
sys.exit(gyp.main(sys.argv[1:]))
BASE=`dirname $0`
python $BASE/gyp_main.py "$@"
@@ -2,4 +2,4 @@
@rem Use of this source code is governed by a BSD-style license that can be
@rem found in the LICENSE file.

@python "%~dp0/gyp" %*
@python "%~dp0gyp_main.py" %*
@@ -0,0 +1,18 @@
#!/usr/bin/env python

# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import sys

# TODO(mark): sys.path manipulation is some temporary testing stuff.
try:
import gyp
except ImportError, e:
import os.path
sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), 'pylib'))
import gyp

if __name__ == '__main__':
sys.exit(gyp.script_main())
@@ -130,15 +130,18 @@ def __getattr__(self, attr):
sys.stderr = Unbuffered(sys.stderr)


def is_test_name(f):
return f.startswith('gyptest') and f.endswith('.py')


def find_all_gyptest_files(directory):
result = []
for root, dirs, files in os.walk(directory):
if '.svn' in dirs:
dirs.remove('.svn')
result.extend([ os.path.join(root, f) for f in files
if f.startswith('gyptest') and f.endswith('.py') ])
result.sort()
return result
result = []
for root, dirs, files in os.walk(directory):
if '.svn' in dirs:
dirs.remove('.svn')
result.extend([ os.path.join(root, f) for f in files if is_test_name(f) ])
result.sort()
return result


def main(argv=None):
@@ -186,6 +189,9 @@ def main(argv=None):
if os.path.isdir(arg):
tests.extend(find_all_gyptest_files(os.path.normpath(arg)))
else:
if not is_test_name(os.path.basename(arg)):
print >>sys.stderr, arg, 'is not a valid gyp test name.'
sys.exit(1)
tests.append(arg)

if opts.list:
@@ -210,6 +216,7 @@ def main(argv=None):
else:
# TODO: not duplicate this mapping from pylib/gyp/__init__.py
format_list = {
'aix5': ['make'],
'freebsd7': ['make'],
'freebsd8': ['make'],
'openbsd5': ['make'],
@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

"""New implementation of Visual Studio project generation for SCons."""
"""New implementation of Visual Studio project generation."""

import os
import random
@@ -325,14 +325,15 @@ def Write(self, writer=gyp.common.WriteOnDiff):
f.write('\tEndGlobalSection\r\n')

# Folder mappings
# TODO(rspangler): Should omit this section if there are no folders
f.write('\tGlobalSection(NestedProjects) = preSolution\r\n')
for e in all_entries:
if not isinstance(e, MSVSFolder):
continue # Does not apply to projects, only folders
for subentry in e.entries:
f.write('\t\t%s = %s\r\n' % (subentry.get_guid(), e.get_guid()))
f.write('\tEndGlobalSection\r\n')
# Omit this section if there are no folders
if any([e.entries for e in all_entries if isinstance(e, MSVSFolder)]):
f.write('\tGlobalSection(NestedProjects) = preSolution\r\n')
for e in all_entries:
if not isinstance(e, MSVSFolder):
continue # Does not apply to projects, only folders
for subentry in e.entries:
f.write('\t\t%s = %s\r\n' % (subentry.get_guid(), e.get_guid()))
f.write('\tEndGlobalSection\r\n')

f.write('EndGlobal\r\n')

@@ -834,8 +834,13 @@ def _ValidateSettings(validators, settings, stderr):
# MSVS options not found in MSBuild.
_MSVSOnly(_link, 'OptimizeForWindows98', _newly_boolean)
_MSVSOnly(_link, 'UseUnicodeResponseFiles', _boolean)
# TODO(jeanluc) I don't think these are genuine settings but byproducts of Gyp.
# These settings generate correctly in the MSVS output files when using
# e.g. DelayLoadDLLs! or AdditionalDependencies! to exclude files from
# configuration entries, but result in spurious artifacts which can be
# safely ignored here. See crbug.com/246570
_MSVSOnly(_link, 'AdditionalLibraryDirectories_excluded', _folder_list)
_MSVSOnly(_link, 'DelayLoadDLLs_excluded', _file_list)
_MSVSOnly(_link, 'AdditionalDependencies_excluded', _file_list)

# MSBuild options not found in MSVS.
_MSBuildOnly(_link, 'BuildingInIDE', _boolean)