Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
gyp: upgrade to r1103
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoordhuis committed Dec 3, 2011
1 parent 49ba55b commit e90623e
Show file tree
Hide file tree
Showing 527 changed files with 20,547 additions and 334 deletions.
10 changes: 10 additions & 0 deletions tools/gyp/PRESUBMIT.py 100755 → 100644
Expand Up @@ -34,6 +34,16 @@ def CheckChangeOnCommit(input_api, output_api):
input_api, output_api,
'http://gyp-status.appspot.com/status',
'http://gyp-status.appspot.com/current'))

import sys
old_sys_path = sys.path
try:
sys.path = ['pylib', 'test/lib'] + sys.path
report.extend(input_api.canned_checks.RunPylint(
input_api,
output_api))
finally:
sys.path = old_sys_path
return report


Expand Down
2 changes: 1 addition & 1 deletion tools/gyp/buildbot/buildbot_run.py
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
# Copyright (c) 2011 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.
Expand Down
8 changes: 3 additions & 5 deletions tools/gyp/pylib/gyp/MSVSNew.py
@@ -1,6 +1,4 @@
#!/usr/bin/python2.4

# Copyright (c) 2009 Google Inc. All rights reserved.
# Copyright (c) 2011 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.

Expand Down Expand Up @@ -62,7 +60,7 @@ def MakeGuid(name, seed='msvs_new'):
#------------------------------------------------------------------------------


class MSVSFolder:
class MSVSFolder(object):
"""Folder in a Visual Studio project or solution."""

def __init__(self, path, name = None, entries = None,
Expand Down Expand Up @@ -103,7 +101,7 @@ def get_guid(self):
#------------------------------------------------------------------------------


class MSVSProject:
class MSVSProject(object):
"""Visual Studio project."""

def __init__(self, path, name = None, dependencies = None, guid = None,
Expand Down
6 changes: 1 addition & 5 deletions tools/gyp/pylib/gyp/MSVSProject.py
@@ -1,6 +1,4 @@
#!/usr/bin/python2.4

# Copyright (c) 2009 Google Inc. All rights reserved.
# Copyright (c) 2011 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.

Expand Down Expand Up @@ -208,5 +206,3 @@ def WriteIfChanged(self):
]
easy_xml.WriteXmlIfChanged(content, self.project_path,
encoding="Windows-1252")

#------------------------------------------------------------------------------
1 change: 0 additions & 1 deletion tools/gyp/pylib/gyp/MSVSSettings.py
@@ -1,4 +1,3 @@
#!/usr/bin/python
# Copyright (c) 2011 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.
Expand Down
3 changes: 2 additions & 1 deletion tools/gyp/pylib/gyp/MSVSSettings_test.py 100644 → 100755
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python

# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
Expand Down Expand Up @@ -1476,5 +1476,6 @@ def testConvertToMSBuildSettings_actual(self):
self.assertEqual(expected_msbuild_settings, actual_msbuild_settings)
self._ExpectedWarnings([])


if __name__ == '__main__':
unittest.main()
2 changes: 0 additions & 2 deletions tools/gyp/pylib/gyp/MSVSToolFile.py
@@ -1,5 +1,3 @@
#!/usr/bin/python2.4

# 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.
Expand Down
2 changes: 0 additions & 2 deletions tools/gyp/pylib/gyp/MSVSUserFile.py
@@ -1,5 +1,3 @@
#!/usr/bin/python2.4

# 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.
Expand Down
6 changes: 4 additions & 2 deletions tools/gyp/pylib/gyp/MSVSVersion.py 100755 → 100644
@@ -1,4 +1,3 @@
#!/usr/bin/python
# Copyright (c) 2011 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.
Expand All @@ -12,7 +11,7 @@
import sys


class VisualStudioVersion:
class VisualStudioVersion(object):
"""Information regarding a version of Visual Studio."""

def __init__(self, short_name, description,
Expand Down Expand Up @@ -80,6 +79,7 @@ def _RegistryQueryBase(sysdir, key, value):
return None
return text


def _RegistryQuery(key, value=None):
"""Use reg.exe to read a particular key through _RegistryQueryBase.
Expand Down Expand Up @@ -107,6 +107,7 @@ def _RegistryQuery(key, value=None):
raise
return text


def _RegistryGetValue(key, value):
"""Use reg.exe to obtain the value of a registry key.
Expand All @@ -125,6 +126,7 @@ def _RegistryGetValue(key, value):
return None
return match.group(1)


def _RegistryKeyExists(key):
"""Use reg.exe to see if a key exists.
Expand Down
5 changes: 2 additions & 3 deletions tools/gyp/pylib/gyp/SCons.py
@@ -1,6 +1,4 @@
#!/usr/bin/env python

# Copyright (c) 2009 Google Inc. All rights reserved.
# Copyright (c) 2011 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.

Expand Down Expand Up @@ -196,5 +194,6 @@ class LoadableModuleTarget(CompilableSourcesTargetBase):
'loadable_module' : LoadableModuleTarget,
}


def Target(spec):
return TargetMap[spec.get('type')](spec)
36 changes: 21 additions & 15 deletions tools/gyp/pylib/gyp/__init__.py 100644 → 100755
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python

# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
Expand All @@ -11,6 +11,7 @@
import re
import shlex
import sys
import traceback

# Default debug modes for GYP
debug = {}
Expand All @@ -20,9 +21,18 @@
DEBUG_VARIABLES = 'variables'
DEBUG_INCLUDES = 'includes'


def DebugOutput(mode, message):
if mode in gyp.debug.keys():
print "%s: %s" % (mode.upper(), message)
if 'all' in gyp.debug.keys() or mode in gyp.debug.keys():
ctx = ('unknown', 0, 'unknown')
try:
f = traceback.extract_stack(limit=2)
if f:
ctx = f[0][:3]
except:
pass
print '%s:%s:%d:%s %s' % (mode.upper(), os.path.basename(ctx[0]),
ctx[1], ctx[2], message)

def FindBuildFiles():
extension = '.gyp'
Expand Down Expand Up @@ -266,8 +276,8 @@ def main(args):
help='set DEPTH gyp variable to a relative path to PATH')
parser.add_option('-d', '--debug', dest='debug', metavar='DEBUGMODE',
action='append', default=[], help='turn on a debugging '
'mode for debugging GYP. Supported modes are "variables" '
'and "general"')
'mode for debugging GYP. Supported modes are "variables", '
'"includes" and "general" or "all" for all of them.')
parser.add_option('-S', '--suffix', dest='suffix', default='',
help='suffix to add to generated files')
parser.add_option('-G', dest='generator_flags', action='append', default=[],
Expand Down Expand Up @@ -327,16 +337,12 @@ def main(args):
options.formats = generate_formats
else:
# Nothing in the variable, default based on platform.
options.formats = [ {'darwin': 'xcode',
'win32': 'msvs',
'cygwin': 'msvs',
'freebsd7': 'make',
'freebsd8': 'make',
'linux2': 'make',
'linux3': 'make',
'openbsd4': 'make',
'openbsd5': 'make',
'sunos5': 'make',}[sys.platform] ]
if sys.platform == 'darwin':
options.formats = ['xcode']
elif sys.platform in ('win32', 'cygwin'):
options.formats = ['msvs']
else:
options.formats = ['make']

if not options.generator_output and options.use_environment:
g_o = os.environ.get('GYP_GENERATOR_OUTPUT')
Expand Down
4 changes: 1 addition & 3 deletions tools/gyp/pylib/gyp/common.py
@@ -1,6 +1,4 @@
#!/usr/bin/python

# Copyright (c) 2009 Google Inc. All rights reserved.
# Copyright (c) 2011 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.

Expand Down
2 changes: 0 additions & 2 deletions tools/gyp/pylib/gyp/easy_xml.py
@@ -1,5 +1,3 @@
#!/usr/bin/python

# Copyright (c) 2011 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.
Expand Down
2 changes: 1 addition & 1 deletion tools/gyp/pylib/gyp/easy_xml_test.py 100644 → 100755
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python

# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
Expand Down
20 changes: 15 additions & 5 deletions tools/gyp/pylib/gyp/generator/dump_dependency_json.py
@@ -1,5 +1,3 @@
#!/usr/bin/python

# Copyright (c) 2011 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.
Expand All @@ -8,28 +6,40 @@
import gyp
import gyp.common
import json
import sys

generator_wants_static_library_dependencies_adjusted = False

generator_default_variables = {
'OS': 'linux',
}
for dirname in ['INTERMEDIATE_DIR', 'SHARED_INTERMEDIATE_DIR', 'PRODUCT_DIR',
'LIB_DIR', 'SHARED_LIB_DIR']:
# Some gyp steps fail if these are empty(!).
generator_default_variables[dirname] = 'dir'
for unused in ['RULE_INPUT_PATH', 'RULE_INPUT_ROOT', 'RULE_INPUT_NAME',
'RULE_INPUT_EXT',
'RULE_INPUT_DIRNAME', 'RULE_INPUT_EXT',
'EXECUTABLE_PREFIX', 'EXECUTABLE_SUFFIX',
'STATIC_LIB_PREFIX', 'STATIC_LIB_SUFFIX',
'SHARED_LIB_PREFIX', 'SHARED_LIB_SUFFIX',
'LINKER_SUPPORTS_ICF']:
generator_default_variables[unused] = ''


def GetFlavor(params):
"""Returns |params.flavor| if it's set, the system's default flavor else."""
flavors = {
'darwin': 'mac',
'sunos5': 'solaris',
'freebsd7': 'freebsd',
'freebsd8': 'freebsd',
}
flavor = flavors.get(sys.platform, 'linux')
return params.get('flavor', flavor)


def CalculateVariables(default_variables, params):
generator_flags = params.get('generator_flags', {})
default_variables['OS'] = generator_flags.get('os', 'linux')
default_variables['OS'] = generator_flags.get('os', GetFlavor(params))


def CalculateGeneratorInputInfo(params):
Expand Down
2 changes: 0 additions & 2 deletions tools/gyp/pylib/gyp/generator/gypd.py
@@ -1,5 +1,3 @@
#!/usr/bin/python

# Copyright (c) 2011 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.
Expand Down
2 changes: 0 additions & 2 deletions tools/gyp/pylib/gyp/generator/gypsh.py
@@ -1,5 +1,3 @@
#!/usr/bin/python

# Copyright (c) 2011 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.
Expand Down

0 comments on commit e90623e

Please sign in to comment.