| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent efcc829 commit e20eef6
11 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,12 @@ | |||
| 1 | 1 | # Changelog | |
| 2 | 2 | ||
| 3 | + ## [0.19.0](https://github.com/nodejs/gyp-next/compare/v0.18.3...v0.19.0) (2024-12-03) | ||
| 4 | + | ||
| 5 | + | ||
| 6 | + ### Features | ||
| 7 | + | ||
| 8 | + * provide escaped version of `PRODUCT_DIR_ABS` ([#271](https://github.com/nodejs/gyp-next/issues/271)) ([3bf3b1c](https://github.com/nodejs/gyp-next/commit/3bf3b1cda26f16c645e0fdd5582ffbf49d9a2580)) | ||
| 9 | + | ||
| 3 | 10 | ## [0.18.3](https://github.com/nodejs/gyp-next/compare/v0.18.2...v0.18.3) (2024-10-08) | |
| 4 | 11 | ||
| 5 | 12 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -171,7 +171,7 @@ def ValidateMSBuild(self, value): | |||
| 171 | 171 | int(value, self._msbuild_base) | |
| 172 | 172 | ||
| 173 | 173 | def ConvertToMSBuild(self, value): | |
| 174 | - msbuild_format = (self._msbuild_base == 10) and "%d" or "0x%04x" | ||
| 174 | + msbuild_format = ((self._msbuild_base == 10) and "%d") or "0x%04x" | ||
| 175 | 175 | return msbuild_format % int(value) | |
| 176 | 176 | ||
| 177 | 177 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -69,7 +69,7 @@ def UsesVcxproj(self): | |||
| 69 | 69 | ||
| 70 | 70 | def ProjectExtension(self): | |
| 71 | 71 | """Returns the file extension for the project.""" | |
| 72 | - return self.uses_vcxproj and ".vcxproj" or ".vcproj" | ||
| 72 | + return (self.uses_vcxproj and ".vcxproj") or ".vcproj" | ||
| 73 | 73 | ||
| 74 | 74 | def Path(self): | |
| 75 | 75 | """Returns the path to Visual Studio installation.""" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,7 +4,7 @@ | |||
| 4 | 4 | # Use of this source code is governed by a BSD-style license that can be | |
| 5 | 5 | # found in the LICENSE file. | |
| 6 | 6 | ||
| 7 | - | ||
| 7 | + from __future__ import annotations | ||
| 8 | 8 | import copy | |
| 9 | 9 | import gyp.input | |
| 10 | 10 | import argparse | |
@@ -24,6 +24,18 @@ | |||
| 24 | 24 | DEBUG_VARIABLES = "variables" | |
| 25 | 25 | DEBUG_INCLUDES = "includes" | |
| 26 | 26 | ||
| 27 | + def EscapeForCString(string: bytes | str) -> str: | ||
| 28 | + if isinstance(string, str): | ||
| 29 | + string = string.encode(encoding='utf8') | ||
| 30 | + | ||
| 31 | + backslash_or_double_quote = {ord('\\'), ord('"')} | ||
| 32 | + result = [] | ||
| 33 | + for char in string: | ||
| 34 | + if char in backslash_or_double_quote or not 32 <= char < 127: | ||
| 35 | + result += '\\%03o' % char | ||
| 36 | + else: | ||
| 37 | + result += chr(char) | ||
| 38 | + return result | ||
| 27 | 39 | ||
| 28 | 40 | def DebugOutput(mode, message, *args): | |
| 29 | 41 | if "all" in gyp.debug or mode in gyp.debug: | |
@@ -106,18 +118,19 @@ def Load( | |||
| 106 | 118 | ||
| 107 | 119 | output_dir = params["options"].generator_output or params["options"].toplevel_dir | |
| 108 | 120 | if default_variables["GENERATOR"] == "ninja": | |
| 109 | - default_variables.setdefault( | ||
| 110 | - "PRODUCT_DIR_ABS", | ||
| 111 | - os.path.join( | ||
| 112 | - output_dir, "out", default_variables.get("build_type", "default") | ||
| 113 | - ), | ||
| 121 | + product_dir_abs = os.path.join( | ||
| 122 | + output_dir, "out", default_variables.get("build_type", "default") | ||
| 114 | 123 | ) | |
| 115 | 124 | else: | |
| 116 | - default_variables.setdefault( | ||
| 117 | - "PRODUCT_DIR_ABS", | ||
| 118 | - os.path.join(output_dir, default_variables["CONFIGURATION_NAME"]), | ||
| 125 | + product_dir_abs = os.path.join( | ||
| 126 | + output_dir, default_variables["CONFIGURATION_NAME"] | ||
| 119 | 127 | ) | |
| 120 | 128 | ||
| 129 | + default_variables.setdefault("PRODUCT_DIR_ABS", product_dir_abs) | ||
| 130 | + default_variables.setdefault( | ||
| 131 | + "PRODUCT_DIR_ABS_CSTR", EscapeForCString(product_dir_abs) | ||
| 132 | + ) | ||
| 133 | + | ||
| 121 | 134 | # Give the generator the opportunity to set additional variables based on | |
| 122 | 135 | # the params it will receive in the output phase. | |
| 123 | 136 | if getattr(generator, "CalculateVariables", None): | |
@@ -253,7 +266,7 @@ def Noop(value): | |||
| 253 | 266 | for name, metadata in options._regeneration_metadata.items(): | |
| 254 | 267 | opt = metadata["opt"] | |
| 255 | 268 | value = getattr(options, name) | |
| 256 | - value_predicate = metadata["type"] == "path" and FixPath or Noop | ||
| 269 | + value_predicate = (metadata["type"] == "path" and FixPath) or Noop | ||
| 257 | 270 | action = metadata["action"] | |
| 258 | 271 | env_name = metadata["env_name"] | |
| 259 | 272 | if action == "append": | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -788,7 +788,7 @@ def __init__(self, generator_flags, flavor): | |||
| 788 | 788 | self.suffix_rules_objdir2 = {} | |
| 789 | 789 | ||
| 790 | 790 | # Generate suffix rules for all compilable extensions. | |
| 791 | - for ext in COMPILABLE_EXTENSIONS: | ||
| 791 | + for ext, value in COMPILABLE_EXTENSIONS.items(): | ||
| 792 | 792 | # Suffix rules for source folder. | |
| 793 | 793 | self.suffix_rules_srcdir.update( | |
| 794 | 794 | { | |
@@ -797,7 +797,7 @@ def __init__(self, generator_flags, flavor): | |||
| 797 | 797 | $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(srcdir)/%%%s FORCE_DO_CMD | |
| 798 | 798 | \t@$(call do_cmd,%s,1) | |
| 799 | 799 | """ | |
| 800 | - % (ext, COMPILABLE_EXTENSIONS[ext]) | ||
| 800 | + % (ext, value) | ||
| 801 | 801 | ) | |
| 802 | 802 | } | |
| 803 | 803 | ) | |
@@ -810,7 +810,7 @@ def __init__(self, generator_flags, flavor): | |||
| 810 | 810 | $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj).$(TOOLSET)/%%%s FORCE_DO_CMD | |
| 811 | 811 | \t@$(call do_cmd,%s,1) | |
| 812 | 812 | """ | |
| 813 | - % (ext, COMPILABLE_EXTENSIONS[ext]) | ||
| 813 | + % (ext, value) | ||
| 814 | 814 | ) | |
| 815 | 815 | } | |
| 816 | 816 | ) | |
@@ -821,7 +821,7 @@ def __init__(self, generator_flags, flavor): | |||
| 821 | 821 | $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD | |
| 822 | 822 | \t@$(call do_cmd,%s,1) | |
| 823 | 823 | """ | |
| 824 | - % (ext, COMPILABLE_EXTENSIONS[ext]) | ||
| 824 | + % (ext, value) | ||
| 825 | 825 | ) | |
| 826 | 826 | } | |
| 827 | 827 | ) | |
@@ -1779,13 +1779,13 @@ def WriteTarget( | |||
| 1779 | 1779 | # using ":=". | |
| 1780 | 1780 | self.WriteSortedXcodeEnv(self.output, self.GetSortedXcodePostbuildEnv()) | |
| 1781 | 1781 | ||
| 1782 | - for configname in target_postbuilds: | ||
| 1782 | + for configname, value in target_postbuilds.items(): | ||
| 1783 | 1783 | self.WriteLn( | |
| 1784 | 1784 | "%s: TARGET_POSTBUILDS_%s := %s" | |
| 1785 | 1785 | % ( | |
| 1786 | 1786 | QuoteSpaces(self.output), | |
| 1787 | 1787 | configname, | |
| 1788 | - gyp.common.EncodePOSIXShellList(target_postbuilds[configname]), | ||
| 1788 | + gyp.common.EncodePOSIXShellList(value), | ||
| 1789 | 1789 | ) | |
| 1790 | 1790 | ) | |
| 1791 | 1791 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2469,11 +2469,8 @@ def SetUpConfigurations(target, target_dict): | |||
| 2469 | 2469 | merged_configurations[configuration] = new_configuration_dict | |
| 2470 | 2470 | ||
| 2471 | 2471 | # Put the new configurations back into the target dict as a configuration. | |
| 2472 | - for configuration in merged_configurations: | ||
| 2473 | - target_dict["configurations"][configuration] = merged_configurations[ | ||
| 2474 | - configuration | ||
| 2475 | - ] | ||
| 2476 | - | ||
| 2472 | + for configuration, value in merged_configurations.items(): | ||
| 2473 | + target_dict["configurations"][configuration] = value | ||
| 2477 | 2474 | # Now drop all the abstract ones. | |
| 2478 | 2475 | configs = target_dict["configurations"] | |
| 2479 | 2476 | target_dict["configurations"] = { | |
@@ -3020,8 +3017,8 @@ def Load( | |||
| 3020 | 3017 | del target_dict[key] | |
| 3021 | 3018 | ProcessListFiltersInDict(target_name, tmp_dict) | |
| 3022 | 3019 | # Write the results back to |target_dict|. | |
| 3023 | - for key in tmp_dict: | ||
| 3024 | - target_dict[key] = tmp_dict[key] | ||
| 3020 | + for key, value in tmp_dict.items(): | ||
| 3021 | + target_dict[key] = value | ||
| 3025 | 3022 | ||
| 3026 | 3023 | # Make sure every dependency appears at most once. | |
| 3027 | 3024 | RemoveDuplicateDependencies(targets) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1127,8 +1127,8 @@ def _GetIOSPostbuilds(self, configname, output_binary): | |||
| 1127 | 1127 | be deployed to a device. This should be run as the very last step of the | |
| 1128 | 1128 | build.""" | |
| 1129 | 1129 | if not ( | |
| 1130 | - self.isIOS | ||
| 1131 | - and (self.spec["type"] == "executable" or self._IsXCTest()) | ||
| 1130 | + (self.isIOS | ||
| 1131 | + and (self.spec["type"] == "executable" or self._IsXCTest())) | ||
| 1132 | 1132 | or self.IsIosFramework() | |
| 1133 | 1133 | ): | |
| 1134 | 1134 | return [] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3017,10 +3017,10 @@ def _AllSymrootsUnique(self, target, inherit_unique_symroot): | |||
| 3017 | 3017 | symroots = self._DefinedSymroots(target) | |
| 3018 | 3018 | for s in self._DefinedSymroots(target): | |
| 3019 | 3019 | if ( | |
| 3020 | - s is not None | ||
| 3021 | - and not self._IsUniqueSymrootForTarget(s) | ||
| 3022 | - or s is None | ||
| 3023 | - and not inherit_unique_symroot | ||
| 3020 | + (s is not None | ||
| 3021 | + and not self._IsUniqueSymrootForTarget(s)) | ||
| 3022 | + or (s is None | ||
| 3023 | + and not inherit_unique_symroot) | ||
| 3024 | 3024 | ): | |
| 3025 | 3025 | return False | |
| 3026 | 3026 | return True if symroots else inherit_unique_symroot | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" | |||
| 4 | 4 | ||
| 5 | 5 | [project] | |
| 6 | 6 | name = "gyp-next" | |
| 7 | - version = "0.18.3" | ||
| 7 | + version = "0.19.0" | ||
| 8 | 8 | authors = [ | |
| 9 | 9 | { name="Node.js contributors", email="ryzokuken@disroot.org" }, | |
| 10 | 10 | ] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -93,10 +93,10 @@ def ParseSolution(solution_file): | |||
| 93 | 93 | continue | |
| 94 | 94 | ||
| 95 | 95 | # Change all dependencies clsid to name instead. | |
| 96 | - for project in dependencies: | ||
| 96 | + for project, deps in dependencies.items(): | ||
| 97 | 97 | # For each dependencies in this project | |
| 98 | 98 | new_dep_array = [] | |
| 99 | - for dep in dependencies[project]: | ||
| 99 | + for dep in deps: | ||
| 100 | 100 | # Look for the project name matching this cldis | |
| 101 | 101 | for project_info in projects: | |
| 102 | 102 | if projects[project_info][1] == dep: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments