gyp: sync code base with nodejs repo (#1975) · nodejs/node-gyp@972780b · GitHub
Skip to content

Commit 972780b

Browse files
authored
gyp: sync code base with nodejs repo (#1975)
PR-URL: #1975 Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org> Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: Rod Vagg <rod@vagg.org>
1 parent dab0305 commit 972780b

28 files changed

Lines changed: 971 additions & 390 deletions

gyp/AUTHORS

Lines changed: 2 additions & 0 deletions

gyp/DEPS

Lines changed: 0 additions & 24 deletions
This file was deleted.

gyp/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
GYP can Generate Your Projects.
2+
===================================
3+
4+
Documents are available at [gyp.gsrc.io](https://gyp.gsrc.io), or you can check out ```md-pages``` branch to read those documents offline.

gyp/codereview.settings

Lines changed: 0 additions & 10 deletions
This file was deleted.

gyp/pylib/gyp/MSVSNew.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import hashlib
88
import os
99
import random
10+
from operator import attrgetter
1011

1112
import gyp.common
1213

@@ -59,9 +60,6 @@ def __cmp__(self, other):
5960
# Sort by name then guid (so things are in order on vs2008).
6061
return cmp((self.name, self.get_guid()), (other.name, other.get_guid()))
6162

62-
def __lt__(self, other):
63-
return self.__cmp__(other) < 0
64-
6563

6664
class MSVSFolder(MSVSSolutionEntry):
6765
"""Folder in a Visual Studio project or solution."""
@@ -89,7 +87,7 @@ def __init__(self, path, name = None, entries = None,
8987
self.guid = guid
9088

9189
# Copy passed lists (or set to empty lists)
92-
self.entries = sorted(list(entries or []))
90+
self.entries = sorted(entries or [], key=attrgetter('path'))
9391
self.items = list(items or [])
9492

9593
self.entry_type_guid = ENTRY_TYPE_GUIDS['folder']
@@ -233,7 +231,7 @@ def Write(self, writer=gyp.common.WriteOnDiff):
233231
if isinstance(e, MSVSFolder):
234232
entries_to_check += e.entries
235233

236-
all_entries = sorted(all_entries)
234+
all_entries = sorted(all_entries, key=attrgetter('path'))
237235

238236
# Open file and print header
239237
f = writer(self.path)

gyp/pylib/gyp/MSVSSettings.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ def ConvertToMSBuildSettings(msvs_settings, stderr=sys.stderr):
467467
msvs_tool[msvs_setting](msvs_value, msbuild_settings)
468468
except ValueError as e:
469469
print('Warning: while converting %s/%s to MSBuild, '
470-
'%s' % (msvs_tool_name, msvs_setting, e), file=stderr)
470+
'%s' % (msvs_tool_name, msvs_setting, e), file=stderr)
471471
else:
472472
_ValidateExclusionSetting(msvs_setting,
473473
msvs_tool,
@@ -477,7 +477,7 @@ def ConvertToMSBuildSettings(msvs_settings, stderr=sys.stderr):
477477
stderr)
478478
else:
479479
print('Warning: unrecognized tool %s while converting to '
480-
'MSBuild.' % msvs_tool_name, file=stderr)
480+
'MSBuild.' % msvs_tool_name, file=stderr)
481481
return msbuild_settings
482482

483483

@@ -598,6 +598,7 @@ def _ValidateSettings(validators, settings, stderr):
598598
_Same(_compile, 'UseFullPaths', _boolean) # /FC
599599
_Same(_compile, 'WholeProgramOptimization', _boolean) # /GL
600600
_Same(_compile, 'XMLDocumentationFileName', _file_name)
601+
_Same(_compile, 'CompileAsWinRT', _boolean) # /ZW
601602

602603
_Same(_compile, 'AssemblerOutput',
603604
_Enumeration(['NoListing',

gyp/pylib/gyp/MSVSSettings_test.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66

77
"""Unit tests for the MSVSSettings.py file."""
88

9-
try:
10-
from cStringIO import StringIO
11-
except ImportError:
12-
from io import StringIO
13-
149
import unittest
1510
import gyp.MSVSSettings as MSVSSettings
1611

12+
try:
13+
from StringIO import StringIO # Python 2
14+
except ImportError:
15+
from io import StringIO # Python 3
16+
1717

1818
class TestSequenceFunctions(unittest.TestCase):
1919

gyp/pylib/gyp/MSVSUtil.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
'loadable_module': 'dll',
1515
'shared_library': 'dll',
1616
'static_library': 'lib',
17+
'windows_driver': 'sys',
1718
}
1819

1920

@@ -110,7 +111,7 @@ def ShardTargets(target_list, target_dicts):
110111
else:
111112
new_target_dicts[t] = target_dicts[t]
112113
# Shard dependencies.
113-
for t in new_target_dicts:
114+
for t in sorted(new_target_dicts):
114115
for deptype in ('dependencies', 'dependencies_original'):
115116
dependencies = copy.copy(new_target_dicts[t].get(deptype, []))
116117
new_dependencies = []

gyp/pylib/gyp/MSVSVersion.py

Lines changed: 104 additions & 43 deletions

0 commit comments

Comments
 (0)