@flun/nodejs-mobile-gyp 1.1.2 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/CHANGELOG.md +10 -75
  2. package/LICENSE +9 -4
  3. package/README.md +198 -132
  4. package/addon.gypi +1 -1
  5. package/bin/node-gyp.js +6 -5
  6. package/gyp/README.md +5 -3
  7. package/gyp/data/win/large-pdb-shim.cc +1 -1
  8. package/gyp/gyp +1 -1
  9. package/gyp/gyp.bat +1 -1
  10. package/gyp/gyp_main.py +1 -1
  11. package/gyp/pylib/gyp/MSVSNew.py +1 -1
  12. package/gyp/pylib/gyp/MSVSProject.py +1 -1
  13. package/gyp/pylib/gyp/MSVSSettings.py +1 -1
  14. package/gyp/pylib/gyp/MSVSToolFile.py +1 -1
  15. package/gyp/pylib/gyp/MSVSUserFile.py +1 -1
  16. package/gyp/pylib/gyp/MSVSUtil.py +1 -1
  17. package/gyp/pylib/gyp/MSVSVersion.py +1 -1
  18. package/gyp/pylib/gyp/__init__.py +1 -1
  19. package/gyp/pylib/gyp/common.py +1 -1
  20. package/gyp/pylib/gyp/easy_xml.py +1 -1
  21. package/gyp/pylib/gyp/flock_tool.py +1 -1
  22. package/gyp/pylib/gyp/generator/analyzer.py +1 -1
  23. package/gyp/pylib/gyp/generator/android.py +1 -1
  24. package/gyp/pylib/gyp/generator/cmake.py +1 -1
  25. package/gyp/pylib/gyp/generator/compile_commands_json.py +1 -1
  26. package/gyp/pylib/gyp/generator/dump_dependency_json.py +1 -1
  27. package/gyp/pylib/gyp/generator/eclipse.py +1 -1
  28. package/gyp/pylib/gyp/generator/gypd.py +1 -1
  29. package/gyp/pylib/gyp/generator/gypsh.py +1 -1
  30. package/gyp/pylib/gyp/generator/make.py +23 -12
  31. package/gyp/pylib/gyp/generator/msvs.py +3 -3
  32. package/gyp/pylib/gyp/generator/ninja.py +1 -1
  33. package/gyp/pylib/gyp/generator/xcode.py +1 -1
  34. package/gyp/pylib/gyp/input.py +1 -1
  35. package/gyp/pylib/gyp/mac_tool.py +1 -1
  36. package/gyp/pylib/gyp/msvs_emulation.py +1 -1
  37. package/gyp/pylib/gyp/ninja_syntax.py +1 -1
  38. package/gyp/pylib/gyp/simple_copy.py +1 -1
  39. package/gyp/pylib/gyp/win_tool.py +1 -1
  40. package/gyp/pylib/gyp/xcode_emulation.py +5 -5
  41. package/gyp/pylib/gyp/xcode_ninja.py +1 -1
  42. package/gyp/pylib/gyp/xcodeproj_file.py +1 -1
  43. package/gyp/pylib/gyp/xml_fix.py +1 -1
  44. package/gyp/pylib/packaging/LICENSE +1 -1
  45. package/gyp/pylib/packaging/LICENSE.APACHE +1 -1
  46. package/gyp/pylib/packaging/LICENSE.BSD +1 -1
  47. package/gyp/pylib/packaging/__init__.py +1 -1
  48. package/gyp/pylib/packaging/_elffile.py +1 -1
  49. package/gyp/pylib/packaging/_manylinux.py +1 -1
  50. package/gyp/pylib/packaging/_musllinux.py +1 -1
  51. package/gyp/pylib/packaging/_parser.py +1 -1
  52. package/gyp/pylib/packaging/_structures.py +1 -1
  53. package/gyp/pylib/packaging/_tokenizer.py +1 -1
  54. package/gyp/pylib/packaging/markers.py +1 -1
  55. package/gyp/pylib/packaging/metadata.py +1 -1
  56. package/gyp/pylib/packaging/requirements.py +1 -1
  57. package/gyp/pylib/packaging/specifiers.py +1 -1
  58. package/gyp/pylib/packaging/tags.py +1 -1
  59. package/gyp/pylib/packaging/utils.py +1 -1
  60. package/gyp/pylib/packaging/version.py +1 -1
  61. package/lib/Find-VisualStudio.cs +1 -1
  62. package/lib/build.js +16 -16
  63. package/lib/clean.js +2 -2
  64. package/lib/configure.js +20 -17
  65. package/lib/create-config-gypi.js +8 -8
  66. package/lib/download.js +3 -3
  67. package/lib/find-node-directory.js +9 -9
  68. package/lib/find-python.js +14 -14
  69. package/lib/find-visualstudio.js +19 -19
  70. package/lib/install.js +22 -21
  71. package/lib/list.js +1 -1
  72. package/lib/log.js +2 -2
  73. package/lib/node-gyp.js +7 -7
  74. package/lib/process-release.js +14 -14
  75. package/lib/rebuild.js +1 -1
  76. package/lib/remove.js +2 -2
  77. package/lib/util.js +5 -4
  78. package/package.json +3 -3
  79. package/src/win_delay_load_hook.cc +1 -1
@@ -9,4 +9,4 @@
9
9
  // (rather than the linker), this limit is avoided. With this in place PDBs may
10
10
  // grow to 2GB.
11
11
  //
12
- // This file is referenced by the msvs_large_pdb mechanism in MSVSUtil.py.
12
+ // This file is referenced by the msvs_large_pdb mechanism in MSVSUtil.py.
package/gyp/gyp CHANGED
@@ -5,4 +5,4 @@
5
5
 
6
6
  set -e
7
7
  base=$(dirname "$0")
8
- exec python "${base}/gyp_main.py" "$@"
8
+ exec python "${base}/gyp_main.py" "$@"
package/gyp/gyp.bat CHANGED
@@ -2,4 +2,4 @@
2
2
  @rem Use of this source code is governed by a BSD-style license that can be
3
3
  @rem found in the LICENSE file.
4
4
 
5
- @python "%~dp0gyp_main.py" %*
5
+ @python "%~dp0gyp_main.py" %*
package/gyp/gyp_main.py CHANGED
@@ -42,4 +42,4 @@ sys.path.insert(0, os.path.join(os.path.dirname(path), "pylib"))
42
42
  import gyp # noqa: E402
43
43
 
44
44
  if __name__ == "__main__":
45
- sys.exit(gyp.script_main())
45
+ sys.exit(gyp.script_main())
@@ -362,4 +362,4 @@ class MSVSSolution:
362
362
 
363
363
  f.write("EndGlobal\r\n")
364
364
 
365
- f.close()
365
+ f.close()
@@ -203,4 +203,4 @@ class Writer:
203
203
  self.files_section,
204
204
  ["Globals"], # empty section
205
205
  ]
206
- easy_xml.WriteXmlIfChanged(content, self.project_path, encoding="Windows-1252")
206
+ easy_xml.WriteXmlIfChanged(content, self.project_path, encoding="Windows-1252")
@@ -1280,4 +1280,4 @@ _MSBuildOnly(_manifest, "TrackerLogDirectory", _folder_name)
1280
1280
  # MSBuild MASM settings.
1281
1281
 
1282
1282
  # Options that have the same name in MSVS and MSBuild.
1283
- _Same(_masm, "UseSafeExceptionHandlers", _boolean) # /safeseh
1283
+ _Same(_masm, "UseSafeExceptionHandlers", _boolean) # /safeseh
@@ -56,4 +56,4 @@ class Writer:
56
56
  ]
57
57
  easy_xml.WriteXmlIfChanged(
58
58
  content, self.tool_file_path, encoding="Windows-1252"
59
- )
59
+ )
@@ -150,4 +150,4 @@ class Writer:
150
150
  ]
151
151
  easy_xml.WriteXmlIfChanged(
152
152
  content, self.user_file_path, encoding="Windows-1252"
153
- )
153
+ )
@@ -268,4 +268,4 @@ def InsertLargePdbShims(target_list, target_dicts, vars):
268
268
  # Update the original target to depend on the shim target.
269
269
  target_dict.setdefault("dependencies", []).append(full_shim_target_name)
270
270
 
271
- return (target_list, target_dicts)
271
+ return (target_list, target_dicts)
@@ -571,4 +571,4 @@ def SelectVisualStudioVersion(version="auto", allow_fallback=True):
571
571
  return _CreateVersion("2005", None)
572
572
  else:
573
573
  return _CreateVersion(version, None)
574
- return versions[0]
574
+ return versions[0]
@@ -689,4 +689,4 @@ def script_main():
689
689
 
690
690
 
691
691
  if __name__ == "__main__":
692
- sys.exit(script_main())
692
+ sys.exit(script_main())
@@ -654,4 +654,4 @@ def IsCygwin():
654
654
  stdout = out.communicate()[0].decode("utf-8")
655
655
  return "CYGWIN" in str(stdout)
656
656
  except Exception:
657
- return False
657
+ return False
@@ -166,4 +166,4 @@ def _XmlEscape(value, attr=False):
166
166
  return m
167
167
  return _xml_escape_map[m]
168
168
 
169
- return _xml_escape_re.sub(replace, value)
169
+ return _xml_escape_re.sub(replace, value)
@@ -52,4 +52,4 @@ class FlockTool:
52
52
 
53
53
 
54
54
  if __name__ == "__main__":
55
- sys.exit(main(sys.argv[1:]))
55
+ sys.exit(main(sys.argv[1:]))
@@ -801,4 +801,4 @@ def GenerateOutput(target_list, target_dicts, data, params):
801
801
  _WriteOutput(params, **result_dict)
802
802
 
803
803
  except Exception as e:
804
- _WriteOutput(params, error=str(e))
804
+ _WriteOutput(params, error=str(e))
@@ -1170,4 +1170,4 @@ def GenerateOutput(target_list, target_dicts, data, params):
1170
1170
  if write_alias_targets:
1171
1171
  root_makefile.write(ALL_MODULES_FOOTER)
1172
1172
 
1173
- root_makefile.close()
1173
+ root_makefile.close()
@@ -1315,4 +1315,4 @@ def GenerateOutput(target_list, target_dicts, data, params):
1315
1315
  for config_name in config_names:
1316
1316
  GenerateOutputForConfig(
1317
1317
  target_list, target_dicts, data, params, config_name
1318
- )
1318
+ )
@@ -120,4 +120,4 @@ def GenerateOutput(target_list, target_dicts, data, params):
120
120
 
121
121
 
122
122
  def PerformBuild(data, configurations, params):
123
- pass
123
+ pass
@@ -100,4 +100,4 @@ def GenerateOutput(target_list, target_dicts, data, params):
100
100
  f = open(filename, "w")
101
101
  json.dump(edges, f)
102
102
  f.close()
103
- print("Wrote json to %s." % filename)
103
+ print("Wrote json to %s." % filename)
@@ -458,4 +458,4 @@ def GenerateOutput(target_list, target_dicts, data, params):
458
458
  for config_name in config_names:
459
459
  GenerateOutputForConfig(
460
460
  target_list, target_dicts, data, params, config_name
461
- )
461
+ )
@@ -86,4 +86,4 @@ def GenerateOutput(target_list, target_dicts, data, params):
86
86
  for output_file, input_file in output_files.items():
87
87
  output = open(output_file, "w")
88
88
  pprint.pprint(data[input_file], output)
89
- output.close()
89
+ output.close()
@@ -55,4 +55,4 @@ def GenerateOutput(target_list, target_dicts, data, params):
55
55
  repr(sorted(locals.keys())),
56
56
  )
57
57
 
58
- code.interact(banner, local=locals)
58
+ code.interact(banner, local=locals)
@@ -156,7 +156,8 @@ cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)
156
156
  # special "figure out circular dependencies" flags around the entire
157
157
  # input list during linking.
158
158
  quiet_cmd_link = LINK($(TOOLSET)) $@
159
- cmd_link = $(LINK.$(TOOLSET)) -o $@ $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,--start-group $(LD_INPUTS) $(LIBS) -Wl,--end-group
159
+ cmd_link = $(LINK.$(TOOLSET)) -o $@ $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,--start-group \
160
+ $(LD_INPUTS) $(LIBS) -Wl,--end-group
160
161
 
161
162
  # Note: this does not handle spaces in paths
162
163
  define xargs
@@ -200,10 +201,12 @@ endef
200
201
  # - Set SONAME to the library filename so our binaries don't reference
201
202
  # the local, absolute paths used on the link command-line.
202
203
  quiet_cmd_solink = SOLINK($(TOOLSET)) $@
203
- cmd_solink = $(LINK.$(TOOLSET)) -o $@ -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS)
204
+ cmd_solink = $(LINK.$(TOOLSET)) -o $@ -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) \
205
+ -Wl,-soname=$(@F) -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS)
204
206
 
205
207
  quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@
206
- cmd_solink_module = $(LINK.$(TOOLSET)) -o $@ -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS)
208
+ cmd_solink_module = $(LINK.$(TOOLSET)) -o $@ -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) \
209
+ -Wl,-soname=$(@F) -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS)
207
210
  """ # noqa: E501
208
211
 
209
212
  LINK_COMMANDS_MAC = """\
@@ -217,7 +220,8 @@ quiet_cmd_solink = SOLINK($(TOOLSET)) $@
217
220
  cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS)
218
221
 
219
222
  quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@
220
- cmd_solink_module = $(LINK.$(TOOLSET)) -bundle $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)
223
+ cmd_solink_module = $(LINK.$(TOOLSET)) -bundle $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ \
224
+ $(filter-out FORCE_DO_CMD, $^) $(LIBS)
221
225
  """ # noqa: E501
222
226
 
223
227
  LINK_COMMANDS_ANDROID = """\
@@ -257,19 +261,24 @@ endef
257
261
  # input list during linking.
258
262
  quiet_cmd_link = LINK($(TOOLSET)) $@
259
263
  quiet_cmd_link_host = LINK($(TOOLSET)) $@
260
- cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS)
261
- cmd_link_host = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS)
264
+ cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group \
265
+ $(LD_INPUTS) -Wl,--end-group $(LIBS)
266
+ cmd_link_host = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group \
267
+ $(LD_INPUTS) -Wl,--end-group $(LIBS)
262
268
 
263
269
  # Other shared-object link notes:
264
270
  # - Set SONAME to the library filename so our binaries don't reference
265
271
  # the local, absolute paths used on the link command-line.
266
272
  quiet_cmd_solink = SOLINK($(TOOLSET)) $@
267
- cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS)
273
+ cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) \
274
+ -o $@ -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS)
268
275
 
269
276
  quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@
270
- cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS)
277
+ cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) \
278
+ -Wl,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS)
271
279
  quiet_cmd_solink_module_host = SOLINK_MODULE($(TOOLSET)) $@
272
- cmd_solink_module_host = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)
280
+ cmd_solink_module_host = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) \
281
+ -Wl,-soname=$(@F) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)
273
282
  """ # noqa: E501
274
283
 
275
284
 
@@ -287,7 +296,8 @@ quiet_cmd_solink = SOLINK($(TOOLSET)) $@
287
296
  cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)
288
297
 
289
298
  quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@
290
- cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)
299
+ cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ \
300
+ $(filter-out FORCE_DO_CMD, $^) $(LIBS)
291
301
  """ # noqa: E501
292
302
 
293
303
 
@@ -305,7 +315,8 @@ quiet_cmd_solink = SOLINK($(TOOLSET)) $@
305
315
  cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)
306
316
 
307
317
  quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@
308
- cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)
318
+ cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ \
319
+ $(filter-out FORCE_DO_CMD, $^) $(LIBS)
309
320
  """ # noqa: E501
310
321
 
311
322
 
@@ -2722,4 +2733,4 @@ def GenerateOutput(target_list, target_dicts, data, params):
2722
2733
 
2723
2734
  root_makefile.write(SHARED_FOOTER)
2724
2735
 
2725
- root_makefile.close()
2736
+ root_makefile.close()
@@ -746,8 +746,8 @@ def _EscapeEnvironmentVariableExpansion(s):
746
746
 
747
747
  Escapes any % characters so that Windows-style environment variable
748
748
  expansions will leave them alone.
749
- See http://connect.microsoft.com/VisualStudio/feedback/details/106127/cl-d-name-text-containing-percentage-characters-doesnt-compile
750
- to understand why we have to do this.
749
+ 原因见 Visual Studio 反馈 106127:
750
+ cl.exe 无法编译文件名含 % 字符的路径;
751
751
 
752
752
  Args:
753
753
  s: The string to be escaped.
@@ -3978,4 +3978,4 @@ def _AddMSBuildAction(
3978
3978
  )
3979
3979
  if additional_inputs:
3980
3980
  action_spec.append(["AdditionalInputs", additional_inputs])
3981
- actions_spec.append(action_spec)
3981
+ actions_spec.append(action_spec)
@@ -2930,4 +2930,4 @@ def GenerateOutput(target_list, target_dicts, data, params):
2930
2930
  for config_name in config_names:
2931
2931
  GenerateOutputForConfig(
2932
2932
  target_list, target_dicts, data, params, config_name
2933
- )
2933
+ )
@@ -1394,4 +1394,4 @@ exit 1
1394
1394
  xcode_projects[build_file].Finalize2(xcode_targets, xcode_target_to_target_dict)
1395
1395
 
1396
1396
  for build_file in build_files:
1397
- xcode_projects[build_file].Write()
1397
+ xcode_projects[build_file].Write()
@@ -3112,4 +3112,4 @@ def Load(
3112
3112
  # TODO(mark): Return |data| for now because the generator needs a list of
3113
3113
  # build files that came in. In the future, maybe it should just accept
3114
3114
  # a list, and not the whole data dict.
3115
- return [flat_list, targets, data]
3115
+ return [flat_list, targets, data]
@@ -768,4 +768,4 @@ def WriteHmap(output_name, filelist):
768
768
 
769
769
 
770
770
  if __name__ == "__main__":
771
- sys.exit(main(sys.argv[1:]))
771
+ sys.exit(main(sys.argv[1:]))
@@ -1259,4 +1259,4 @@ def CalculateCommonVariables(default_variables, params):
1259
1259
  ):
1260
1260
  default_variables["MSVS_OS_BITS"] = 64
1261
1261
  else:
1262
- default_variables["MSVS_OS_BITS"] = 32
1262
+ default_variables["MSVS_OS_BITS"] = 32
@@ -171,4 +171,4 @@ def escape(string):
171
171
  further interpretation."""
172
172
  assert "\n" not in string, "Ninja syntax does not allow newlines"
173
173
  # We only have one special metacharacter: '$'.
174
- return string.replace("$", "$$")
174
+ return string.replace("$", "$$")
@@ -58,4 +58,4 @@ def _deepcopy_dict(x):
58
58
 
59
59
  d[dict] = _deepcopy_dict
60
60
 
61
- del d
61
+ del d
@@ -370,4 +370,4 @@ class WinTool:
370
370
 
371
371
 
372
372
  if __name__ == "__main__":
373
- sys.exit(main(sys.argv[1:]))
373
+ sys.exit(main(sys.argv[1:]))
@@ -1701,9 +1701,8 @@ def GetMacInfoPlist(product_dir, xcode_settings, gyp_path_to_build_path):
1701
1701
  def _GetXcodeEnv(
1702
1702
  xcode_settings, built_products_dir, srcroot, configuration, additional_settings=None
1703
1703
  ):
1704
- """Return the environment variables that Xcode would set. See
1705
- http://developer.apple.com/library/mac/#documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html#//apple_ref/doc/uid/TP40003931-CH3-SW153
1706
- for a full list.
1704
+ """返回 Xcode 会设置的环境变量;
1705
+ 完整列表见 Xcode Build Setting Reference(TP40003931-CH3-SW153);
1707
1706
 
1708
1707
  Args:
1709
1708
  xcode_settings: An XcodeSettings object. If this is None, this function
@@ -1729,7 +1728,8 @@ def _GetXcodeEnv(
1729
1728
  "CONFIGURATION": configuration,
1730
1729
  "PRODUCT_NAME": xcode_settings.GetProductName(),
1731
1730
  # For FULL_PRODUCT_NAME see:
1732
- # /Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/Specifications/MacOSX\ Product\ Types.xcspec # noqa: E501
1731
+ # /Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/Specifications/
1732
+ # MacOSX\ Product\ Types.xcspec # noqa: E501
1733
1733
  "SRCROOT": srcroot,
1734
1734
  "SOURCE_ROOT": "${SRCROOT}",
1735
1735
  # This is not true for static libraries, but currently the env is only
@@ -1932,4 +1932,4 @@ def CloneConfigurationForDeviceAndEmulator(target_dicts):
1932
1932
  targets for iOS device builds."""
1933
1933
  if _HasIOSTarget(target_dicts):
1934
1934
  return _AddIOSDeviceConfigurations(target_dicts)
1935
- return target_dicts
1935
+ return target_dicts
@@ -299,4 +299,4 @@ def CreateWrapper(target_list, target_dicts, data, params):
299
299
 
300
300
  # Write workspace to file.
301
301
  _WriteWorkspace(main_gyp, sources_gyp, params)
302
- return (new_target_list, new_target_dicts, new_data)
302
+ return (new_target_list, new_target_dicts, new_data)
@@ -3195,4 +3195,4 @@ class XCProjectFile(XCObject):
3195
3195
  if self._should_print_single_line:
3196
3196
  self._XCPrint(file, 0, "}; ")
3197
3197
  else:
3198
- self._XCPrint(file, 1, "};\n")
3198
+ self._XCPrint(file, 1, "};\n")
@@ -62,4 +62,4 @@ class XmlFix:
62
62
  self.write_data = None
63
63
 
64
64
  def __del__(self):
65
- self.Cleanup()
65
+ self.Cleanup()
@@ -1,3 +1,3 @@
1
1
  This software is made available under the terms of *either* of the licenses
2
2
  found in LICENSE.APACHE or LICENSE.BSD. Contributions to this software is made
3
- under the terms of *both* these licenses.
3
+ under the terms of *both* these licenses.
@@ -174,4 +174,4 @@
174
174
  incurred by, or claims asserted against, such Contributor by reason
175
175
  of your accepting any such warranty or additional liability.
176
176
 
177
- END OF TERMS AND CONDITIONS
177
+ END OF TERMS AND CONDITIONS
@@ -20,4 +20,4 @@ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20
20
  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21
21
  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22
22
  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -12,4 +12,4 @@ __author__ = "Donald Stufft and individual contributors"
12
12
  __email__ = "donald@stufft.io"
13
13
 
14
14
  __license__ = "BSD-2-Clause or Apache-2.0"
15
- __copyright__ = "2014 %s" % __author__
15
+ __copyright__ = "2014 %s" % __author__
@@ -105,4 +105,4 @@ class ELFFile:
105
105
  continue
106
106
  self._f.seek(data[self._p_idx[1]])
107
107
  return os.fsdecode(self._f.read(data[self._p_idx[2]])).strip("\0")
108
- return None
108
+ return None
@@ -249,4 +249,4 @@ def platform_tags(archs: Sequence[str]) -> Iterator[str]:
249
249
  if glibc_version in _LEGACY_MANYLINUX_MAP:
250
250
  legacy_tag = _LEGACY_MANYLINUX_MAP[glibc_version]
251
251
  if _is_compatible(arch, glibc_version):
252
- yield f"{legacy_tag}_{arch}"
252
+ yield f"{legacy_tag}_{arch}"
@@ -80,4 +80,4 @@ if __name__ == "__main__": # pragma: no cover
80
80
  print("musl:", _get_musl_version(sys.executable))
81
81
  print("tags:", end=" ")
82
82
  for t in platform_tags(re.sub(r"[.-]", "_", plat.split("-", 1)[-1])):
83
- print(t, end="\n ")
83
+ print(t, end="\n ")
@@ -356,4 +356,4 @@ def _parse_marker_op(tokenizer: Tokenizer) -> Op:
356
356
  return tokenizer.raise_syntax_error(
357
357
  "Expected marker operator, one of "
358
358
  "<=, <, !=, ==, >=, >, ~=, ===, in, not in"
359
- )
359
+ )
@@ -58,4 +58,4 @@ class NegativeInfinityType:
58
58
  return Infinity
59
59
 
60
60
 
61
- NegativeInfinity = NegativeInfinityType()
61
+ NegativeInfinity = NegativeInfinityType()
@@ -189,4 +189,4 @@ class Tokenizer:
189
189
  span_start=open_position,
190
190
  )
191
191
 
192
- self.read()
192
+ self.read()
@@ -249,4 +249,4 @@ class Marker:
249
249
  if current_environment["extra"] is None:
250
250
  current_environment["extra"] = ""
251
251
 
252
- return _evaluate_markers(self._markers, current_environment)
252
+ return _evaluate_markers(self._markers, current_environment)
@@ -822,4 +822,4 @@ class Metadata:
822
822
  provides: _Validator[Optional[List[str]]] = _Validator(added="1.1")
823
823
  """``Provides`` (deprecated)"""
824
824
  obsoletes: _Validator[Optional[List[str]]] = _Validator(added="1.1")
825
- """``Obsoletes`` (deprecated)"""
825
+ """``Obsoletes`` (deprecated)"""
@@ -87,4 +87,4 @@ class Requirement:
87
87
  and self.specifier == other.specifier
88
88
  and self.url == other.url
89
89
  and self.marker == other.marker
90
- )
90
+ )
@@ -1027,4 +1027,4 @@ class SpecifierSet(BaseSpecifier):
1027
1027
  if not filtered and found_prereleases and prereleases is None:
1028
1028
  return iter(found_prereleases)
1029
1029
 
1030
- return iter(filtered)
1030
+ return iter(filtered)
@@ -550,4 +550,4 @@ def sys_tags(*, warn: bool = False) -> Iterator[Tag]:
550
550
  interp = "cp" + interpreter_version(warn=warn)
551
551
  else:
552
552
  interp = None
553
- yield from compatible_tags(interpreter=interp)
553
+ yield from compatible_tags(interpreter=interp)
@@ -169,4 +169,4 @@ def parse_sdist_filename(filename: str) -> Tuple[NormalizedName, Version]:
169
169
  f"Invalid sdist filename (invalid version): {filename}"
170
170
  ) from e
171
171
 
172
- return (name, version)
172
+ return (name, version)
@@ -560,4 +560,4 @@ def _cmpkey(
560
560
  (i, "") if isinstance(i, int) else (NegativeInfinity, i) for i in local
561
561
  )
562
562
 
563
- return epoch, _release, _pre, _post, _dev, _local
563
+ return epoch, _release, _pre, _post, _dev, _local
@@ -247,4 +247,4 @@ namespace VisualStudioConfiguration
247
247
  return json.ToString();
248
248
  }
249
249
  }
250
- }
250
+ }
package/lib/build.js CHANGED
@@ -9,14 +9,14 @@ import fsSync from 'fs';
9
9
 
10
10
  const fs = gracefulFs.promises,
11
11
  _hostIsWindows = process.platform === 'win32',
12
- // Android 交叉编译即使宿主是 Windows,也必须走 make(make-android 生成器)
12
+ // Android 交叉编译即使宿主是 Windows,也必须走 make(make-android 生成器)
13
13
  _isAndroidCrossBuild = process.env.npm_config_platform === 'android' || process.env.npm_config_format === 'make-android',
14
- // win 在此文件中语义为"使用 MSBuild":仅 Windows 宿主且非 Android 交叉编译
14
+ // win 在此文件中语义为"使用 MSBuild":仅 Windows 宿主且非 Android 交叉编译
15
15
  win = _hostIsWindows && !_isAndroidCrossBuild,
16
16
  /**
17
17
  * Windows 上 GNU make 需要 sh.exe 来执行 Makefile 里的 Unix 命令
18
- * (printf / xargs / rm 等)。优先复用 Git for Windows 自带的 usr/bin,
19
- * 避免要求用户额外安装 MSYS2。通过 "where git" 反推,不硬编码路径。
18
+ * (printf / xargs / rm 等);优先复用 Git for Windows 自带的 usr/bin,
19
+ * 避免要求用户额外安装 MSYS2;通过 "where git" 反推,不硬编码路径;
20
20
  */
21
21
  findWindowsShellDir = () => {
22
22
  if (process.platform !== 'win32') return null;
@@ -24,7 +24,7 @@ const fs = gracefulFs.promises,
24
24
  try { return fsSync.existsSync(path.join(dir, 'sh.exe')) ? dir : null } catch { return null }
25
25
  };
26
26
  const toShDir = (gitRoot) => tryShDir(path.join(gitRoot, 'usr', 'bin'));
27
- // 1) 注册表:Git for Windows 安装时必写,与 PATH 无关(最可靠)
27
+ // 1) 注册表:Git for Windows 安装时必写,与 PATH 无关(最可靠)
28
28
  const reg = process.env.SystemRoot ? path.join(process.env.SystemRoot, 'System32', 'reg.exe') : 'reg.exe';
29
29
  for (const hive of ['HKLM', 'HKCU']) {
30
30
  for (const key of ['SOFTWARE\\GitForWindows', 'SOFTWARE\\WOW6432Node\\GitForWindows']) {
@@ -40,7 +40,7 @@ const fs = gracefulFs.promises,
40
40
  } catch { }
41
41
  }
42
42
  }
43
- // 2) which.sync(PATH 中能找到 git 时可用)
43
+ // 2) which.sync(PATH 中能找到 git 时可用)
44
44
  try {
45
45
  const gitPath = which.sync('git');
46
46
  if (gitPath) {
@@ -49,7 +49,7 @@ const fs = gracefulFs.promises,
49
49
  if (r) return r;
50
50
  }
51
51
  } catch { }
52
- // 3) PATH 中找 git.exe,再反推 ../usr/bin
52
+ // 3) PATH 中找 git.exe,再反推 ../usr/bin
53
53
  for (const pd of (process.env.PATH || '').split(';')) {
54
54
  if (!pd) continue;
55
55
  try {
@@ -97,11 +97,11 @@ const fs = gracefulFs.promises,
97
97
  if (win && !verbose) argv.push('/clp:Verbosity=minimal');
98
98
  if (win) argv.push('/nologo'); // Windows 上关闭 Microsoft logo
99
99
 
100
- // 指定构建类型,默认 Release
100
+ // 指定构建类型,默认 Release
101
101
  if (win) {
102
102
  // 把 .gypi 配置中的 target_arch 转换为 MSBuild 的 /Platform
103
- // 因为表示"32 位 Intel"的方式很多,默认按此处理
104
- // 注意:msbuild 的 Condition 字符串相等比较不区分大小写
103
+ // 因为表示"32 位 Intel"的方式很多,默认按此处理
104
+ // 注意:msbuild 的 Condition 字符串相等比较不区分大小写
105
105
  const archLower = arch.toLowerCase(), p = archLower === 'x64' ? 'x64' : (archLower === 'arm' ? 'ARM'
106
106
  : (archLower === 'arm64' ? 'ARM64' : 'Win32'));
107
107
  argv.push('/p:Configuration=' + buildType + ';Platform=' + p)
@@ -122,13 +122,13 @@ const fs = gracefulFs.promises,
122
122
  }
123
123
 
124
124
  if (win) {
125
- // 用户是否指定了自己的 .sln 文件?
125
+ // 用户是否指定了自己的 .sln 文件?
126
126
  const hasSln = argv.some(arg => path.extname(arg) === '.sln');
127
127
  if (!hasSln) argv.unshift(gyp.opts.solution || guessedSolution);
128
128
  }
129
129
 
130
130
  if (!win) {
131
- // 把构建期依赖的符号链接(如 Python)加入 PATH
131
+ // 把构建期依赖的符号链接(如 Python)加入 PATH
132
132
  buildBinsDir = path.resolve('build', 'node_gyp_bins');
133
133
  if (_hostIsWindows) {
134
134
  const shellDir = findWindowsShellDir();
@@ -136,7 +136,7 @@ const fs = gracefulFs.promises,
136
136
  process.env.PATH = `${shellDir};${process.env.PATH}`;
137
137
  log.verbose('bin shell', `prepended ${shellDir} to PATH for make`);
138
138
  } else {
139
- log.warn('bin shell', 'no sh.exe found; GNU make 的 Unix 命令可能失败。建议安装 Git for Windows');
139
+ log.warn('bin shell', 'no sh.exe found; GNU make 的 Unix 命令可能失败;建议安装 Git for Windows');
140
140
  }
141
141
  }
142
142
  process.env.PATH = _hostIsWindows
@@ -145,7 +145,7 @@ const fs = gracefulFs.promises,
145
145
  await fs.mkdir(buildBinsDir, { recursive: true });
146
146
 
147
147
  if (_hostIsWindows) {
148
- // Windows 无 python3 名称,且创建符号链接需要管理员权限;改用 .cmd 桥接
148
+ // Windows 无 python3 名称,且创建符号链接需要管理员权限;改用 .cmd 桥接
149
149
  const shimPath = path.join(buildBinsDir, 'python3.cmd');
150
150
  await fs.writeFile(shimPath, `@echo off\r\n"${python}" %*\r\n`);
151
151
  log.verbose('bin shims', `created python3.cmd shim to "${python}" and added to PATH`);
@@ -176,7 +176,7 @@ const fs = gracefulFs.promises,
176
176
  doWhich = async () => {
177
177
  // Windows 使用 node-gyp configure 提供的 msbuild
178
178
  if (win) {
179
- if (!config.variables.msbuild_path) throw new Error('MSBuild 未设置,请先运行 `node-gyp configure`');
179
+ if (!config.variables.msbuild_path) throw new Error('MSBuild 未设置,请先运行 `node-gyp configure`');
180
180
  command = config.variables.msbuild_path, log.verbose('using MSBuild:', command), await doBuild();
181
181
  return;
182
182
  }
@@ -190,7 +190,7 @@ const fs = gracefulFs.promises,
190
190
  */
191
191
  findSolutionFile = async () => {
192
192
  const files = await glob('build/*.sln')
193
- if (files.length === 0) throw new Error('未找到 *.sln 文件,是否运行过 configure?');
193
+ if (files.length === 0) throw new Error('未找到 *.sln 文件,是否运行过 configure?');
194
194
  guessedSolution = files[0], log.verbose('found first Solution file', guessedSolution), await doWhich();
195
195
  },
196
196
  /**