@socketsecurity/cli-with-sentry 1.0.7 → 1.0.9

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 (171) hide show
  1. package/dist/cli.js +135 -109
  2. package/dist/cli.js.map +1 -1
  3. package/dist/constants.js +8 -3
  4. package/dist/constants.js.map +1 -1
  5. package/dist/shadow-npm-bin.js +5 -5
  6. package/dist/shadow-npm-bin.js.map +1 -1
  7. package/dist/socket-completion.bash +23 -7
  8. package/dist/types/commands/analytics/cmd-analytics.d.mts.map +1 -1
  9. package/dist/types/commands/audit-log/cmd-audit-log.d.mts.map +1 -1
  10. package/dist/types/commands/config/cmd-config-auto.d.mts.map +1 -1
  11. package/dist/types/commands/config/cmd-config-get.d.mts.map +1 -1
  12. package/dist/types/commands/config/cmd-config-list.d.mts.map +1 -1
  13. package/dist/types/commands/config/cmd-config-set.d.mts.map +1 -1
  14. package/dist/types/commands/config/cmd-config-unset.d.mts.map +1 -1
  15. package/dist/types/commands/fix/agent-fix.d.mts +4 -4
  16. package/dist/types/commands/fix/agent-fix.d.mts.map +1 -1
  17. package/dist/types/commands/fix/cmd-fix.d.mts.map +1 -1
  18. package/dist/types/commands/fix/handle-fix.d.mts +4 -3
  19. package/dist/types/commands/fix/handle-fix.d.mts.map +1 -1
  20. package/dist/types/commands/fix/npm-fix.d.mts +2 -2
  21. package/dist/types/commands/fix/npm-fix.d.mts.map +1 -1
  22. package/dist/types/commands/fix/pnpm-fix.d.mts +2 -2
  23. package/dist/types/commands/fix/pnpm-fix.d.mts.map +1 -1
  24. package/dist/types/commands/install/setup-tab-completion.d.mts.map +1 -1
  25. package/dist/types/commands/manifest/cmd-manifest-cdxgen.d.mts.map +1 -1
  26. package/dist/types/commands/npm/cmd-npm.d.mts.map +1 -1
  27. package/dist/types/commands/npx/cmd-npx.d.mts.map +1 -1
  28. package/dist/types/commands/organization/cmd-organization-dependencies.d.mts.map +1 -1
  29. package/dist/types/commands/organization/cmd-organization-list.d.mts.map +1 -1
  30. package/dist/types/commands/organization/cmd-organization-policy-license.d.mts.map +1 -1
  31. package/dist/types/commands/organization/cmd-organization-policy-security.d.mts.map +1 -1
  32. package/dist/types/commands/organization/cmd-organization-quota.d.mts.map +1 -1
  33. package/dist/types/commands/package/cmd-package-score.d.mts.map +1 -1
  34. package/dist/types/commands/raw-npm/cmd-raw-npm.d.mts.map +1 -1
  35. package/dist/types/commands/raw-npx/cmd-raw-npx.d.mts.map +1 -1
  36. package/dist/types/commands/repository/cmd-repository-create.d.mts.map +1 -1
  37. package/dist/types/commands/repository/cmd-repository-list.d.mts.map +1 -1
  38. package/dist/types/commands/repository/cmd-repository-update.d.mts.map +1 -1
  39. package/dist/types/commands/repository/cmd-repository-view.d.mts.map +1 -1
  40. package/dist/types/commands/scan/cmd-scan-del.d.mts.map +1 -1
  41. package/dist/types/commands/scan/cmd-scan-diff.d.mts.map +1 -1
  42. package/dist/types/commands/scan/cmd-scan-reach.d.mts.map +1 -1
  43. package/dist/types/commands/scan/handle-scan-reach.d.mts +8 -0
  44. package/dist/types/commands/scan/handle-scan-reach.d.mts.map +1 -0
  45. package/dist/types/commands/threat-feed/cmd-threat-feed.d.mts.map +1 -1
  46. package/dist/types/constants.d.mts.map +1 -1
  47. package/dist/types/utils/alerts-map.d.mts.map +1 -1
  48. package/dist/types/utils/api.d.mts.map +1 -1
  49. package/dist/types/utils/meow-with-subcommands.d.mts +1 -3
  50. package/dist/types/utils/meow-with-subcommands.d.mts.map +1 -1
  51. package/dist/utils.js +33 -45
  52. package/dist/utils.js.map +1 -1
  53. package/dist/vendor.js +3008 -583
  54. package/external/@coana-tech/cli/cli.mjs +1 -1
  55. package/external/@socketsecurity/registry/lib/constants/npm-real-exec-path.js +2 -40
  56. package/external/@socketsecurity/registry/lib/npm.js +102 -71
  57. package/external/@socketsecurity/registry/lib/spinner.js +6 -0
  58. package/external/blessed-contrib/lib/widget/charts/bar.js +4 -3
  59. package/external/blessed-contrib/lib/widget/charts/line.js +4 -3
  60. package/external/blessed-contrib/lib/widget/table.js +3 -3
  61. package/package.json +17 -16
  62. package/dist/types/commands/scan/handle-reach-scan.d.mts +0 -3
  63. package/dist/types/commands/scan/handle-reach-scan.d.mts.map +0 -1
  64. package/external/node-gyp/.release-please-manifest.json +0 -3
  65. package/external/node-gyp/CHANGELOG.md +0 -1053
  66. package/external/node-gyp/CODE_OF_CONDUCT.md +0 -4
  67. package/external/node-gyp/CONTRIBUTING.md +0 -34
  68. package/external/node-gyp/LICENSE +0 -24
  69. package/external/node-gyp/README.md +0 -273
  70. package/external/node-gyp/SECURITY.md +0 -2
  71. package/external/node-gyp/addon.gypi +0 -204
  72. package/external/node-gyp/bin/node-gyp.js +0 -137
  73. package/external/node-gyp/eslint.config.js +0 -3
  74. package/external/node-gyp/gyp/.release-please-manifest.json +0 -3
  75. package/external/node-gyp/gyp/LICENSE +0 -28
  76. package/external/node-gyp/gyp/data/ninja/build.ninja +0 -4
  77. package/external/node-gyp/gyp/data/win/large-pdb-shim.cc +0 -12
  78. package/external/node-gyp/gyp/docs/GypVsCMake.md +0 -116
  79. package/external/node-gyp/gyp/docs/Hacking.md +0 -46
  80. package/external/node-gyp/gyp/docs/InputFormatReference.md +0 -1083
  81. package/external/node-gyp/gyp/docs/LanguageSpecification.md +0 -430
  82. package/external/node-gyp/gyp/docs/README.md +0 -27
  83. package/external/node-gyp/gyp/docs/Testing.md +0 -450
  84. package/external/node-gyp/gyp/docs/UserDocumentation.md +0 -965
  85. package/external/node-gyp/gyp/gyp +0 -8
  86. package/external/node-gyp/gyp/gyp.bat +0 -5
  87. package/external/node-gyp/gyp/gyp_main.py +0 -45
  88. package/external/node-gyp/gyp/pylib/gyp/MSVSNew.py +0 -365
  89. package/external/node-gyp/gyp/pylib/gyp/MSVSProject.py +0 -206
  90. package/external/node-gyp/gyp/pylib/gyp/MSVSSettings.py +0 -1272
  91. package/external/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py +0 -1547
  92. package/external/node-gyp/gyp/pylib/gyp/MSVSToolFile.py +0 -59
  93. package/external/node-gyp/gyp/pylib/gyp/MSVSUserFile.py +0 -152
  94. package/external/node-gyp/gyp/pylib/gyp/MSVSUtil.py +0 -270
  95. package/external/node-gyp/gyp/pylib/gyp/MSVSVersion.py +0 -574
  96. package/external/node-gyp/gyp/pylib/gyp/__init__.py +0 -704
  97. package/external/node-gyp/gyp/pylib/gyp/common.py +0 -709
  98. package/external/node-gyp/gyp/pylib/gyp/common_test.py +0 -173
  99. package/external/node-gyp/gyp/pylib/gyp/easy_xml.py +0 -169
  100. package/external/node-gyp/gyp/pylib/gyp/easy_xml_test.py +0 -113
  101. package/external/node-gyp/gyp/pylib/gyp/flock_tool.py +0 -55
  102. package/external/node-gyp/gyp/pylib/gyp/generator/__init__.py +0 -0
  103. package/external/node-gyp/gyp/pylib/gyp/generator/analyzer.py +0 -805
  104. package/external/node-gyp/gyp/pylib/gyp/generator/android.py +0 -1172
  105. package/external/node-gyp/gyp/pylib/gyp/generator/cmake.py +0 -1319
  106. package/external/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py +0 -128
  107. package/external/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py +0 -104
  108. package/external/node-gyp/gyp/pylib/gyp/generator/eclipse.py +0 -462
  109. package/external/node-gyp/gyp/pylib/gyp/generator/gypd.py +0 -89
  110. package/external/node-gyp/gyp/pylib/gyp/generator/gypsh.py +0 -56
  111. package/external/node-gyp/gyp/pylib/gyp/generator/make.py +0 -2745
  112. package/external/node-gyp/gyp/pylib/gyp/generator/msvs.py +0 -3976
  113. package/external/node-gyp/gyp/pylib/gyp/generator/msvs_test.py +0 -44
  114. package/external/node-gyp/gyp/pylib/gyp/generator/ninja.py +0 -2965
  115. package/external/node-gyp/gyp/pylib/gyp/generator/ninja_test.py +0 -67
  116. package/external/node-gyp/gyp/pylib/gyp/generator/xcode.py +0 -1391
  117. package/external/node-gyp/gyp/pylib/gyp/generator/xcode_test.py +0 -26
  118. package/external/node-gyp/gyp/pylib/gyp/input.py +0 -3112
  119. package/external/node-gyp/gyp/pylib/gyp/input_test.py +0 -99
  120. package/external/node-gyp/gyp/pylib/gyp/mac_tool.py +0 -767
  121. package/external/node-gyp/gyp/pylib/gyp/msvs_emulation.py +0 -1260
  122. package/external/node-gyp/gyp/pylib/gyp/ninja_syntax.py +0 -174
  123. package/external/node-gyp/gyp/pylib/gyp/simple_copy.py +0 -61
  124. package/external/node-gyp/gyp/pylib/gyp/win_tool.py +0 -373
  125. package/external/node-gyp/gyp/pylib/gyp/xcode_emulation.py +0 -1939
  126. package/external/node-gyp/gyp/pylib/gyp/xcode_emulation_test.py +0 -54
  127. package/external/node-gyp/gyp/pylib/gyp/xcode_ninja.py +0 -303
  128. package/external/node-gyp/gyp/pylib/gyp/xcodeproj_file.py +0 -3196
  129. package/external/node-gyp/gyp/pylib/gyp/xml_fix.py +0 -65
  130. package/external/node-gyp/gyp/pylib/packaging/LICENSE +0 -3
  131. package/external/node-gyp/gyp/pylib/packaging/LICENSE.APACHE +0 -177
  132. package/external/node-gyp/gyp/pylib/packaging/LICENSE.BSD +0 -23
  133. package/external/node-gyp/gyp/pylib/packaging/__init__.py +0 -15
  134. package/external/node-gyp/gyp/pylib/packaging/_elffile.py +0 -108
  135. package/external/node-gyp/gyp/pylib/packaging/_manylinux.py +0 -252
  136. package/external/node-gyp/gyp/pylib/packaging/_musllinux.py +0 -83
  137. package/external/node-gyp/gyp/pylib/packaging/_parser.py +0 -359
  138. package/external/node-gyp/gyp/pylib/packaging/_structures.py +0 -61
  139. package/external/node-gyp/gyp/pylib/packaging/_tokenizer.py +0 -192
  140. package/external/node-gyp/gyp/pylib/packaging/markers.py +0 -252
  141. package/external/node-gyp/gyp/pylib/packaging/metadata.py +0 -825
  142. package/external/node-gyp/gyp/pylib/packaging/py.typed +0 -0
  143. package/external/node-gyp/gyp/pylib/packaging/requirements.py +0 -90
  144. package/external/node-gyp/gyp/pylib/packaging/specifiers.py +0 -1030
  145. package/external/node-gyp/gyp/pylib/packaging/tags.py +0 -553
  146. package/external/node-gyp/gyp/pylib/packaging/utils.py +0 -172
  147. package/external/node-gyp/gyp/pylib/packaging/version.py +0 -563
  148. package/external/node-gyp/gyp/pyproject.toml +0 -115
  149. package/external/node-gyp/gyp/release-please-config.json +0 -11
  150. package/external/node-gyp/gyp/test_gyp.py +0 -261
  151. package/external/node-gyp/lib/Find-VisualStudio.cs +0 -250
  152. package/external/node-gyp/lib/build.js +0 -230
  153. package/external/node-gyp/lib/clean.js +0 -15
  154. package/external/node-gyp/lib/configure.js +0 -328
  155. package/external/node-gyp/lib/create-config-gypi.js +0 -153
  156. package/external/node-gyp/lib/download.js +0 -41
  157. package/external/node-gyp/lib/find-node-directory.js +0 -63
  158. package/external/node-gyp/lib/find-python.js +0 -310
  159. package/external/node-gyp/lib/find-visualstudio.js +0 -600
  160. package/external/node-gyp/lib/install.js +0 -415
  161. package/external/node-gyp/lib/list.js +0 -26
  162. package/external/node-gyp/lib/log.js +0 -168
  163. package/external/node-gyp/lib/node-gyp.js +0 -188
  164. package/external/node-gyp/lib/process-release.js +0 -148
  165. package/external/node-gyp/lib/rebuild.js +0 -12
  166. package/external/node-gyp/lib/remove.js +0 -43
  167. package/external/node-gyp/lib/util.js +0 -81
  168. package/external/node-gyp/macOS_Catalina_acid_test.sh +0 -21
  169. package/external/node-gyp/package.json +0 -52
  170. package/external/node-gyp/release-please-config.json +0 -40
  171. package/external/node-gyp/src/win_delay_load_hook.cc +0 -41
@@ -1,54 +0,0 @@
1
- #!/usr/bin/env python3
2
-
3
- """Unit tests for the xcode_emulation.py file."""
4
-
5
- import sys
6
- import unittest
7
-
8
- from gyp.xcode_emulation import XcodeSettings
9
-
10
-
11
- class TestXcodeSettings(unittest.TestCase):
12
- def setUp(self):
13
- if sys.platform != "darwin":
14
- self.skipTest("This test only runs on macOS")
15
-
16
- def test_GetCflags(self):
17
- target = {
18
- "type": "static_library",
19
- "configurations": {
20
- "Release": {},
21
- },
22
- }
23
- configuration_name = "Release"
24
- xcode_settings = XcodeSettings(target)
25
- cflags = xcode_settings.GetCflags(configuration_name, "arm64")
26
-
27
- # Do not quote `-arch arm64` with spaces in one string.
28
- self.assertEqual(
29
- cflags,
30
- ["-fasm-blocks", "-mpascal-strings", "-Os", "-gdwarf-2", "-arch", "arm64"],
31
- )
32
-
33
- def GypToBuildPath(self, path):
34
- return path
35
-
36
- def test_GetLdflags(self):
37
- target = {
38
- "type": "static_library",
39
- "configurations": {
40
- "Release": {},
41
- },
42
- }
43
- configuration_name = "Release"
44
- xcode_settings = XcodeSettings(target)
45
- ldflags = xcode_settings.GetLdflags(
46
- configuration_name, "PRODUCT_DIR", self.GypToBuildPath, "arm64"
47
- )
48
-
49
- # Do not quote `-arch arm64` with spaces in one string.
50
- self.assertEqual(ldflags, ["-arch", "arm64", "-LPRODUCT_DIR"])
51
-
52
-
53
- if __name__ == "__main__":
54
- unittest.main()
@@ -1,303 +0,0 @@
1
- # Copyright (c) 2014 Google Inc. All rights reserved.
2
- # Use of this source code is governed by a BSD-style license that can be
3
- # found in the LICENSE file.
4
-
5
- """Xcode-ninja wrapper project file generator.
6
-
7
- This updates the data structures passed to the Xcode gyp generator to build
8
- with ninja instead. The Xcode project itself is transformed into a list of
9
- executable targets, each with a build step to build with ninja, and a target
10
- with every source and resource file. This appears to sidestep some of the
11
- major performance headaches experienced using complex projects and large number
12
- of targets within Xcode.
13
- """
14
-
15
- import errno
16
- import os
17
- import re
18
- import xml.sax.saxutils
19
-
20
- import gyp.generator.ninja
21
-
22
-
23
- def _WriteWorkspace(main_gyp, sources_gyp, params):
24
- """ Create a workspace to wrap main and sources gyp paths. """
25
- (build_file_root, build_file_ext) = os.path.splitext(main_gyp)
26
- workspace_path = build_file_root + ".xcworkspace"
27
- options = params["options"]
28
- if options.generator_output:
29
- workspace_path = os.path.join(options.generator_output, workspace_path)
30
- try:
31
- os.makedirs(workspace_path)
32
- except OSError as e:
33
- if e.errno != errno.EEXIST:
34
- raise
35
- output_string = (
36
- '<?xml version="1.0" encoding="UTF-8"?>\n' + '<Workspace version = "1.0">\n'
37
- )
38
- for gyp_name in [main_gyp, sources_gyp]:
39
- name = os.path.splitext(os.path.basename(gyp_name))[0] + ".xcodeproj"
40
- name = xml.sax.saxutils.quoteattr("group:" + name)
41
- output_string += " <FileRef location = %s></FileRef>\n" % name
42
- output_string += "</Workspace>\n"
43
-
44
- workspace_file = os.path.join(workspace_path, "contents.xcworkspacedata")
45
-
46
- try:
47
- with open(workspace_file) as input_file:
48
- input_string = input_file.read()
49
- if input_string == output_string:
50
- return
51
- except OSError:
52
- # Ignore errors if the file doesn't exist.
53
- pass
54
-
55
- with open(workspace_file, "w") as output_file:
56
- output_file.write(output_string)
57
-
58
-
59
- def _TargetFromSpec(old_spec, params):
60
- """ Create fake target for xcode-ninja wrapper. """
61
- # Determine ninja top level build dir (e.g. /path/to/out).
62
- ninja_toplevel = None
63
- jobs = 0
64
- if params:
65
- options = params["options"]
66
- ninja_toplevel = os.path.join(
67
- options.toplevel_dir, gyp.generator.ninja.ComputeOutputDir(params)
68
- )
69
- jobs = params.get("generator_flags", {}).get("xcode_ninja_jobs", 0)
70
-
71
- target_name = old_spec.get("target_name")
72
- product_name = old_spec.get("product_name", target_name)
73
- product_extension = old_spec.get("product_extension")
74
-
75
- ninja_target = {}
76
- ninja_target["target_name"] = target_name
77
- ninja_target["product_name"] = product_name
78
- if product_extension:
79
- ninja_target["product_extension"] = product_extension
80
- ninja_target["toolset"] = old_spec.get("toolset")
81
- ninja_target["default_configuration"] = old_spec.get("default_configuration")
82
- ninja_target["configurations"] = {}
83
-
84
- # Tell Xcode to look in |ninja_toplevel| for build products.
85
- new_xcode_settings = {}
86
- if ninja_toplevel:
87
- new_xcode_settings["CONFIGURATION_BUILD_DIR"] = (
88
- "%s/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)" % ninja_toplevel
89
- )
90
-
91
- if "configurations" in old_spec:
92
- for config in old_spec["configurations"]:
93
- old_xcode_settings = old_spec["configurations"][config].get(
94
- "xcode_settings", {}
95
- )
96
- if "IPHONEOS_DEPLOYMENT_TARGET" in old_xcode_settings:
97
- new_xcode_settings["CODE_SIGNING_REQUIRED"] = "NO"
98
- new_xcode_settings["IPHONEOS_DEPLOYMENT_TARGET"] = old_xcode_settings[
99
- "IPHONEOS_DEPLOYMENT_TARGET"
100
- ]
101
- for key in ["BUNDLE_LOADER", "TEST_HOST"]:
102
- if key in old_xcode_settings:
103
- new_xcode_settings[key] = old_xcode_settings[key]
104
-
105
- ninja_target["configurations"][config] = {}
106
- ninja_target["configurations"][config][
107
- "xcode_settings"
108
- ] = new_xcode_settings
109
-
110
- ninja_target["mac_bundle"] = old_spec.get("mac_bundle", 0)
111
- ninja_target["mac_xctest_bundle"] = old_spec.get("mac_xctest_bundle", 0)
112
- ninja_target["ios_app_extension"] = old_spec.get("ios_app_extension", 0)
113
- ninja_target["ios_watchkit_extension"] = old_spec.get("ios_watchkit_extension", 0)
114
- ninja_target["ios_watchkit_app"] = old_spec.get("ios_watchkit_app", 0)
115
- ninja_target["type"] = old_spec["type"]
116
- if ninja_toplevel:
117
- ninja_target["actions"] = [
118
- {
119
- "action_name": "Compile and copy %s via ninja" % target_name,
120
- "inputs": [],
121
- "outputs": [],
122
- "action": [
123
- "env",
124
- "PATH=%s" % os.environ["PATH"],
125
- "ninja",
126
- "-C",
127
- new_xcode_settings["CONFIGURATION_BUILD_DIR"],
128
- target_name,
129
- ],
130
- "message": "Compile and copy %s via ninja" % target_name,
131
- },
132
- ]
133
- if jobs > 0:
134
- ninja_target["actions"][0]["action"].extend(("-j", jobs))
135
- return ninja_target
136
-
137
-
138
- def IsValidTargetForWrapper(target_extras, executable_target_pattern, spec):
139
- """Limit targets for Xcode wrapper.
140
-
141
- Xcode sometimes performs poorly with too many targets, so only include
142
- proper executable targets, with filters to customize.
143
- Arguments:
144
- target_extras: Regular expression to always add, matching any target.
145
- executable_target_pattern: Regular expression limiting executable targets.
146
- spec: Specifications for target.
147
- """
148
- target_name = spec.get("target_name")
149
- # Always include targets matching target_extras.
150
- if target_extras is not None and re.search(target_extras, target_name):
151
- return True
152
-
153
- # Otherwise just show executable targets and xc_tests.
154
- if int(spec.get("mac_xctest_bundle", 0)) != 0 or (
155
- spec.get("type", "") == "executable"
156
- and spec.get("product_extension", "") != "bundle"
157
- ):
158
-
159
- # If there is a filter and the target does not match, exclude the target.
160
- if executable_target_pattern is not None:
161
- if not re.search(executable_target_pattern, target_name):
162
- return False
163
- return True
164
- return False
165
-
166
-
167
- def CreateWrapper(target_list, target_dicts, data, params):
168
- """Initialize targets for the ninja wrapper.
169
-
170
- This sets up the necessary variables in the targets to generate Xcode projects
171
- that use ninja as an external builder.
172
- Arguments:
173
- target_list: List of target pairs: 'base/base.gyp:base'.
174
- target_dicts: Dict of target properties keyed on target pair.
175
- data: Dict of flattened build files keyed on gyp path.
176
- params: Dict of global options for gyp.
177
- """
178
- orig_gyp = params["build_files"][0]
179
- for gyp_name, gyp_dict in data.items():
180
- if gyp_name == orig_gyp:
181
- depth = gyp_dict["_DEPTH"]
182
-
183
- # Check for custom main gyp name, otherwise use the default CHROMIUM_GYP_FILE
184
- # and prepend .ninja before the .gyp extension.
185
- generator_flags = params.get("generator_flags", {})
186
- main_gyp = generator_flags.get("xcode_ninja_main_gyp", None)
187
- if main_gyp is None:
188
- (build_file_root, build_file_ext) = os.path.splitext(orig_gyp)
189
- main_gyp = build_file_root + ".ninja" + build_file_ext
190
-
191
- # Create new |target_list|, |target_dicts| and |data| data structures.
192
- new_target_list = []
193
- new_target_dicts = {}
194
- new_data = {}
195
-
196
- # Set base keys needed for |data|.
197
- new_data[main_gyp] = {}
198
- new_data[main_gyp]["included_files"] = []
199
- new_data[main_gyp]["targets"] = []
200
- new_data[main_gyp]["xcode_settings"] = data[orig_gyp].get("xcode_settings", {})
201
-
202
- # Normally the xcode-ninja generator includes only valid executable targets.
203
- # If |xcode_ninja_executable_target_pattern| is set, that list is reduced to
204
- # executable targets that match the pattern. (Default all)
205
- executable_target_pattern = generator_flags.get(
206
- "xcode_ninja_executable_target_pattern", None
207
- )
208
-
209
- # For including other non-executable targets, add the matching target name
210
- # to the |xcode_ninja_target_pattern| regular expression. (Default none)
211
- target_extras = generator_flags.get("xcode_ninja_target_pattern", None)
212
-
213
- for old_qualified_target in target_list:
214
- spec = target_dicts[old_qualified_target]
215
- if IsValidTargetForWrapper(target_extras, executable_target_pattern, spec):
216
- # Add to new_target_list.
217
- target_name = spec.get("target_name")
218
- new_target_name = f"{main_gyp}:{target_name}#target"
219
- new_target_list.append(new_target_name)
220
-
221
- # Add to new_target_dicts.
222
- new_target_dicts[new_target_name] = _TargetFromSpec(spec, params)
223
-
224
- # Add to new_data.
225
- for old_target in data[old_qualified_target.split(":")[0]]["targets"]:
226
- if old_target["target_name"] == target_name:
227
- new_data_target = {}
228
- new_data_target["target_name"] = old_target["target_name"]
229
- new_data_target["toolset"] = old_target["toolset"]
230
- new_data[main_gyp]["targets"].append(new_data_target)
231
-
232
- # Create sources target.
233
- sources_target_name = "sources_for_indexing"
234
- sources_target = _TargetFromSpec(
235
- {
236
- "target_name": sources_target_name,
237
- "toolset": "target",
238
- "default_configuration": "Default",
239
- "mac_bundle": "0",
240
- "type": "executable",
241
- },
242
- None,
243
- )
244
-
245
- # Tell Xcode to look everywhere for headers.
246
- sources_target["configurations"] = {"Default": {"include_dirs": [depth]}}
247
-
248
- # Put excluded files into the sources target so they can be opened in Xcode.
249
- skip_excluded_files = not generator_flags.get(
250
- "xcode_ninja_list_excluded_files", True
251
- )
252
-
253
- sources = []
254
- for target, target_dict in target_dicts.items():
255
- base = os.path.dirname(target)
256
- files = target_dict.get("sources", []) + target_dict.get(
257
- "mac_bundle_resources", []
258
- )
259
-
260
- if not skip_excluded_files:
261
- files.extend(
262
- target_dict.get("sources_excluded", [])
263
- + target_dict.get("mac_bundle_resources_excluded", [])
264
- )
265
-
266
- for action in target_dict.get("actions", []):
267
- files.extend(action.get("inputs", []))
268
-
269
- if not skip_excluded_files:
270
- files.extend(action.get("inputs_excluded", []))
271
-
272
- # Remove files starting with $. These are mostly intermediate files for the
273
- # build system.
274
- files = [file for file in files if not file.startswith("$")]
275
-
276
- # Make sources relative to root build file.
277
- relative_path = os.path.dirname(main_gyp)
278
- sources += [
279
- os.path.relpath(os.path.join(base, file), relative_path) for file in files
280
- ]
281
-
282
- sources_target["sources"] = sorted(set(sources))
283
-
284
- # Put sources_to_index in it's own gyp.
285
- sources_gyp = os.path.join(os.path.dirname(main_gyp), sources_target_name + ".gyp")
286
- fully_qualified_target_name = f"{sources_gyp}:{sources_target_name}#target"
287
-
288
- # Add to new_target_list, new_target_dicts and new_data.
289
- new_target_list.append(fully_qualified_target_name)
290
- new_target_dicts[fully_qualified_target_name] = sources_target
291
- new_data_target = {}
292
- new_data_target["target_name"] = sources_target["target_name"]
293
- new_data_target["_DEPTH"] = depth
294
- new_data_target["toolset"] = "target"
295
- new_data[sources_gyp] = {}
296
- new_data[sources_gyp]["targets"] = []
297
- new_data[sources_gyp]["included_files"] = []
298
- new_data[sources_gyp]["xcode_settings"] = data[orig_gyp].get("xcode_settings", {})
299
- new_data[sources_gyp]["targets"].append(new_data_target)
300
-
301
- # Write workspace to file.
302
- _WriteWorkspace(main_gyp, sources_gyp, params)
303
- return (new_target_list, new_target_dicts, new_data)