🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

node-gyp

Package Overview
Dependencies
Maintainers
3
Versions
161
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-gyp - npm Package Compare versions

Comparing version
11.4.1
to
11.4.2
+1
-1
.release-please-manifest.json
{
".": "11.4.1"
".": "11.4.2"
}
{
".": "0.20.2"
".": "0.20.4"
}

@@ -28,11 +28,12 @@ #!/usr/bin/env python3

def EscapeForCString(string: bytes | str) -> str:
if isinstance(string, str):
string = string.encode(encoding='utf8')
string = string.encode(encoding="utf8")
backslash_or_double_quote = {ord('\\'), ord('"')}
result = ''
backslash_or_double_quote = {ord("\\"), ord('"')}
result = ""
for char in string:
if char in backslash_or_double_quote or not 32 <= char < 127:
result += '\\%03o' % char
result += "\\%03o" % char
else:

@@ -42,2 +43,3 @@ result += chr(char)

def DebugOutput(mode, message, *args):

@@ -81,7 +83,7 @@ if "all" in gyp.debug or mode in gyp.debug:

"""
Loads one or more specified build files.
default_variables and includes will be copied before use.
Returns the generator for the specified format and the
data returned by loading the specified build files.
"""
Loads one or more specified build files.
default_variables and includes will be copied before use.
Returns the generator for the specified format and the
data returned by loading the specified build files.
"""
if params is None:

@@ -120,3 +122,3 @@ params = {}

generator = __import__(generator_name, globals(), locals(), generator_name)
for (key, val) in generator.generator_default_variables.items():
for key, val in generator.generator_default_variables.items():
default_variables.setdefault(key, val)

@@ -191,6 +193,6 @@

"""
Takes an array of strings of the form 'NAME=VALUE' and creates a dictionary
of the pairs. If a string is simply NAME, then the value in the dictionary
is set to True. If VALUE can be converted to an integer, it is.
"""
Takes an array of strings of the form 'NAME=VALUE' and creates a dictionary
of the pairs. If a string is simply NAME, then the value in the dictionary
is set to True. If VALUE can be converted to an integer, it is.
"""
result = {}

@@ -228,9 +230,9 @@ for item in name_value_list:

The |env_name|, if given, is checked in the environment and used to generate
an initial list of options, then the options that were specified on the
command line (given in |values|) are appended. This matches the handling of
environment variables and command line flags where command line flags override
the environment, while not requiring the environment to be set when the flags
are used again.
"""
The |env_name|, if given, is checked in the environment and used to generate
an initial list of options, then the options that were specified on the
command line (given in |values|) are appended. This matches the handling of
environment variables and command line flags where command line flags override
the environment, while not requiring the environment to be set when the flags
are used again.
"""
flags = []

@@ -251,10 +253,10 @@ if options.use_environment and env_name:

"""Given a parsed options object, and taking the environment variables into
account, returns a list of flags that should regenerate an equivalent options
object (even in the absence of the environment variables.)
account, returns a list of flags that should regenerate an equivalent options
object (even in the absence of the environment variables.)
Any path options will be normalized relative to depth.
Any path options will be normalized relative to depth.
The format flag is not included, as it is assumed the calling generator will
set that as appropriate.
"""
The format flag is not included, as it is assumed the calling generator will
set that as appropriate.
"""

@@ -317,11 +319,11 @@ def FixPath(path):

This accepts the same arguments as ArgumentParser.add_argument, plus the
following:
regenerate: can be set to False to prevent this option from being included
in regeneration.
env_name: name of environment variable that additional values for this
option come from.
type: adds type='path', to tell the regenerator that the values of
this option need to be made relative to options.depth
"""
This accepts the same arguments as ArgumentParser.add_argument, plus the
following:
regenerate: can be set to False to prevent this option from being included
in regeneration.
env_name: name of environment variable that additional values for this
option come from.
type: adds type='path', to tell the regenerator that the values of
this option need to be made relative to options.depth
"""
env_name = kw.pop("env_name", None)

@@ -354,3 +356,3 @@ if "dest" in kw and kw.pop("regenerate", True):

my_name = os.path.basename(sys.argv[0])
usage = "usage: %(prog)s [options ...] [build_file ...]"
usage = "%(prog)s [options ...] [build_file ...]"

@@ -502,2 +504,3 @@ parser = RegeneratableOptionParser(usage=usage.replace("%s", "%(prog)s"))

import pkg_resources # noqa: PLC0415
print(f"v{pkg_resources.get_distribution('gyp-next').version}")

@@ -504,0 +507,0 @@ return 0

@@ -31,4 +31,8 @@ #!/usr/bin/env python3

assert gyp.common.TopologicallySorted(
graph.keys(), GetEdge) == ["a", "c", "d", "b"]
assert gyp.common.TopologicallySorted(graph.keys(), GetEdge) == [
"a",
"c",
"d",
"b",
]

@@ -101,6 +105,3 @@ def test_Cycle(self):

returncode=1,
cmd=[
*expected_cmd,
"-dM", "-E", "-x", "c", expected_input
]
cmd=[*expected_cmd, "-dM", "-E", "-x", "c", expected_input],
)

@@ -120,11 +121,10 @@ else:

mock_run.assert_called_with(
[
*expected_cmd,
"-dM", "-E", "-x", "c", expected_input
],
[*expected_cmd, "-dM", "-E", "-x", "c", expected_input],
shell=sys.platform == "win32",
capture_output=True, check=True)
capture_output=True,
check=True,
)
return [defines, flavor]
[defines0, _] = mock_run({ "CC": "cl.exe" }, "", ["cl.exe"], True)
[defines0, _] = mock_run({"CC": "cl.exe"}, "", ["cl.exe"], True)
assert defines0 == {}

@@ -136,23 +136,23 @@

[defines2, flavor2] = mock_run(
{ "CC_target": "/opt/wasi-sdk/bin/clang" },
{"CC_target": "/opt/wasi-sdk/bin/clang"},
"#define __wasm__ 1\n#define __wasi__ 1\n",
["/opt/wasi-sdk/bin/clang"]
["/opt/wasi-sdk/bin/clang"],
)
assert defines2 == { "__wasm__": "1", "__wasi__": "1" }
assert defines2 == {"__wasm__": "1", "__wasi__": "1"}
assert flavor2 == "wasi"
[defines3, flavor3] = mock_run(
{ "CC_target": "/opt/wasi-sdk/bin/clang --target=wasm32" },
{"CC_target": "/opt/wasi-sdk/bin/clang --target=wasm32"},
"#define __wasm__ 1\n",
["/opt/wasi-sdk/bin/clang", "--target=wasm32"]
["/opt/wasi-sdk/bin/clang", "--target=wasm32"],
)
assert defines3 == { "__wasm__": "1" }
assert defines3 == {"__wasm__": "1"}
assert flavor3 == "wasm"
[defines4, flavor4] = mock_run(
{ "CC_target": "/emsdk/upstream/emscripten/emcc" },
{"CC_target": "/emsdk/upstream/emscripten/emcc"},
"#define __EMSCRIPTEN__ 1\n",
["/emsdk/upstream/emscripten/emcc"]
["/emsdk/upstream/emscripten/emcc"],
)
assert defines4 == { "__EMSCRIPTEN__": "1" }
assert defines4 == {"__EMSCRIPTEN__": "1"}
assert flavor4 == "emscripten"

@@ -163,4 +163,4 @@

{
"CC_target": "\"/Users/Toyo Li/wasi-sdk/bin/clang\" -O3",
"CFLAGS": "--target=wasm32-wasi-threads -pthread"
"CC_target": '"/Users/Toyo Li/wasi-sdk/bin/clang" -O3',
"CFLAGS": "--target=wasm32-wasi-threads -pthread",
},

@@ -172,10 +172,6 @@ "#define __wasm__ 1\n#define __wasi__ 1\n#define _REENTRANT 1\n",

"--target=wasm32-wasi-threads",
"-pthread"
]
"-pthread",
],
)
assert defines5 == {
"__wasm__": "1",
"__wasi__": "1",
"_REENTRANT": "1"
}
assert defines5 == {"__wasm__": "1", "__wasi__": "1", "_REENTRANT": "1"}
assert flavor5 == "wasi"

@@ -186,11 +182,12 @@

[defines6, flavor6] = mock_run(
{ "CC_target": "\"C:\\Program Files\\wasi-sdk\\clang.exe\"" },
{"CC_target": '"C:\\Program Files\\wasi-sdk\\clang.exe"'},
"#define __wasm__ 1\n#define __wasi__ 1\n",
["C:/Program Files/wasi-sdk/clang.exe"]
["C:/Program Files/wasi-sdk/clang.exe"],
)
os.sep = original_sep
assert defines6 == { "__wasm__": "1", "__wasi__": "1" }
assert defines6 == {"__wasm__": "1", "__wasi__": "1"}
assert flavor6 == "wasi"
if __name__ == "__main__":
unittest.main()

@@ -34,7 +34,6 @@ # Copyright (c) 2012 Google Inc. All rights reserved.

"""Error class representing an error, which is to be presented
to the user. The main entry point will catch and display this.
"""
to the user. The main entry point will catch and display this.
"""
def ExceptionAppend(e, msg):

@@ -52,5 +51,5 @@ """Append a message to the given exception's message."""

"""
Given a list of qualified targets, return the qualified targets for the
specified |target|.
"""
Given a list of qualified targets, return the qualified targets for the
specified |target|.
"""
return [t for t in qualified_list if ParseQualifiedTarget(t)[1] == target]

@@ -120,3 +119,3 @@

"""Look up a key in the environment, with fallback to secondary keys
and finally falling back to a default value."""
and finally falling back to a default value."""
for var in var_list:

@@ -184,7 +183,7 @@ if var in os.environ:

"""Given a path like foo/bar that is relative to toplevel_dir, return
the inverse relative path back to the toplevel_dir.
the inverse relative path back to the toplevel_dir.
E.g. os.path.normpath(os.path.join(path, InvertRelativePath(path)))
should always produce the empty string, unless the path contains symlinks.
"""
E.g. os.path.normpath(os.path.join(path, InvertRelativePath(path)))
should always produce the empty string, unless the path contains symlinks.
"""
if not path:

@@ -269,8 +268,8 @@ return path

argument may be quoted and escaped as necessary to ensure that POSIX shells
treat the returned value as a literal representing the argument passed to
this function. Parameter (variable) expansions beginning with $ are allowed
to remain intact without escaping the $, to allow the argument to contain
references to variables to be expanded by the shell.
"""
argument may be quoted and escaped as necessary to ensure that POSIX shells
treat the returned value as a literal representing the argument passed to
this function. Parameter (variable) expansions beginning with $ are allowed
to remain intact without escaping the $, to allow the argument to contain
references to variables to be expanded by the shell.
"""

@@ -290,5 +289,5 @@ if not isinstance(argument, str):

Returns EncodePOSIXShellArgument for each item in list, and joins them
together using the space character as an argument separator.
"""
Returns EncodePOSIXShellArgument for each item in list, and joins them
together using the space character as an argument separator.
"""

@@ -321,4 +320,3 @@ encoded_arguments = []

def BuildFileTargets(target_list, build_file):
"""From a target_list, returns the subset from the specified build_file.
"""
"""From a target_list, returns the subset from the specified build_file."""
return [p for p in target_list if BuildFile(p) == build_file]

@@ -328,4 +326,3 @@

def AllTargets(target_list, target_dicts, build_file):
"""Returns all targets (direct and dependencies) for the specified build_file.
"""
"""Returns all targets (direct and dependencies) for the specified build_file."""
bftargets = BuildFileTargets(target_list, build_file)

@@ -339,8 +336,8 @@ deptargets = DeepDependencyTargets(target_dicts, bftargets)

Arguments:
filename: name of the file to potentially write to.
Returns:
A file like object which will write to temporary file and only overwrite
the target if it differs (on close).
"""
Arguments:
filename: name of the file to potentially write to.
Returns:
A file like object which will write to temporary file and only overwrite
the target if it differs (on close).
"""

@@ -433,2 +430,3 @@ class Writer:

def GetCompilerPredefines(): # -> dict

@@ -461,4 +459,3 @@ cmd = []

stdout = subprocess.run(
real_cmd, shell=True,
capture_output=True, check=True
real_cmd, shell=True, capture_output=True, check=True
).stdout

@@ -470,3 +467,3 @@ except subprocess.CalledProcessError as e:

"status: %d" % (e.cmd, e.returncode),
file=sys.stderr
file=sys.stderr,
)

@@ -481,4 +478,3 @@ return defines

stdout = subprocess.run(
real_cmd, shell=False,
capture_output=True, check=True
real_cmd, shell=False, capture_output=True, check=True
).stdout

@@ -490,3 +486,3 @@ except subprocess.CalledProcessError as e:

"status: %d" % (e.cmd, e.returncode),
file=sys.stderr
file=sys.stderr,
)

@@ -502,2 +498,3 @@ return defines

def GetFlavorByPlatform():

@@ -530,2 +527,3 @@ """Returns |params.flavor| if it's set, the system's default flavor else."""

def GetFlavor(params):

@@ -546,3 +544,3 @@ if "flavor" in params:

"""Finds (flock|mac|win)_tool.gyp in the gyp directory and copies it
to |out_path|."""
to |out_path|."""
# aix and solaris just need flock emulation. mac and win use more complicated

@@ -682,20 +680,20 @@ # support scripts.

Args:
graph: A list of node names.
get_edges: A function mapping from node name to a hashable collection
of node names which this node has outgoing edges to.
Returns:
A list containing all of the node in graph in topological order.
It is assumed that calling get_edges once for each node and caching is
cheaper than repeatedly calling get_edges.
Raises:
CycleError in the event of a cycle.
Example:
graph = {'a': '$(b) $(c)', 'b': 'hi', 'c': '$(b)'}
def GetEdges(node):
return re.findall(r'\$\(([^))]\)', graph[node])
print TopologicallySorted(graph.keys(), GetEdges)
==>
['a', 'c', b']
"""
Args:
graph: A list of node names.
get_edges: A function mapping from node name to a hashable collection
of node names which this node has outgoing edges to.
Returns:
A list containing all of the node in graph in topological order.
It is assumed that calling get_edges once for each node and caching is
cheaper than repeatedly calling get_edges.
Raises:
CycleError in the event of a cycle.
Example:
graph = {'a': '$(b) $(c)', 'b': 'hi', 'c': '$(b)'}
def GetEdges(node):
return re.findall(r'\$\(([^))]\)', graph[node])
print TopologicallySorted(graph.keys(), GetEdges)
==>
['a', 'c', b']
"""
get_edges = memoize(get_edges)

@@ -702,0 +700,0 @@ visited = set()

@@ -7,3 +7,3 @@ #!/usr/bin/env python3

""" Unit tests for the easy_xml.py file. """
"""Unit tests for the easy_xml.py file."""

@@ -10,0 +10,0 @@ import unittest

@@ -13,39 +13,39 @@ # Copyright (c) 2011 Google Inc. All rights reserved.

def XmlToString(content, encoding="utf-8", pretty=False):
""" Writes the XML content to disk, touching the file only if it has changed.
"""Writes the XML content to disk, touching the file only if it has changed.
Visual Studio files have a lot of pre-defined structures. This function makes
it easy to represent these structures as Python data structures, instead of
having to create a lot of function calls.
Visual Studio files have a lot of pre-defined structures. This function makes
it easy to represent these structures as Python data structures, instead of
having to create a lot of function calls.
Each XML element of the content is represented as a list composed of:
1. The name of the element, a string,
2. The attributes of the element, a dictionary (optional), and
3+. The content of the element, if any. Strings are simple text nodes and
lists are child elements.
Each XML element of the content is represented as a list composed of:
1. The name of the element, a string,
2. The attributes of the element, a dictionary (optional), and
3+. The content of the element, if any. Strings are simple text nodes and
lists are child elements.
Example 1:
<test/>
becomes
['test']
Example 1:
<test/>
becomes
['test']
Example 2:
<myelement a='value1' b='value2'>
<childtype>This is</childtype>
<childtype>it!</childtype>
</myelement>
Example 2:
<myelement a='value1' b='value2'>
<childtype>This is</childtype>
<childtype>it!</childtype>
</myelement>
becomes
['myelement', {'a':'value1', 'b':'value2'},
['childtype', 'This is'],
['childtype', 'it!'],
]
becomes
['myelement', {'a':'value1', 'b':'value2'},
['childtype', 'This is'],
['childtype', 'it!'],
]
Args:
content: The structured content to be converted.
encoding: The encoding to report on the first XML line.
pretty: True if we want pretty printing with indents and new lines.
Args:
content: The structured content to be converted.
encoding: The encoding to report on the first XML line.
pretty: True if we want pretty printing with indents and new lines.
Returns:
The XML content as a string.
"""
Returns:
The XML content as a string.
"""
# We create a huge list of all the elements of the file.

@@ -62,10 +62,10 @@ xml_parts = ['<?xml version="1.0" encoding="%s"?>' % encoding]

def _ConstructContentList(xml_parts, specification, pretty, level=0):
""" Appends the XML parts corresponding to the specification.
"""Appends the XML parts corresponding to the specification.
Args:
xml_parts: A list of XML parts to be appended to.
specification: The specification of the element. See EasyXml docs.
pretty: True if we want pretty printing with indents and new lines.
level: Indentation level.
"""
Args:
xml_parts: A list of XML parts to be appended to.
specification: The specification of the element. See EasyXml docs.
pretty: True if we want pretty printing with indents and new lines.
level: Indentation level.
"""
# The first item in a specification is the name of the element.

@@ -112,12 +112,13 @@ if pretty:

def WriteXmlIfChanged(content, path, encoding="utf-8", pretty=False,
win32=(sys.platform == "win32")):
""" Writes the XML content to disk, touching the file only if it has changed.
def WriteXmlIfChanged(
content, path, encoding="utf-8", pretty=False, win32=(sys.platform == "win32")
):
"""Writes the XML content to disk, touching the file only if it has changed.
Args:
content: The structured content to be written.
path: Location of the file.
encoding: The encoding to report on the first line of the XML file.
pretty: True if we want pretty printing with indents and new lines.
"""
Args:
content: The structured content to be written.
path: Location of the file.
encoding: The encoding to report on the first line of the XML file.
pretty: True if we want pretty printing with indents and new lines.
"""
xml_string = XmlToString(content, encoding, pretty)

@@ -163,3 +164,3 @@ if win32 and os.linesep != "\r\n":

def _XmlEscape(value, attr=False):
""" Escape a string for inclusion in XML."""
"""Escape a string for inclusion in XML."""

@@ -166,0 +167,0 @@ def replace(match):

@@ -65,3 +65,2 @@ # Copyright (c) 2014 Google Inc. All rights reserved.

import json

@@ -134,4 +133,4 @@ import os

"""Resolves |path|, which starts with at least one '../'. Returns an empty
string if the path shouldn't be considered. See _AddSources() for a
description of |base_path_components|."""
string if the path shouldn't be considered. See _AddSources() for a
description of |base_path_components|."""
depth = 0

@@ -156,7 +155,7 @@ while path.startswith("../"):

"""Extracts valid sources from |sources| and adds them to |result|. Each
source file is relative to |base_path|, but may contain '..'. To make
resolving '..' easier |base_path_components| contains each of the
directories in |base_path|. Additionally each source may contain variables.
Such sources are ignored as it is assumed dependencies on them are expressed
and tracked in some other means."""
source file is relative to |base_path|, but may contain '..'. To make
resolving '..' easier |base_path_components| contains each of the
directories in |base_path|. Additionally each source may contain variables.
Such sources are ignored as it is assumed dependencies on them are expressed
and tracked in some other means."""
# NOTE: gyp paths are always posix style.

@@ -224,19 +223,19 @@ for source in sources:

"""Holds information about a particular target:
deps: set of Targets this Target depends upon. This is not recursive, only the
direct dependent Targets.
match_status: one of the MatchStatus values.
back_deps: set of Targets that have a dependency on this Target.
visited: used during iteration to indicate whether we've visited this target.
This is used for two iterations, once in building the set of Targets and
again in _GetBuildTargets().
name: fully qualified name of the target.
requires_build: True if the target type is such that it needs to be built.
See _DoesTargetTypeRequireBuild for details.
added_to_compile_targets: used when determining if the target was added to the
set of targets that needs to be built.
in_roots: true if this target is a descendant of one of the root nodes.
is_executable: true if the type of target is executable.
is_static_library: true if the type of target is static_library.
is_or_has_linked_ancestor: true if the target does a link (eg executable), or
if there is a target in back_deps that does a link."""
deps: set of Targets this Target depends upon. This is not recursive, only the
direct dependent Targets.
match_status: one of the MatchStatus values.
back_deps: set of Targets that have a dependency on this Target.
visited: used during iteration to indicate whether we've visited this target.
This is used for two iterations, once in building the set of Targets and
again in _GetBuildTargets().
name: fully qualified name of the target.
requires_build: True if the target type is such that it needs to be built.
See _DoesTargetTypeRequireBuild for details.
added_to_compile_targets: used when determining if the target was added to the
set of targets that needs to be built.
in_roots: true if this target is a descendant of one of the root nodes.
is_executable: true if the type of target is executable.
is_static_library: true if the type of target is static_library.
is_or_has_linked_ancestor: true if the target does a link (eg executable), or
if there is a target in back_deps that does a link."""

@@ -261,4 +260,4 @@ def __init__(self, name):

"""Details what we're looking for
files: set of files to search for
targets: see file description for details."""
files: set of files to search for
targets: see file description for details."""

@@ -273,3 +272,3 @@ def __init__(self):

"""Initializes Config. This is a separate method as it raises an exception
if there is a parse error."""
if there is a parse error."""
generator_flags = params.get("generator_flags", {})

@@ -298,4 +297,4 @@ config_path = generator_flags.get("config_path", None)

"""Returns true if the build file |build_file| is either in |files| or
one of the files included by |build_file| is in |files|. |toplevel_dir| is
the root of the source tree."""
one of the files included by |build_file| is in |files|. |toplevel_dir| is
the root of the source tree."""
if _ToLocalPath(toplevel_dir, _ToGypPath(build_file)) in files:

@@ -329,4 +328,4 @@ if debug:

"""Creates or returns the Target at targets[target_name]. If there is no
Target for |target_name| one is created. Returns a tuple of whether a new
Target was created and the Target."""
Target for |target_name| one is created. Returns a tuple of whether a new
Target was created and the Target."""
if target_name in targets:

@@ -351,9 +350,9 @@ return False, targets[target_name]

"""Returns a tuple of the following:
. A dictionary mapping from fully qualified name to Target.
. A list of the targets that have a source file in |files|.
. Targets that constitute the 'all' target. See description at top of file
for details on the 'all' target.
This sets the |match_status| of the targets that contain any of the source
files in |files| to MATCH_STATUS_MATCHES.
|toplevel_dir| is the root of the source tree."""
. A dictionary mapping from fully qualified name to Target.
. A list of the targets that have a source file in |files|.
. Targets that constitute the 'all' target. See description at top of file
for details on the 'all' target.
This sets the |match_status| of the targets that contain any of the source
files in |files| to MATCH_STATUS_MATCHES.
|toplevel_dir| is the root of the source tree."""
# Maps from target name to Target.

@@ -391,5 +390,6 @@ name_to_target = {}

target.is_static_library = target_type == "static_library"
target.is_or_has_linked_ancestor = (
target_type in {"executable", "shared_library"}
)
target.is_or_has_linked_ancestor = target_type in {
"executable",
"shared_library",
}

@@ -440,5 +440,5 @@ build_file = gyp.common.ParseQualifiedTarget(target_name)[0]

"""Returns a tuple of the following:
. mapping (dictionary) from unqualified name to Target for all the
Targets in |to_find|.
. any target names not found. If this is empty all targets were found."""
. mapping (dictionary) from unqualified name to Target for all the
Targets in |to_find|.
. any target names not found. If this is empty all targets were found."""
result = {}

@@ -460,11 +460,11 @@ if not to_find:

"""Returns true if |target| or any of its dependencies is one of the
targets containing the files supplied as input to analyzer. This updates
|matches| of the Targets as it recurses.
target: the Target to look for."""
targets containing the files supplied as input to analyzer. This updates
|matches| of the Targets as it recurses.
target: the Target to look for."""
if target.match_status == MATCH_STATUS_DOESNT_MATCH:
return False
if (
target.match_status in {MATCH_STATUS_MATCHES,
MATCH_STATUS_MATCHES_BY_DEPENDENCY}
):
if target.match_status in {
MATCH_STATUS_MATCHES,
MATCH_STATUS_MATCHES_BY_DEPENDENCY,
}:
return True

@@ -482,5 +482,5 @@ for dep in target.deps:

"""Returns the list of Targets in |possible_targets| that depend (either
directly on indirectly) on at least one of the targets containing the files
supplied as input to analyzer.
possible_targets: targets to search from."""
directly on indirectly) on at least one of the targets containing the files
supplied as input to analyzer.
possible_targets: targets to search from."""
found = []

@@ -496,7 +496,7 @@ print("Targets that matched by dependency:")

"""Recurses through all targets that depend on |target|, adding all targets
that need to be built (and are in |roots|) to |result|.
roots: set of root targets.
add_if_no_ancestor: If true and there are no ancestors of |target| then add
|target| to |result|. |target| must still be in |roots|.
result: targets that need to be built are added here."""
that need to be built (and are in |roots|) to |result|.
roots: set of root targets.
add_if_no_ancestor: If true and there are no ancestors of |target| then add
|target| to |result|. |target| must still be in |roots|.
result: targets that need to be built are added here."""
if target.visited:

@@ -554,4 +554,4 @@ return

"""Returns the set of Targets that require a build.
matching_targets: targets that changed and need to be built.
supplied_targets: set of targets supplied to analyzer to search from."""
matching_targets: targets that changed and need to be built.
supplied_targets: set of targets supplied to analyzer to search from."""
result = set()

@@ -610,3 +610,3 @@ for target in matching_targets:

"""Returns true if one of the files in |files| is in the set of included
files."""
files."""
if params["options"].includes:

@@ -627,3 +627,3 @@ for include in params["options"].includes:

"""Returns a list of the mapping[name] for each value in |names| that is in
|mapping|."""
|mapping|."""
return [mapping[name] for name in names if name in mapping]

@@ -630,0 +630,0 @@

@@ -180,5 +180,3 @@ # Copyright (c) 2012 Google Inc. All rights reserved.

elif sdk_version > 0:
self.WriteLn(
"LOCAL_MODULE_TARGET_ARCH := $(TARGET_$(GYP_VAR_PREFIX)ARCH)"
)
self.WriteLn("LOCAL_MODULE_TARGET_ARCH := $(TARGET_$(GYP_VAR_PREFIX)ARCH)")
self.WriteLn("LOCAL_SDK_VERSION := %s" % sdk_version)

@@ -592,3 +590,4 @@

(root, ext) = os.path.splitext(source)
if ("$(gyp_shared_intermediate_dir)" in source
if (
"$(gyp_shared_intermediate_dir)" in source
or "$(gyp_intermediate_dir)" in source

@@ -739,4 +738,3 @@ or (IsCPPExtension(ext) and ext != local_cpp_extension)

"$(call intermediates-dir-for,%s,%s,true,,"
"$(GYP_HOST_VAR_PREFIX))"
% (self.android_class, self.android_module)
"$(GYP_HOST_VAR_PREFIX))" % (self.android_class, self.android_module)
)

@@ -1007,5 +1005,5 @@ else:

# so we don't look for a slash.
assert local_path.startswith(
"$(LOCAL_PATH)"
), f"Path {path} attempts to escape from gyp path {self.path} !)"
assert local_path.startswith("$(LOCAL_PATH)"), (
f"Path {path} attempts to escape from gyp path {self.path} !)"
)
return local_path

@@ -1052,5 +1050,5 @@

output_file = os.path.join(options.depth, base_path, base_name)
assert (
not options.generator_output
), "The Android backend does not support options.generator_output."
assert not options.generator_output, (
"The Android backend does not support options.generator_output."
)
base_path = gyp.common.RelativePath(

@@ -1075,5 +1073,5 @@ os.path.dirname(build_file), options.toplevel_dir

makefile_path = os.path.join(options.toplevel_dir, makefile_name)
assert (
not options.generator_output
), "The Android backend does not support options.generator_output."
assert not options.generator_output, (
"The Android backend does not support options.generator_output."
)
gyp.common.EnsureDirExists(makefile_path)

@@ -1080,0 +1078,0 @@ root_makefile = open(makefile_path, "w")

@@ -31,3 +31,2 @@ # Copyright (c) 2013 Google Inc. All rights reserved.

import multiprocessing

@@ -101,7 +100,7 @@ import os

If rel_path is an absolute path it is returned unchanged.
Otherwise it is resolved against base_path and normalized.
If the result is a relative path, it is forced to be relative to the
CMakeLists.txt.
"""
If rel_path is an absolute path it is returned unchanged.
Otherwise it is resolved against base_path and normalized.
If the result is a relative path, it is forced to be relative to the
CMakeLists.txt.
"""
if os.path.isabs(rel_path):

@@ -119,6 +118,6 @@ return rel_path

"""Resolves rel_path against base_path and returns the result.
TODO: what is this really used for?
If rel_path begins with '$' it is returned unchanged.
Otherwise it is resolved against base_path if relative, then normalized.
"""
TODO: what is this really used for?
If rel_path begins with '$' it is returned unchanged.
Otherwise it is resolved against base_path if relative, then normalized.
"""
if rel_path.startswith("$") and not rel_path.startswith("${configuration}"):

@@ -132,15 +131,15 @@ return rel_path

This means escaping
'\' otherwise it may be seen as modifying the next character
'"' otherwise it will end the string
';' otherwise the string becomes a list
This means escaping
'\' otherwise it may be seen as modifying the next character
'"' otherwise it will end the string
';' otherwise the string becomes a list
The following do not need to be escaped
'#' when the lexer is in string state, this does not start a comment
The following do not need to be escaped
'#' when the lexer is in string state, this does not start a comment
The following are yet unknown
'$' generator variables (like ${obj}) must not be escaped,
but text $ should be escaped
what is wanted is to know which $ come from generator variables
"""
The following are yet unknown
'$' generator variables (like ${obj}) must not be escaped,
but text $ should be escaped
what is wanted is to know which $ come from generator variables
"""
return a.replace("\\", "\\\\").replace(";", "\\;").replace('"', '\\"')

@@ -244,7 +243,7 @@

All invalid characters are replaced by '_'.
Invalid for cmake: ' ', '/', '(', ')', '"'
Invalid for make: ':'
Invalid for unknown reasons but cause failures: '.'
"""
All invalid characters are replaced by '_'.
Invalid for cmake: ' ', '/', '(', ')', '"'
Invalid for make: ':'
Invalid for unknown reasons but cause failures: '.'
"""
return a.translate(_maketrans(' /():."', "_______"))

@@ -256,10 +255,10 @@

Args:
target_name: the name of the CMake target being generated.
actions: the Gyp 'actions' dict for this target.
extra_sources: [(<cmake_src>, <src>)] to append with generated source files.
extra_deps: [<cmake_target>] to append with generated targets.
path_to_gyp: relative path from CMakeLists.txt being generated to
the Gyp file in which the target being generated is defined.
"""
Args:
target_name: the name of the CMake target being generated.
actions: the Gyp 'actions' dict for this target.
extra_sources: [(<cmake_src>, <src>)] to append with generated source files.
extra_deps: [<cmake_target>] to append with generated targets.
path_to_gyp: relative path from CMakeLists.txt being generated to
the Gyp file in which the target being generated is defined.
"""
for action in actions:

@@ -346,10 +345,10 @@ action_name = StringToCMakeTargetName(action["action_name"])

Args:
target_name: the name of the CMake target being generated.
actions: the Gyp 'actions' dict for this target.
extra_sources: [(<cmake_src>, <src>)] to append with generated source files.
extra_deps: [<cmake_target>] to append with generated targets.
path_to_gyp: relative path from CMakeLists.txt being generated to
the Gyp file in which the target being generated is defined.
"""
Args:
target_name: the name of the CMake target being generated.
actions: the Gyp 'actions' dict for this target.
extra_sources: [(<cmake_src>, <src>)] to append with generated source files.
extra_deps: [<cmake_target>] to append with generated targets.
path_to_gyp: relative path from CMakeLists.txt being generated to
the Gyp file in which the target being generated is defined.
"""
for rule in rules:

@@ -465,9 +464,9 @@ rule_name = StringToCMakeTargetName(target_name + "__" + rule["rule_name"])

Args:
target_name: the name of the CMake target being generated.
actions: the Gyp 'actions' dict for this target.
extra_deps: [<cmake_target>] to append with generated targets.
path_to_gyp: relative path from CMakeLists.txt being generated to
the Gyp file in which the target being generated is defined.
"""
Args:
target_name: the name of the CMake target being generated.
actions: the Gyp 'actions' dict for this target.
extra_deps: [<cmake_target>] to append with generated targets.
path_to_gyp: relative path from CMakeLists.txt being generated to
the Gyp file in which the target being generated is defined.
"""
copy_name = target_name + "__copies"

@@ -596,19 +595,19 @@

CMake requires that target names be globally unique. One way to ensure
this is to fully qualify the names of the targets. Unfortunately, this
ends up with all targets looking like "chrome_chrome_gyp_chrome" instead
of just "chrome". If this generator were only interested in building, it
would be possible to fully qualify all target names, then create
unqualified target names which depend on all qualified targets which
should have had that name. This is more or less what the 'make' generator
does with aliases. However, one goal of this generator is to create CMake
files for use with IDEs, and fully qualified names are not as user
friendly.
CMake requires that target names be globally unique. One way to ensure
this is to fully qualify the names of the targets. Unfortunately, this
ends up with all targets looking like "chrome_chrome_gyp_chrome" instead
of just "chrome". If this generator were only interested in building, it
would be possible to fully qualify all target names, then create
unqualified target names which depend on all qualified targets which
should have had that name. This is more or less what the 'make' generator
does with aliases. However, one goal of this generator is to create CMake
files for use with IDEs, and fully qualified names are not as user
friendly.
Since target name collision is rare, we do the above only when required.
Since target name collision is rare, we do the above only when required.
Toolset variants are always qualified from the base, as this is required for
building. However, it also makes sense for an IDE, as it is possible for
defines to be different.
"""
Toolset variants are always qualified from the base, as this is required for
building. However, it also makes sense for an IDE, as it is possible for
defines to be different.
"""

@@ -615,0 +614,0 @@ def __init__(self, target_list):

@@ -59,3 +59,3 @@ # Copyright (c) 2012 Google Inc. All rights reserved.

"""Calculate the generator specific info that gets fed to input (called by
gyp)."""
gyp)."""
generator_flags = params.get("generator_flags", {})

@@ -62,0 +62,0 @@ if generator_flags.get("adjust_static_libraries", False):

@@ -72,3 +72,3 @@ # Copyright (c) 2012 Google Inc. All rights reserved.

"""Calculate the generator specific info that gets fed to input (called by
gyp)."""
gyp)."""
generator_flags = params.get("generator_flags", {})

@@ -90,6 +90,6 @@ if generator_flags.get("adjust_static_libraries", False):

Returns:
A list including all the include_dir's specified for every target followed
by any include directories that were added as cflag compiler options.
"""
Returns:
A list including all the include_dir's specified for every target followed
by any include directories that were added as cflag compiler options.
"""

@@ -183,7 +183,7 @@ gyp_includes_set = set()

Returns:
If this is a gyp project that has explicit make settings, try to determine
the compiler from that. Otherwise, see if a compiler was specified via the
CC_target environment variable.
"""
Returns:
If this is a gyp project that has explicit make settings, try to determine
the compiler from that. Otherwise, see if a compiler was specified via the
CC_target environment variable.
"""
# First, see if the compiler is configured in make's settings.

@@ -208,6 +208,6 @@ build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0])

Returns:
A dict that includes explicit defines declared in gyp files along with all
of the default defines that the compiler uses.
"""
Returns:
A dict that includes explicit defines declared in gyp files along with all
of the default defines that the compiler uses.
"""

@@ -380,4 +380,4 @@ # Get defines declared in the gyp files.

"""Generates a classpath file suitable for symbol navigation and code
completion of Java code (such as in Android projects) by finding all
.java and .jar files used as action inputs."""
completion of Java code (such as in Android projects) by finding all
.java and .jar files used as action inputs."""
gyp.common.EnsureDirExists(out_name)

@@ -384,0 +384,0 @@ result = ET.Element("classpath")

@@ -33,3 +33,2 @@ # Copyright (c) 2011 Google Inc. All rights reserved.

import pprint

@@ -36,0 +35,0 @@

@@ -16,3 +16,2 @@ # Copyright (c) 2011 Google Inc. All rights reserved.

import code

@@ -19,0 +18,0 @@ import sys

@@ -6,3 +6,3 @@ #!/usr/bin/env python3

""" Unit tests for the msvs.py file. """
"""Unit tests for the msvs.py file."""

@@ -9,0 +9,0 @@ import unittest

@@ -7,3 +7,3 @@ #!/usr/bin/env python3

""" Unit tests for the ninja.py file. """
"""Unit tests for the ninja.py file."""

@@ -10,0 +10,0 @@ import sys

@@ -7,3 +7,3 @@ #!/usr/bin/env python3

""" Unit tests for the xcode.py file. """
"""Unit tests for the xcode.py file."""

@@ -10,0 +10,0 @@ import sys

@@ -11,3 +11,2 @@ #!/usr/bin/env python3

import fcntl

@@ -35,3 +34,3 @@ import fnmatch

"""This class performs all the Mac tooling steps. The methods can either be
executed directly, or dispatched from an argument list."""
executed directly, or dispatched from an argument list."""

@@ -52,3 +51,3 @@ def Dispatch(self, args):

"""Copies a resource file to the bundle/Resources directory, performing any
necessary compilation on each resource."""
necessary compilation on each resource."""
convert_to_binary = convert_to_binary == "True"

@@ -161,3 +160,3 @@ extension = os.path.splitext(source)[1].lower()

"""Reads the first few bytes from file_name and tries to guess the text
encoding. Returns None as a guess if it can't detect it."""
encoding. Returns None as a guess if it can't detect it."""
with open(file_name, "rb") as fp:

@@ -168,5 +167,5 @@ try:

return None
if header.startswith((b"\xFE\xFF", b"\xFF\xFE")):
if header.startswith((b"\xfe\xff", b"\xff\xfe")):
return "UTF-16"
elif header.startswith(b"\xEF\xBB\xBF"):
elif header.startswith(b"\xef\xbb\xbf"):
return "UTF-8"

@@ -262,3 +261,3 @@ else:

"""Calls libtool and filters out '/path/to/libtool: file: foo.o has no
symbols'."""
symbols'."""
libtool_re = re.compile(

@@ -312,3 +311,3 @@ r"^.*libtool: (?:for architecture: \S* )?file: .* has no symbols$"

"""Takes a path to Something.framework and the Current version of that and
sets up all the symlinks."""
sets up all the symlinks."""
# Find the name of the binary based on the part before the ".framework".

@@ -342,3 +341,3 @@ binary = os.path.basename(framework).split(".")[0]

"""Creates a symlink to |dest| named |link|. If |link| already exists,
it is overwritten."""
it is overwritten."""
if os.path.lexists(link):

@@ -368,10 +367,10 @@ os.remove(link)

This invokes 'actool' to compile all the inputs .xcassets files. The
|keys| arguments is a json-encoded dictionary of extra arguments to
pass to 'actool' when the asset catalogs contains an application icon
or a launch image.
This invokes 'actool' to compile all the inputs .xcassets files. The
|keys| arguments is a json-encoded dictionary of extra arguments to
pass to 'actool' when the asset catalogs contains an application icon
or a launch image.
Note that 'actool' does not create the Assets.car file if the asset
catalogs does not contains imageset.
"""
Note that 'actool' does not create the Assets.car file if the asset
catalogs does not contains imageset.
"""
command_line = [

@@ -449,9 +448,9 @@ "xcrun",

This function tries to code sign an iOS bundle, following the same
algorithm as Xcode:
1. pick the provisioning profile that best match the bundle identifier,
and copy it into the bundle as embedded.mobileprovision,
2. copy Entitlements.plist from user or SDK next to the bundle,
3. code sign the bundle.
"""
This function tries to code sign an iOS bundle, following the same
algorithm as Xcode:
1. pick the provisioning profile that best match the bundle identifier,
and copy it into the bundle as embedded.mobileprovision,
2. copy Entitlements.plist from user or SDK next to the bundle,
3. code sign the bundle.
"""
substitutions, overrides = self._InstallProvisioningProfile(

@@ -475,12 +474,12 @@ provisioning, self._GetCFBundleIdentifier()

Args:
profile: string, optional, short name of the .mobileprovision file
to use, if empty or the file is missing, the best file installed
will be used
bundle_identifier: string, value of CFBundleIdentifier from Info.plist
Args:
profile: string, optional, short name of the .mobileprovision file
to use, if empty or the file is missing, the best file installed
will be used
bundle_identifier: string, value of CFBundleIdentifier from Info.plist
Returns:
A tuple containing two dictionary: variables substitutions and values
to overrides when generating the entitlements file.
"""
Returns:
A tuple containing two dictionary: variables substitutions and values
to overrides when generating the entitlements file.
"""
source_path, provisioning_data, team_id = self._FindProvisioningProfile(

@@ -501,20 +500,20 @@ profile, bundle_identifier

Checks all the installed provisioning profiles (or if the user specified
the PROVISIONING_PROFILE variable, only consult it) and select the most
specific that correspond to the bundle identifier.
Checks all the installed provisioning profiles (or if the user specified
the PROVISIONING_PROFILE variable, only consult it) and select the most
specific that correspond to the bundle identifier.
Args:
profile: string, optional, short name of the .mobileprovision file
to use, if empty or the file is missing, the best file installed
will be used
bundle_identifier: string, value of CFBundleIdentifier from Info.plist
Args:
profile: string, optional, short name of the .mobileprovision file
to use, if empty or the file is missing, the best file installed
will be used
bundle_identifier: string, value of CFBundleIdentifier from Info.plist
Returns:
A tuple of the path to the selected provisioning profile, the data of
the embedded plist in the provisioning profile and the team identifier
to use for code signing.
Returns:
A tuple of the path to the selected provisioning profile, the data of
the embedded plist in the provisioning profile and the team identifier
to use for code signing.
Raises:
SystemExit: if no .mobileprovision can be used to sign the bundle.
"""
Raises:
SystemExit: if no .mobileprovision can be used to sign the bundle.
"""
profiles_dir = os.path.join(

@@ -567,8 +566,8 @@ os.environ["HOME"], "Library", "MobileDevice", "Provisioning Profiles"

Args:
profile_path: string, path to the .mobileprovision file
Args:
profile_path: string, path to the .mobileprovision file
Returns:
Content of the plist embedded in the provisioning profile as a dictionary.
"""
Returns:
Content of the plist embedded in the provisioning profile as a dictionary.
"""
with tempfile.NamedTemporaryFile() as temp:

@@ -596,12 +595,12 @@ subprocess.check_call(

This is a wrapper around plistlib.readPlist that tries to convert the
plist to the XML format if it can't be parsed (assuming that it is in
the binary format).
This is a wrapper around plistlib.readPlist that tries to convert the
plist to the XML format if it can't be parsed (assuming that it is in
the binary format).
Args:
plist_path: string, path to a plist file, in XML or binary format
Args:
plist_path: string, path to a plist file, in XML or binary format
Returns:
Content of the plist as a dictionary.
"""
Returns:
Content of the plist as a dictionary.
"""
try:

@@ -622,9 +621,9 @@ # First, try to read the file using plistlib that only supports XML,

Args:
bundle_identifier: string, value of CFBundleIdentifier from Info.plist
app_identifier_prefix: string, value for AppIdentifierPrefix
Args:
bundle_identifier: string, value of CFBundleIdentifier from Info.plist
app_identifier_prefix: string, value for AppIdentifierPrefix
Returns:
Dictionary of substitutions to apply when generating Entitlements.plist.
"""
Returns:
Dictionary of substitutions to apply when generating Entitlements.plist.
"""
return {

@@ -638,5 +637,5 @@ "CFBundleIdentifier": bundle_identifier,

Returns:
Value of CFBundleIdentifier in the Info.plist located in the bundle.
"""
Returns:
Value of CFBundleIdentifier in the Info.plist located in the bundle.
"""
info_plist_path = os.path.join(

@@ -651,15 +650,15 @@ os.environ["TARGET_BUILD_DIR"], os.environ["INFOPLIST_PATH"]

Expands variables "$(variable)" pattern in the source entitlements file,
add extra entitlements defined in the .mobileprovision file and the copy
the generated plist to "${BundlePath}.xcent".
Expands variables "$(variable)" pattern in the source entitlements file,
add extra entitlements defined in the .mobileprovision file and the copy
the generated plist to "${BundlePath}.xcent".
Args:
entitlements: string, optional, path to the Entitlements.plist template
to use, defaults to "${SDKROOT}/Entitlements.plist"
substitutions: dictionary, variable substitutions
overrides: dictionary, values to add to the entitlements
Args:
entitlements: string, optional, path to the Entitlements.plist template
to use, defaults to "${SDKROOT}/Entitlements.plist"
substitutions: dictionary, variable substitutions
overrides: dictionary, values to add to the entitlements
Returns:
Path to the generated entitlements file.
"""
Returns:
Path to the generated entitlements file.
"""
source_path = entitlements

@@ -684,11 +683,11 @@ target_path = os.path.join(

Args:
data: object, can be either string, list or dictionary
substitutions: dictionary, variable substitutions to perform
Args:
data: object, can be either string, list or dictionary
substitutions: dictionary, variable substitutions to perform
Returns:
Copy of data where each references to "$(variable)" has been replaced
by the corresponding value found in substitutions, or left intact if
the key was not found.
"""
Returns:
Copy of data where each references to "$(variable)" has been replaced
by the corresponding value found in substitutions, or left intact if
the key was not found.
"""
if isinstance(data, str):

@@ -712,11 +711,11 @@ for key, value in substitutions.items():

Per Mark Mentovai:
A header map is structured essentially as a hash table, keyed by names used
in #includes, and providing pathnames to the actual files.
Per Mark Mentovai:
A header map is structured essentially as a hash table, keyed by names used
in #includes, and providing pathnames to the actual files.
The implementation below and the comment above comes from inspecting:
http://www.opensource.apple.com/source/distcc/distcc-2503/distcc_dist/include_server/headermap.py?txt
while also looking at the implementation in clang in:
https://llvm.org/svn/llvm-project/cfe/trunk/lib/Lex/HeaderMap.cpp
"""
The implementation below and the comment above comes from inspecting:
http://www.opensource.apple.com/source/distcc/distcc-2503/distcc_dist/include_server/headermap.py?txt
while also looking at the implementation in clang in:
https://llvm.org/svn/llvm-project/cfe/trunk/lib/Lex/HeaderMap.cpp
"""
magic = 1751998832

@@ -723,0 +722,0 @@ version = 1

@@ -77,4 +77,3 @@ # Copyright (c) 2012 Google Inc. All rights reserved.

program = os.path.normpath(args[0])
return (program + " "
+ " ".join(QuoteForRspFile(arg, quote_cmd) for arg in args[1:]))
return program + " " + " ".join(QuoteForRspFile(arg, quote_cmd) for arg in args[1:])

@@ -938,4 +937,6 @@

# If the variable is unset, or set to 1 we use cygwin
cygwin = int(rule.get("msvs_cygwin_shell",
self.spec.get("msvs_cygwin_shell", 1))) != 0
cygwin = (
int(rule.get("msvs_cygwin_shell", self.spec.get("msvs_cygwin_shell", 1)))
!= 0
)
# Default to quoting. There's only a few special instances where the

@@ -945,4 +946,5 @@ # target command uses non-standard command line parsing and handle quotes

quote_cmd = int(rule.get("msvs_quote_cmd", 1))
assert quote_cmd != 0 or cygwin != 1, \
"msvs_quote_cmd=0 only applicable for msvs_cygwin_shell=0"
assert quote_cmd != 0 or cygwin != 1, (
"msvs_quote_cmd=0 only applicable for msvs_cygwin_shell=0"
)
return MsvsSettings.RuleShellFlags(cygwin, quote_cmd)

@@ -1135,4 +1137,3 @@

raise Exception(
'Environment variable "%s" '
"required to be set to valid path" % required
'Environment variable "%s" required to be set to valid path' % required
)

@@ -1139,0 +1140,0 @@ return env

@@ -35,14 +35,14 @@ # Copyright (c) 2012 Google Inc. All rights reserved.

Args:
name: Target name.
seed: Seed for MD5 hash.
Returns:
A GUID-line string calculated from the name and seed.
Args:
name: Target name.
seed: Seed for MD5 hash.
Returns:
A GUID-line string calculated from the name and seed.
This generates something which looks like a GUID, but depends only on the
name and seed. This means the same name/seed will always generate the same
GUID, so that projects and solutions which refer to each other can explicitly
determine the GUID to refer to explicitly. It also means that the GUID will
not change when the project for a target is rebuilt.
"""
This generates something which looks like a GUID, but depends only on the
name and seed. This means the same name/seed will always generate the same
GUID, so that projects and solutions which refer to each other can explicitly
determine the GUID to refer to explicitly. It also means that the GUID will
not change when the project for a target is rebuilt.
"""
# Calculate a MD5 signature for the seed and name.

@@ -82,11 +82,11 @@ d = hashlib.md5((str(seed) + str(name)).encode("utf-8")).hexdigest().upper()

Args:
path: Full path to the folder.
name: Name of the folder.
entries: List of folder entries to nest inside this folder. May contain
Folder or Project objects. May be None, if the folder is empty.
guid: GUID to use for folder, if not None.
items: List of solution items to include in the folder project. May be
None, if the folder does not directly contain items.
"""
Args:
path: Full path to the folder.
name: Name of the folder.
entries: List of folder entries to nest inside this folder. May contain
Folder or Project objects. May be None, if the folder is empty.
guid: GUID to use for folder, if not None.
items: List of solution items to include in the folder project. May be
None, if the folder does not directly contain items.
"""
if name:

@@ -133,15 +133,15 @@ self.name = name

Args:
path: Absolute path to the project file.
name: Name of project. If None, the name will be the same as the base
name of the project file.
dependencies: List of other Project objects this project is dependent
upon, if not None.
guid: GUID to use for project, if not None.
spec: Dictionary specifying how to build this project.
build_file: Filename of the .gyp file that the vcproj file comes from.
config_platform_overrides: optional dict of configuration platforms to
used in place of the default for this target.
fixpath_prefix: the path used to adjust the behavior of _fixpath
"""
Args:
path: Absolute path to the project file.
name: Name of project. If None, the name will be the same as the base
name of the project file.
dependencies: List of other Project objects this project is dependent
upon, if not None.
guid: GUID to use for project, if not None.
spec: Dictionary specifying how to build this project.
build_file: Filename of the .gyp file that the vcproj file comes from.
config_platform_overrides: optional dict of configuration platforms to
used in place of the default for this target.
fixpath_prefix: the path used to adjust the behavior of _fixpath
"""
self.path = path

@@ -201,12 +201,12 @@ self.guid = guid

Args:
path: Path to solution file.
version: Format version to emit.
entries: List of entries in solution. May contain Folder or Project
objects. May be None, if the folder is empty.
variants: List of build variant strings. If none, a default list will
be used.
websiteProperties: Flag to decide if the website properties section
is generated.
"""
Args:
path: Path to solution file.
version: Format version to emit.
entries: List of entries in solution. May contain Folder or Project
objects. May be None, if the folder is empty.
variants: List of build variant strings. If none, a default list will
be used.
websiteProperties: Flag to decide if the website properties section
is generated.
"""
self.path = path

@@ -237,5 +237,5 @@ self.websiteProperties = websiteProperties

Raises:
IndexError: An entry appears multiple times.
"""
Raises:
IndexError: An entry appears multiple times.
"""
# Walk the entry tree and collect all the folders and projects.

@@ -242,0 +242,0 @@ all_entries = set()

@@ -18,6 +18,6 @@ # Copyright (c) 2012 Google Inc. All rights reserved.

Args:
name: Tool name.
attrs: Dict of tool attributes; may be None.
"""
Args:
name: Tool name.
attrs: Dict of tool attributes; may be None.
"""
self._attrs = attrs or {}

@@ -29,5 +29,5 @@ self._attrs["Name"] = name

Returns:
A new xml.dom.Element for the tool.
"""
Returns:
A new xml.dom.Element for the tool.
"""
return ["Tool", self._attrs]

@@ -42,6 +42,6 @@

Args:
name: Filter (folder) name.
contents: List of filenames and/or Filter objects contained.
"""
Args:
name: Filter (folder) name.
contents: List of filenames and/or Filter objects contained.
"""
self.name = name

@@ -60,9 +60,9 @@ self.contents = list(contents or [])

Args:
project_path: Path to the project file.
version: Format version to emit.
name: Name of the project.
guid: GUID to use for project, if not None.
platforms: Array of string, the supported platforms. If null, ['Win32']
"""
Args:
project_path: Path to the project file.
version: Format version to emit.
name: Name of the project.
guid: GUID to use for project, if not None.
platforms: Array of string, the supported platforms. If null, ['Win32']
"""
self.project_path = project_path

@@ -91,5 +91,5 @@ self.version = version

Args:
path: Relative path from project to tool file.
"""
Args:
path: Relative path from project to tool file.
"""
self.tool_files_section.append(["ToolFile", {"RelativePath": path}])

@@ -100,9 +100,9 @@

Args:
config_type: Type of configuration node.
config_name: Configuration name.
attrs: Dict of configuration attributes; may be None.
tools: List of tools (strings or Tool objects); may be None.
Returns:
"""
Args:
config_type: Type of configuration node.
config_name: Configuration name.
attrs: Dict of configuration attributes; may be None.
tools: List of tools (strings or Tool objects); may be None.
Returns:
"""
# Handle defaults

@@ -131,7 +131,7 @@ if not attrs:

Args:
name: Configuration name.
attrs: Dict of configuration attributes; may be None.
tools: List of tools (strings or Tool objects); may be None.
"""
Args:
name: Configuration name.
attrs: Dict of configuration attributes; may be None.
tools: List of tools (strings or Tool objects); may be None.
"""
spec = self._GetSpecForConfiguration("Configuration", name, attrs, tools)

@@ -143,8 +143,8 @@ self.configurations_section.append(spec)

Args:
parent: Destination node
files: A list of Filter objects and/or relative paths to files.
Args:
parent: Destination node
files: A list of Filter objects and/or relative paths to files.
Will call itself recursively, if the files list contains Filter objects.
"""
Will call itself recursively, if the files list contains Filter objects.
"""
for f in files:

@@ -162,9 +162,9 @@ if isinstance(f, Filter):

Args:
files: A list of Filter objects and/or relative paths to files.
Args:
files: A list of Filter objects and/or relative paths to files.
This makes a copy of the file/filter tree at the time of this call. If you
later add files to a Filter object which was passed into a previous call
to AddFiles(), it will not be reflected in this project.
"""
This makes a copy of the file/filter tree at the time of this call. If you
later add files to a Filter object which was passed into a previous call
to AddFiles(), it will not be reflected in this project.
"""
self._AddFilesToNode(self.files_section, files)

@@ -177,11 +177,11 @@ # TODO(rspangler) This also doesn't handle adding files to an existing

Args:
path: Relative path to the file.
config: Name of configuration to add.
attrs: Dict of configuration attributes; may be None.
tools: List of tools (strings or Tool objects); may be None.
Args:
path: Relative path to the file.
config: Name of configuration to add.
attrs: Dict of configuration attributes; may be None.
tools: List of tools (strings or Tool objects); may be None.
Raises:
ValueError: Relative path does not match any file added via AddFiles().
"""
Raises:
ValueError: Relative path does not match any file added via AddFiles().
"""
# Find the file node with the right relative path

@@ -188,0 +188,0 @@ parent = self.files_dict.get(path)

@@ -38,6 +38,6 @@ # Copyright (c) 2012 Google Inc. All rights reserved.

Attributes:
msvs_name: The name of the tool in MSVS.
msbuild_name: The name of the tool in MSBuild.
"""
Attributes:
msvs_name: The name of the tool in MSVS.
msbuild_name: The name of the tool in MSBuild.
"""

@@ -52,7 +52,7 @@ def __init__(self, msvs_name, msbuild_name):

This only defines the tool. Each setting also needs to be added.
This only defines the tool. Each setting also needs to be added.
Args:
tool: The _Tool object to be added.
"""
Args:
tool: The _Tool object to be added.
"""
_msvs_validators[tool.msvs_name] = {}

@@ -75,8 +75,8 @@ _msbuild_validators[tool.msbuild_name] = {}

Args:
value: the value to check for this type.
Args:
value: the value to check for this type.
Raises:
ValueError if value is not valid for MSVS.
"""
Raises:
ValueError if value is not valid for MSVS.
"""

@@ -86,8 +86,8 @@ def ValidateMSBuild(self, value):

Args:
value: the value to check for this type.
Args:
value: the value to check for this type.
Raises:
ValueError if value is not valid for MSBuild.
"""
Raises:
ValueError if value is not valid for MSBuild.
"""

@@ -97,11 +97,11 @@ def ConvertToMSBuild(self, value):

Args:
value: the MSVS value to convert.
Args:
value: the MSVS value to convert.
Returns:
the MSBuild equivalent.
Returns:
the MSBuild equivalent.
Raises:
ValueError if value is not valid.
"""
Raises:
ValueError if value is not valid.
"""
return value

@@ -186,11 +186,11 @@

In MSVS, the values are indexes like '0', '1', and '2'.
MSBuild uses text labels that are more representative, like 'Win32'.
In MSVS, the values are indexes like '0', '1', and '2'.
MSBuild uses text labels that are more representative, like 'Win32'.
Constructor args:
label_list: an array of MSBuild labels that correspond to the MSVS index.
In the rare cases where MSVS has skipped an index value, None is
used in the array to indicate the unused spot.
new: an array of labels that are new to MSBuild.
"""
Constructor args:
label_list: an array of MSBuild labels that correspond to the MSVS index.
In the rare cases where MSVS has skipped an index value, None is
used in the array to indicate the unused spot.
new: an array of labels that are new to MSBuild.
"""

@@ -243,7 +243,7 @@ def __init__(self, label_list, new=None):

Args:
tool: a dictionary that gives the names of the tool for MSVS and MSBuild.
name: the name of the setting.
setting_type: the type of this setting.
"""
Args:
tool: a dictionary that gives the names of the tool for MSVS and MSBuild.
name: the name of the setting.
setting_type: the type of this setting.
"""
_Renamed(tool, name, name, setting_type)

@@ -255,8 +255,8 @@

Args:
tool: a dictionary that gives the names of the tool for MSVS and MSBuild.
msvs_name: the name of the MSVS setting.
msbuild_name: the name of the MSBuild setting.
setting_type: the type of this setting.
"""
Args:
tool: a dictionary that gives the names of the tool for MSVS and MSBuild.
msvs_name: the name of the MSVS setting.
msbuild_name: the name of the MSBuild setting.
setting_type: the type of this setting.
"""

@@ -283,9 +283,9 @@ def _Translate(value, msbuild_settings):

Args:
tool: a dictionary that gives the names of the tool for MSVS and MSBuild.
msvs_settings_name: the MSVS name of the setting.
msbuild_tool_name: the name of the MSBuild tool to place the setting under.
msbuild_settings_name: the MSBuild name of the setting.
setting_type: the type of this setting.
"""
Args:
tool: a dictionary that gives the names of the tool for MSVS and MSBuild.
msvs_settings_name: the MSVS name of the setting.
msbuild_tool_name: the name of the MSBuild tool to place the setting under.
msbuild_settings_name: the MSBuild name of the setting.
setting_type: the type of this setting.
"""

@@ -305,7 +305,7 @@ def _Translate(value, msbuild_settings):

Args:
tool: a dictionary that gives the names of the tool for MSVS and MSBuild.
name: the name of the setting.
setting_type: the type of this setting.
"""
Args:
tool: a dictionary that gives the names of the tool for MSVS and MSBuild.
name: the name of the setting.
setting_type: the type of this setting.
"""

@@ -323,7 +323,7 @@ def _Translate(unused_value, unused_msbuild_settings):

Args:
tool: a dictionary that gives the names of the tool for MSVS and MSBuild.
name: the name of the setting.
setting_type: the type of this setting.
"""
Args:
tool: a dictionary that gives the names of the tool for MSVS and MSBuild.
name: the name of the setting.
setting_type: the type of this setting.
"""

@@ -342,7 +342,7 @@ def _Translate(value, msbuild_settings):

Args:
tool: a dictionary that gives the names of the tool for MSVS and MSBuild.
msvs_name: the name of the MSVS setting that if 'true' becomes a flag
flag: the flag to insert at the end of the AdditionalOptions
"""
Args:
tool: a dictionary that gives the names of the tool for MSVS and MSBuild.
msvs_name: the name of the MSVS setting that if 'true' becomes a flag
flag: the flag to insert at the end of the AdditionalOptions
"""

@@ -399,11 +399,11 @@ def _Translate(value, msbuild_settings):

If the setting appears to be generated from an exclusion list, the root name
is checked.
If the setting appears to be generated from an exclusion list, the root name
is checked.
Args:
setting: A string that is the setting name to validate
settings: A dictionary where the keys are valid settings
error_msg: The message to emit in the event of error
stderr: The stream receiving the error messages.
"""
Args:
setting: A string that is the setting name to validate
settings: A dictionary where the keys are valid settings
error_msg: The message to emit in the event of error
stderr: The stream receiving the error messages.
"""
# This may be unrecognized because it's an exclusion list. If the

@@ -424,7 +424,7 @@ # setting name has the _excluded suffix, then check the root name.

These macros are known to have a built-in trailing slash. Furthermore, many
scripts hiccup on processing paths with extra slashes in the middle.
These macros are known to have a built-in trailing slash. Furthermore, many
scripts hiccup on processing paths with extra slashes in the middle.
This list is probably not exhaustive. Add as needed.
"""
This list is probably not exhaustive. Add as needed.
"""
if "$" in s:

@@ -438,4 +438,4 @@ s = fix_vc_macro_slashes_regex.sub(r"\1", s)

This list is probably not exhaustive. Add as needed.
"""
This list is probably not exhaustive. Add as needed.
"""
if "$" in s:

@@ -462,12 +462,12 @@ replace_map = {

Args:
msvs_settings: A dictionary. The key is the tool name. The values are
themselves dictionaries of settings and their values.
stderr: The stream receiving the error messages.
Args:
msvs_settings: A dictionary. The key is the tool name. The values are
themselves dictionaries of settings and their values.
stderr: The stream receiving the error messages.
Returns:
A dictionary of MSBuild settings. The key is either the MSBuild tool name
or the empty string (for the global settings). The values are themselves
dictionaries of settings and their values.
"""
Returns:
A dictionary of MSBuild settings. The key is either the MSBuild tool name
or the empty string (for the global settings). The values are themselves
dictionaries of settings and their values.
"""
msbuild_settings = {}

@@ -511,7 +511,7 @@ for msvs_tool_name, msvs_tool_settings in msvs_settings.items():

Args:
settings: A dictionary. The key is the tool name. The values are
themselves dictionaries of settings and their values.
stderr: The stream receiving the error messages.
"""
Args:
settings: A dictionary. The key is the tool name. The values are
themselves dictionaries of settings and their values.
stderr: The stream receiving the error messages.
"""
_ValidateSettings(_msvs_validators, settings, stderr)

@@ -523,7 +523,7 @@

Args:
settings: A dictionary. The key is the tool name. The values are
themselves dictionaries of settings and their values.
stderr: The stream receiving the error messages.
"""
Args:
settings: A dictionary. The key is the tool name. The values are
themselves dictionaries of settings and their values.
stderr: The stream receiving the error messages.
"""
_ValidateSettings(_msbuild_validators, settings, stderr)

@@ -535,10 +535,10 @@

We currently only validate the names of the settings, not their values.
We currently only validate the names of the settings, not their values.
Args:
validators: A dictionary of tools and their validators.
settings: A dictionary. The key is the tool name. The values are
themselves dictionaries of settings and their values.
stderr: The stream receiving the error messages.
"""
Args:
validators: A dictionary of tools and their validators.
settings: A dictionary. The key is the tool name. The values are
themselves dictionaries of settings and their values.
stderr: The stream receiving the error messages.
"""
for tool_name in settings:

@@ -659,3 +659,5 @@ if tool_name in validators:

_Same(
_compile, "BrowseInformation", _Enumeration(["false", "true", "true"]) # /FR
_compile,
"BrowseInformation",
_Enumeration(["false", "true", "true"]), # /FR
) # /Fr

@@ -718,3 +720,5 @@ _Same(

_Same(
_compile, "FavorSizeOrSpeed", _Enumeration(["Neither", "Speed", "Size"]) # /Ot
_compile,
"FavorSizeOrSpeed",
_Enumeration(["Neither", "Speed", "Size"]), # /Ot
) # /Os

@@ -932,3 +936,5 @@ _Same(

_Same(
_link, "AssemblyDebug", _Enumeration(["", "true", "false"]) # /ASSEMBLYDEBUG
_link,
"AssemblyDebug",
_Enumeration(["", "true", "false"]), # /ASSEMBLYDEBUG
) # /ASSEMBLYDEBUG:DISABLE

@@ -1183,6 +1189,10 @@ _Same(

_MSBuildOnly(
_midl, "GenerateClientFiles", _Enumeration([], new=["Stub", "None"]) # /client stub
_midl,
"GenerateClientFiles",
_Enumeration([], new=["Stub", "None"]), # /client stub
) # /client none
_MSBuildOnly(
_midl, "GenerateServerFiles", _Enumeration([], new=["Stub", "None"]) # /client stub
_midl,
"GenerateServerFiles",
_Enumeration([], new=["Stub", "None"]), # /client stub
) # /client none

@@ -1194,3 +1204,5 @@ _MSBuildOnly(_midl, "LocaleID", _integer) # /lcid DECIMAL

_MSBuildOnly(
_midl, "TypeLibFormat", _Enumeration([], new=["NewFormat", "OldFormat"]) # /newtlb
_midl,
"TypeLibFormat",
_Enumeration([], new=["NewFormat", "OldFormat"]), # /newtlb
) # /oldtlb

@@ -1197,0 +1209,0 @@

@@ -16,6 +16,6 @@ # Copyright (c) 2012 Google Inc. All rights reserved.

Args:
tool_file_path: Path to the tool file.
name: Name of the tool file.
"""
Args:
tool_file_path: Path to the tool file.
name: Name of the tool file.
"""
self.tool_file_path = tool_file_path

@@ -30,10 +30,10 @@ self.name = name

Args:
name: Name of the rule.
description: Description of the rule.
cmd: Command line of the rule.
additional_dependencies: other files which may trigger the rule.
outputs: outputs of the rule.
extensions: extensions handled by the rule.
"""
Args:
name: Name of the rule.
description: Description of the rule.
cmd: Command line of the rule.
additional_dependencies: other files which may trigger the rule.
outputs: outputs of the rule.
extensions: extensions handled by the rule.
"""
rule = [

@@ -40,0 +40,0 @@ "CustomBuildRule",

@@ -18,7 +18,7 @@ # Copyright (c) 2012 Google Inc. All rights reserved.

"""If there are no slashes in the command given, this function
searches the PATH env to find the given command, and converts it
to an absolute path. We have to do this because MSVS is looking
for an actual file to launch a debugger on, not just a command
line. Note that this happens at GYP time, so anything needing to
be built needs to have a full path."""
searches the PATH env to find the given command, and converts it
to an absolute path. We have to do this because MSVS is looking
for an actual file to launch a debugger on, not just a command
line. Note that this happens at GYP time, so anything needing to
be built needs to have a full path."""
if "/" in command or "\\" in command:

@@ -62,7 +62,7 @@ # If the command already has path elements (either relative or

Args:
user_file_path: Path to the user file.
version: Version info.
name: Name of the user file.
"""
Args:
user_file_path: Path to the user file.
version: Version info.
name: Name of the user file.
"""
self.user_file_path = user_file_path

@@ -76,5 +76,5 @@ self.version = version

Args:
name: Configuration name.
"""
Args:
name: Configuration name.
"""
self.configurations[name] = ["Configuration", {"Name": name}]

@@ -87,8 +87,8 @@

Args:
command: command line to run. First element in the list is the
executable. All elements of the command will be quoted if
necessary.
working_directory: other files which may trigger the rule. (optional)
"""
Args:
command: command line to run. First element in the list is the
executable. All elements of the command will be quoted if
necessary.
working_directory: other files which may trigger the rule. (optional)
"""
command = _QuoteWin32CommandLineArgs(command)

@@ -95,0 +95,0 @@

@@ -32,9 +32,9 @@ # Copyright (c) 2013 Google Inc. All rights reserved.

Arguments:
in_dict: The dictionary to copy.
keys: The keys to be copied. If a key is in this list and doesn't exist in
|in_dict| this is not an error.
Returns:
The partially deep-copied dictionary.
"""
Arguments:
in_dict: The dictionary to copy.
keys: The keys to be copied. If a key is in this list and doesn't exist in
|in_dict| this is not an error.
Returns:
The partially deep-copied dictionary.
"""
d = {}

@@ -51,8 +51,8 @@ for key in keys:

Arguments:
name: name of the target (foo#target)
suffix: the suffix to be added
Returns:
Target name with suffix added (foo_suffix#target)
"""
Arguments:
name: name of the target (foo#target)
suffix: the suffix to be added
Returns:
Target name with suffix added (foo_suffix#target)
"""
parts = name.rsplit("#", 1)

@@ -66,8 +66,8 @@ parts[0] = f"{parts[0]}_{suffix}"

Arguments:
name: name of the target (foo#target)
number: shard number
Returns:
Target name with shard added (foo_1#target)
"""
Arguments:
name: name of the target (foo#target)
number: shard number
Returns:
Target name with shard added (foo_1#target)
"""
return _SuffixName(name, str(number))

@@ -79,8 +79,8 @@

Arguments:
target_list: List of target pairs: 'base/base.gyp:base'.
target_dicts: Dict of target properties keyed on target pair.
Returns:
Tuple of the new sharded versions of the inputs.
"""
Arguments:
target_list: List of target pairs: 'base/base.gyp:base'.
target_dicts: Dict of target properties keyed on target pair.
Returns:
Tuple of the new sharded versions of the inputs.
"""
# Gather the targets to shard, and how many pieces.

@@ -135,18 +135,18 @@ targets_to_shard = {}

"""Returns the path to the PDB file that will be generated by a given
configuration.
configuration.
The lookup proceeds as follows:
- Look for an explicit path in the VCLinkerTool configuration block.
- Look for an 'msvs_large_pdb_path' variable.
- Use '<(PRODUCT_DIR)/<(product_name).(exe|dll).pdb' if 'product_name' is
specified.
- Use '<(PRODUCT_DIR)/<(target_name).(exe|dll).pdb'.
The lookup proceeds as follows:
- Look for an explicit path in the VCLinkerTool configuration block.
- Look for an 'msvs_large_pdb_path' variable.
- Use '<(PRODUCT_DIR)/<(product_name).(exe|dll).pdb' if 'product_name' is
specified.
- Use '<(PRODUCT_DIR)/<(target_name).(exe|dll).pdb'.
Arguments:
target_dict: The target dictionary to be searched.
config_name: The name of the configuration of interest.
vars: A dictionary of common GYP variables with generator-specific values.
Returns:
The path of the corresponding PDB file.
"""
Arguments:
target_dict: The target dictionary to be searched.
config_name: The name of the configuration of interest.
vars: A dictionary of common GYP variables with generator-specific values.
Returns:
The path of the corresponding PDB file.
"""
config = target_dict["configurations"][config_name]

@@ -176,12 +176,12 @@ msvs = config.setdefault("msvs_settings", {})

This is a workaround for targets with PDBs greater than 1GB in size, the
limit for the 1KB pagesize PDBs created by the linker by default.
This is a workaround for targets with PDBs greater than 1GB in size, the
limit for the 1KB pagesize PDBs created by the linker by default.
Arguments:
target_list: List of target pairs: 'base/base.gyp:base'.
target_dicts: Dict of target properties keyed on target pair.
vars: A dictionary of common GYP variables with generator-specific values.
Returns:
Tuple of the shimmed version of the inputs.
"""
Arguments:
target_list: List of target pairs: 'base/base.gyp:base'.
target_dicts: Dict of target properties keyed on target pair.
vars: A dictionary of common GYP variables with generator-specific values.
Returns:
Tuple of the shimmed version of the inputs.
"""
# Determine which targets need shimming.

@@ -188,0 +188,0 @@ targets_to_shim = []

@@ -79,3 +79,3 @@ # Copyright (c) 2013 Google Inc. All rights reserved.

def ToolPath(self, tool):
"""Returns the path to a given compiler tool. """
"""Returns the path to a given compiler tool."""
return os.path.normpath(os.path.join(self.path, "VC/bin", tool))

@@ -85,3 +85,3 @@

"""Returns the msbuild toolset version that will be used in the absence
of a user override."""
of a user override."""
return self.default_toolset

@@ -91,3 +91,3 @@

"""Returns a command (with arguments) to be used to set up the
environment."""
environment."""
assert target_arch in ("x86", "x64"), "target_arch not supported"

@@ -160,12 +160,12 @@ # If WindowsSDKDir is set and SetEnv.Cmd exists then we are using the

While ideally we might use the win32 module, we would like gyp to be
python neutral, so for instance cygwin python lacks this module.
While ideally we might use the win32 module, we would like gyp to be
python neutral, so for instance cygwin python lacks this module.
Arguments:
sysdir: The system subdirectory to attempt to launch reg.exe from.
key: The registry key to read from.
value: The particular value to read.
Return:
stdout from reg.exe, or None for failure.
"""
Arguments:
sysdir: The system subdirectory to attempt to launch reg.exe from.
key: The registry key to read from.
value: The particular value to read.
Return:
stdout from reg.exe, or None for failure.
"""
# Skip if not on Windows or Python Win32 setup issue

@@ -191,16 +191,16 @@ if sys.platform not in ("win32", "cygwin"):

First tries to launch from %WinDir%\Sysnative to avoid WoW64 redirection. If
that fails, it falls back to System32. Sysnative is available on Vista and
up and available on Windows Server 2003 and XP through KB patch 942589. Note
that Sysnative will always fail if using 64-bit python due to it being a
virtual directory and System32 will work correctly in the first place.
First tries to launch from %WinDir%\Sysnative to avoid WoW64 redirection. If
that fails, it falls back to System32. Sysnative is available on Vista and
up and available on Windows Server 2003 and XP through KB patch 942589. Note
that Sysnative will always fail if using 64-bit python due to it being a
virtual directory and System32 will work correctly in the first place.
KB 942589 - http://support.microsoft.com/kb/942589/en-us.
KB 942589 - http://support.microsoft.com/kb/942589/en-us.
Arguments:
key: The registry key.
value: The particular registry value to read (optional).
Return:
stdout from reg.exe, or None for failure.
"""
Arguments:
key: The registry key.
value: The particular registry value to read (optional).
Return:
stdout from reg.exe, or None for failure.
"""
text = None

@@ -220,10 +220,11 @@ try:

Args:
key: The registry key.
value: The particular registry value to read.
Return:
contents of the registry key's value, or None on failure. Throws
ImportError if winreg is unavailable.
"""
Args:
key: The registry key.
value: The particular registry value to read.
Return:
contents of the registry key's value, or None on failure. Throws
ImportError if winreg is unavailable.
"""
from winreg import HKEY_LOCAL_MACHINE, OpenKey, QueryValueEx # noqa: PLC0415
try:

@@ -241,13 +242,13 @@ root, subkey = key.split("\\", 1)

Using _winreg is preferable because it solves an issue on some corporate
environments where access to reg.exe is locked down. However, we still need
to fallback to reg.exe for the case where the _winreg module is not available
(for example in cygwin python).
Using _winreg is preferable because it solves an issue on some corporate
environments where access to reg.exe is locked down. However, we still need
to fallback to reg.exe for the case where the _winreg module is not available
(for example in cygwin python).
Args:
key: The registry key.
value: The particular registry value to read.
Return:
contents of the registry key's value, or None on failure.
"""
Args:
key: The registry key.
value: The particular registry value to read.
Return:
contents of the registry key's value, or None on failure.
"""
try:

@@ -272,6 +273,6 @@ return _RegistryGetValueUsingWinReg(key, value)

Setup is based off the GYP_MSVS_VERSION environment variable or whatever is
autodetected if GYP_MSVS_VERSION is not explicitly specified. If a version is
passed in that doesn't match a value in versions python will throw a error.
"""
Setup is based off the GYP_MSVS_VERSION environment variable or whatever is
autodetected if GYP_MSVS_VERSION is not explicitly specified. If a version is
passed in that doesn't match a value in versions python will throw a error.
"""
if path:

@@ -446,18 +447,18 @@ path = os.path.normpath(path)

Returns:
A list of visual studio versions installed in descending order of
usage preference.
Base this on the registry and a quick check if devenv.exe exists.
Possibilities are:
2005(e) - Visual Studio 2005 (8)
2008(e) - Visual Studio 2008 (9)
2010(e) - Visual Studio 2010 (10)
2012(e) - Visual Studio 2012 (11)
2013(e) - Visual Studio 2013 (12)
2015 - Visual Studio 2015 (14)
2017 - Visual Studio 2017 (15)
2019 - Visual Studio 2019 (16)
2022 - Visual Studio 2022 (17)
Where (e) is e for express editions of MSVS and blank otherwise.
"""
Returns:
A list of visual studio versions installed in descending order of
usage preference.
Base this on the registry and a quick check if devenv.exe exists.
Possibilities are:
2005(e) - Visual Studio 2005 (8)
2008(e) - Visual Studio 2008 (9)
2010(e) - Visual Studio 2010 (10)
2012(e) - Visual Studio 2012 (11)
2013(e) - Visual Studio 2013 (12)
2015 - Visual Studio 2015 (14)
2017 - Visual Studio 2017 (15)
2019 - Visual Studio 2019 (16)
2022 - Visual Studio 2022 (17)
Where (e) is e for express editions of MSVS and blank otherwise.
"""
version_to_year = {

@@ -539,7 +540,7 @@ "8.0": "2005",

Arguments:
version: Hook to allow caller to force a particular version (vs auto).
Returns:
An object representing a visual studio project format version.
"""
Arguments:
version: Hook to allow caller to force a particular version (vs auto).
Returns:
An object representing a visual studio project format version.
"""
# In auto mode, check environment variable for override.

@@ -546,0 +547,0 @@ if version == "auto":

@@ -20,4 +20,4 @@ # Copyright 2014 Google Inc. All rights reserved.

"""Deep copy operation on gyp objects such as strings, ints, dicts
and lists. More than twice as fast as copy.deepcopy but much less
generic."""
and lists. More than twice as fast as copy.deepcopy but much less
generic."""

@@ -24,0 +24,0 @@ try:

@@ -12,3 +12,2 @@ #!/usr/bin/env python3

import os

@@ -37,7 +36,7 @@ import re

"""This class performs all the Windows tooling steps. The methods can either
be executed directly, or dispatched from an argument list."""
be executed directly, or dispatched from an argument list."""
def _UseSeparateMspdbsrv(self, env, args):
"""Allows to use a unique instance of mspdbsrv.exe per linker instead of a
shared one."""
shared one."""
if len(args) < 1:

@@ -119,5 +118,5 @@ raise Exception("Not enough arguments")

"""Filter diagnostic output from link that looks like:
' Creating library ui.dll.lib and object ui.dll.exp'
This happens when there are exports from the dll or exe.
"""
' Creating library ui.dll.lib and object ui.dll.exp'
This happens when there are exports from the dll or exe.
"""
env = self._GetEnv(arch)

@@ -164,6 +163,6 @@ if use_separate_mspdbsrv == "True":

intermediate_manifest,
*manifests
*manifests,
):
"""A wrapper for handling creating a manifest resource and then executing
a link command."""
a link command."""
# The 'normal' way to do manifests is to have link generate a manifest

@@ -252,4 +251,4 @@ # based on gathering dependencies from the object files, then merge that

"""Run manifest tool with environment set. Strip out undesirable warning
(some XML blocks are recognized by the OS loader, but not the manifest
tool)."""
(some XML blocks are recognized by the OS loader, but not the manifest
tool)."""
env = self._GetEnv(arch)

@@ -267,4 +266,4 @@ popen = subprocess.Popen(

"""Creates a resource file pointing a SxS assembly manifest.
|args| is tuple containing path to resource file, path to manifest file
and resource name which can be "1" (for executables) or "2" (for DLLs)."""
|args| is tuple containing path to resource file, path to manifest file
and resource name which can be "1" (for executables) or "2" (for DLLs)."""
manifest_path, resource_path, resource_name = args

@@ -279,4 +278,4 @@ with open(resource_path, "w") as output:

"""Filter noisy filenames output from MIDL compile step that isn't
quietable via command line flags.
"""
quietable via command line flags.
"""
args = (

@@ -337,3 +336,3 @@ ["midl", "/nologo"]

"""Filter logo banner from invocations of rc.exe. Older versions of RC
don't support the /nologo flag."""
don't support the /nologo flag."""
env = self._GetEnv(arch)

@@ -355,3 +354,3 @@ popen = subprocess.Popen(

"""Runs an action command line from a response file using the environment
for |arch|. If |dir| is supplied, use that as the working directory."""
for |arch|. If |dir| is supplied, use that as the working directory."""
env = self._GetEnv(arch)

@@ -369,3 +368,3 @@ # TODO(scottmg): This is a temporary hack to get some specific variables

"""Executed by msvs-ninja projects when the 'ClCompile' target is used to
build selected C/C++ files."""
build selected C/C++ files."""
project_dir = os.path.relpath(project_dir, BASE_DIR)

@@ -372,0 +371,0 @@ selected_files = selected_files.split(";")

@@ -24,3 +24,3 @@ # Copyright (c) 2014 Google Inc. All rights reserved.

def _WriteWorkspace(main_gyp, sources_gyp, params):
""" Create a workspace to wrap main and sources gyp paths. """
"""Create a workspace to wrap main and sources gyp paths."""
(build_file_root, build_file_ext) = os.path.splitext(main_gyp)

@@ -61,3 +61,3 @@ workspace_path = build_file_root + ".xcworkspace"

def _TargetFromSpec(old_spec, params):
""" Create fake target for xcode-ninja wrapper. """
"""Create fake target for xcode-ninja wrapper."""
# Determine ninja top level build dir (e.g. /path/to/out).

@@ -107,5 +107,5 @@ ninja_toplevel = None

ninja_target["configurations"][config] = {}
ninja_target["configurations"][config][
"xcode_settings"
] = new_xcode_settings
ninja_target["configurations"][config]["xcode_settings"] = (
new_xcode_settings
)

@@ -143,9 +143,9 @@ ninja_target["mac_bundle"] = old_spec.get("mac_bundle", 0)

Xcode sometimes performs poorly with too many targets, so only include
proper executable targets, with filters to customize.
Arguments:
target_extras: Regular expression to always add, matching any target.
executable_target_pattern: Regular expression limiting executable targets.
spec: Specifications for target.
"""
Xcode sometimes performs poorly with too many targets, so only include
proper executable targets, with filters to customize.
Arguments:
target_extras: Regular expression to always add, matching any target.
executable_target_pattern: Regular expression limiting executable targets.
spec: Specifications for target.
"""
target_name = spec.get("target_name")

@@ -161,3 +161,2 @@ # Always include targets matching target_extras.

):
# If there is a filter and the target does not match, exclude the target.

@@ -174,10 +173,10 @@ if executable_target_pattern is not None:

This sets up the necessary variables in the targets to generate Xcode projects
that use ninja as an external builder.
Arguments:
target_list: List of target pairs: 'base/base.gyp:base'.
target_dicts: Dict of target properties keyed on target pair.
data: Dict of flattened build files keyed on gyp path.
params: Dict of global options for gyp.
"""
This sets up the necessary variables in the targets to generate Xcode projects
that use ninja as an external builder.
Arguments:
target_list: List of target pairs: 'base/base.gyp:base'.
target_dicts: Dict of target properties keyed on target pair.
data: Dict of flattened build files keyed on gyp path.
params: Dict of global options for gyp.
"""
orig_gyp = params["build_files"][0]

@@ -184,0 +183,0 @@ for gyp_name, gyp_dict in data.items():

@@ -12,3 +12,2 @@ # Copyright (c) 2011 Google Inc. All rights reserved.

import xml.dom.minidom

@@ -15,0 +14,0 @@

@@ -7,3 +7,3 @@ [build-system]

name = "gyp-next"
version = "0.20.2"
version = "0.20.4"
authors = [

@@ -10,0 +10,0 @@ { name="Node.js contributors", email="ryzokuken@disroot.org" },

@@ -8,3 +8,2 @@ #!/usr/bin/env python3

import argparse

@@ -11,0 +10,0 @@ import os

@@ -14,3 +14,3 @@ {

],
"version": "11.4.1",
"version": "11.4.2",
"installVersion": 11,

@@ -17,0 +17,0 @@ "author": "Nathan Rajlich <nathan@tootallnate.net> (http://tootallnate.net)",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display