peachsim 0.1.1716 → 0.1.1728

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 (234) hide show
  1. package/README.md +21 -3
  2. package/cli/app-bundle-resources.ts +2 -1
  3. package/cli/app-fonts.ts +4 -4
  4. package/cli/app-splash.ts +4 -4
  5. package/cli/app-stubs.ts +17 -0
  6. package/cli/command-registry.ts +1 -0
  7. package/cli/commands/control.ts +82 -822
  8. package/cli/commands/daemon.ts +8 -0
  9. package/cli/commands/detox.ts +3 -0
  10. package/cli/commands/doctor.ts +19 -2
  11. package/cli/commands/inspect/actions.ts +74 -14
  12. package/cli/commands/inspect/core.ts +5 -1
  13. package/cli/commands/inspect/settling.ts +5 -2
  14. package/cli/commands/inspect/wait-ready.ts +6 -0
  15. package/cli/commands/inspect.ts +48 -45
  16. package/cli/commands/kotlin.ts +12 -2
  17. package/cli/commands/package.ts +750 -0
  18. package/cli/commands/serve.ts +6 -0
  19. package/cli/commands/shell-url.ts +834 -0
  20. package/cli/commands/swift.ts +42 -102
  21. package/cli/commands/test.ts +20 -0
  22. package/cli/commands/upload.ts +1 -1
  23. package/cli/device-option.ts +1 -1
  24. package/cli/main.ts +13 -1
  25. package/cli/native-input.ts +199 -0
  26. package/cli/outbound-endpoints.ts +26 -1
  27. package/cli/packaged-app-launcher.ts +95 -0
  28. package/cli/scene-video.ts +13 -6
  29. package/detox/index.ts +187 -23
  30. package/dist-lib/agent-daemon-client.cjs +1 -1
  31. package/dist-lib/agent-events.cjs +1 -1
  32. package/dist-lib/attached-projects.cjs +1 -1
  33. package/dist-lib/auth/shared-session.cjs +1 -1
  34. package/dist-lib/backend-origin.cjs +1 -1
  35. package/dist-lib/beta.cjs +1 -1
  36. package/dist-lib/beta.mjs +1 -1
  37. package/dist-lib/bridge-constants.cjs +1 -1
  38. package/dist-lib/bridge-contract-input.cjs +1 -1
  39. package/dist-lib/bridge-contract-input.mjs +1 -1
  40. package/dist-lib/bridge-contract.cjs +1 -1
  41. package/dist-lib/bridge-contract.mjs +1 -1
  42. package/dist-lib/bundle-channel.cjs +38000 -31658
  43. package/dist-lib/capture-contract.cjs +1 -1
  44. package/dist-lib/capture-contract.mjs +1 -1
  45. package/dist-lib/cloud-contract.cjs +1 -1
  46. package/dist-lib/cloud-contract.mjs +1 -1
  47. package/dist-lib/cloud-test-args.cjs +1 -1
  48. package/dist-lib/cloud-test-args.mjs +1 -1
  49. package/dist-lib/cloud.cjs +1 -1
  50. package/dist-lib/cloud.mjs +1 -1
  51. package/dist-lib/config.cjs +1 -1
  52. package/dist-lib/config.mjs +1 -1
  53. package/dist-lib/detox/index.cjs +184 -60
  54. package/dist-lib/dev-bundle-resolution.cjs +14 -13
  55. package/dist-lib/expo-swift-bundle.cjs +18199 -11834
  56. package/dist-lib/expo-swift-metadata.cjs +4 -1
  57. package/dist-lib/expo-swift-metadata.mjs +3 -1
  58. package/dist-lib/home-paths.cjs +21 -2
  59. package/dist-lib/host/bridge-host.cjs +26509 -23850
  60. package/dist-lib/host/fetch-proxy-handler.cjs +221 -222
  61. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  62. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  63. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  64. package/dist-lib/host/websocket-proxy.cjs +1 -1
  65. package/dist-lib/index.cjs +876 -389
  66. package/dist-lib/jump-to-source-babel.cjs +1 -1
  67. package/dist-lib/jump-to-source-native.cjs +1 -1
  68. package/dist-lib/kotlin-host.cjs +127 -16
  69. package/dist-lib/menu.cjs +7 -1
  70. package/dist-lib/menu.mjs +7 -1
  71. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  72. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  73. package/dist-lib/metro-production-bundle.cjs +1 -1
  74. package/dist-lib/metro-production-bundle.mjs +1 -1
  75. package/dist-lib/metro.cjs +883 -404
  76. package/dist-lib/native-app-identity-project.cjs +694 -280
  77. package/dist-lib/native-app-identity-project.mjs +490 -83
  78. package/dist-lib/native-app-identity.cjs +13 -2
  79. package/dist-lib/native-app-identity.mjs +13 -2
  80. package/dist-lib/native-firebase-metadata.cjs +1 -1
  81. package/dist-lib/native-firebase-metadata.mjs +1 -1
  82. package/dist-lib/plist.cjs +1 -1
  83. package/dist-lib/plist.mjs +1 -1
  84. package/dist-lib/profiles.cjs +1 -1
  85. package/dist-lib/public-brand.cjs +1 -1
  86. package/dist-lib/public-origins-lib-esm.json +28 -23
  87. package/dist-lib/public-origins-lib.json +392 -224
  88. package/dist-lib/react-native-host-modules.cjs +32 -2
  89. package/dist-lib/react-native-host-modules.mjs +32 -2
  90. package/dist-lib/reap-browser.cjs +12 -4
  91. package/dist-lib/scripts/dev-server-scanner.cjs +15 -8
  92. package/dist-lib/sdk.cjs +17 -7
  93. package/dist-lib/sdk.mjs +16 -7
  94. package/dist-lib/skills.cjs +61838 -47851
  95. package/dist-lib/swift-compile.cjs +583 -360
  96. package/dist-lib/swift-compile.mjs +496 -275
  97. package/dist-lib/swift-package.cjs +1 -1
  98. package/dist-lib/swift-package.mjs +1 -1
  99. package/dist-lib/swift-submit.cjs +2 -2
  100. package/dist-lib/swift-submit.mjs +2 -2
  101. package/dist-lib/swift-toolchain.cjs +105 -17
  102. package/dist-lib/swift.cjs +1 -1
  103. package/dist-lib/vite-swift.cjs +4453 -2231
  104. package/dist-lib/vite.cjs +230 -228
  105. package/dist-lib/worklet-executable.cjs +1 -1
  106. package/dist-lib/worklet-executable.mjs +1 -1
  107. package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-cookies.d.ts +17 -8
  108. package/dist-types/packages/peach-engine/src/engine/canvaskit-renderer.d.ts +1 -0
  109. package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +7 -5
  110. package/dist-types/packages/peach-engine/src/engine/memory-counts.d.ts +3 -1
  111. package/dist-types/packages/peach-engine/src/engine/node.d.ts +1 -11
  112. package/dist-types/packages/peach-engine/src/engine/types.d.ts +3 -0
  113. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +9 -0
  114. package/dist-types/packages/peach-engine/src/render-worker/host-service-protocol.d.ts +3 -0
  115. package/dist-types/packages/peach-engine/src/render-worker/native-ui-commandContract.d.ts +1 -1
  116. package/dist-types/packages/peach-engine/src/render-worker/shell-protocol.d.ts +4 -0
  117. package/dist-types/packages/peach-engine/src/render-worker/tree-sync-port.d.ts +1 -1
  118. package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +23 -1
  119. package/dist-types/packages/peach-engine/src/shell-events.d.ts +1 -0
  120. package/dist-types/packages/peach-globals/src/audioBridgeContract.d.ts +5 -0
  121. package/dist-types/packages/peach-globals/src/index.d.ts +1 -1
  122. package/dist-types/packages/peach-globals/src/keyboardBridgeContract.d.ts +11 -0
  123. package/dist-types/packages/peach-globals/src/shellBridgeContract.d.ts +1 -0
  124. package/dist-types/packages/peach-globals/src/testBridgeContract.d.ts +9 -2
  125. package/package.json +1 -1
  126. package/runtime-companion.json +1 -1
  127. package/scripts/dev-server-scanner.ts +12 -25
  128. package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/ASFoundation.h +52 -0
  129. package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/ASWebAuthenticationSession.h +128 -0
  130. package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/ASWebAuthenticationSessionCallback.h +35 -0
  131. package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/AuthenticationServices.h +3 -0
  132. package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Modules/module.modulemap +5 -0
  133. package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPMessage.h +724 -0
  134. package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h +4 -0
  135. package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkDefs.h +27 -0
  136. package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Modules/module.modulemap +5 -0
  137. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h +1301 -0
  138. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h +2 -0
  139. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationManager.h +21 -50
  140. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLRegion.h +6 -6
  141. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +75 -9
  142. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h +12 -0
  143. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIInterface.h +23 -0
  144. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h +7 -9
  145. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIOrientation.h +14 -0
  146. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIStringDrawing.h +12 -0
  147. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIView.h +14 -0
  148. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIViewAnimating.h +12 -0
  149. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIViewController.h +16 -0
  150. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIWindow.h +2 -0
  151. package/sdk/ios/usr/include/ConditionalMacros.h +619 -0
  152. package/sdk/ios/usr/include/module.modulemap +1 -0
  153. package/sdk/ios/usr/include/objc/objc-sync.h +59 -0
  154. package/sdk/ios/usr/include/os.modulemap +5 -0
  155. package/sdk/ios/usr/include/sys/cdefs.h +5 -0
  156. package/sdk/ios/usr/include/sys/ioccom.h +99 -0
  157. package/sdk/ios/usr/include/sys/syslog.h +236 -0
  158. package/sdk/ios/usr/include/syslog.h +24 -0
  159. package/sdk/ios/wasm/include/fcntl.h +4 -2
  160. package/sdk/ios/wasm/include/stdio.h +24 -0
  161. package/sdk/ios/wasm/include/stdlib.h +32 -7
  162. package/sdk/ios/wasm/include/sys/file.h +7 -0
  163. package/sdk/ios/wasm/include/sys/ioctl.h +6 -0
  164. package/sdk/ios/wasm/include/sys/syscall.h +9 -0
  165. package/sdk/ios/wasm/include/sys/time.h +10 -0
  166. package/sdk/ios/wasm/include/unistd.h +12 -3
  167. package/sdk/native-hashes.json +1 -0
  168. package/skills/contrast/SKILL.md +2 -1
  169. package/skills/peach-test/SKILL.md +7 -3
  170. package/src/admitted-mac-build.ts +3 -0
  171. package/src/android-app-identity.ts +18 -0
  172. package/src/android-root-module.ts +9 -9
  173. package/src/appPackageContract.ts +81 -0
  174. package/src/bridge-contract.ts +50 -0
  175. package/src/bundle-channel.mjs +21 -4
  176. package/src/dev-bundle-resolution.ts +7 -27
  177. package/src/dom-source-reference.ts +15 -0
  178. package/src/expo-discovery-cache.ts +127 -23
  179. package/src/expo-manifest-body.ts +33 -0
  180. package/src/expo-native-workspace.ts +38 -13
  181. package/src/expo-swift-host.ts +264 -62
  182. package/src/expoSwiftContract.ts +3 -0
  183. package/src/generated/swift-c-predefines.json +1 -1
  184. package/src/home-paths.ts +35 -1
  185. package/src/host/app-package-handler.ts +47 -0
  186. package/src/host/bridge-host.ts +3 -0
  187. package/src/host/staged-host-files.ts +18 -0
  188. package/src/index.ts +3 -0
  189. package/src/kotlin-host.ts +21 -18
  190. package/src/kotlin-instance-source.ts +126 -0
  191. package/src/menu.ts +7 -0
  192. package/src/native-app-identity-project.ts +7 -2
  193. package/src/native-app-identity.ts +11 -0
  194. package/src/native-firebase-config.ts +24 -1
  195. package/src/nitro-adapter.lock.json +268 -268
  196. package/src/nitro-bundle.ts +8 -0
  197. package/src/nitro-compile.ts +35 -9
  198. package/src/nitro-dependencies.ts +21 -19
  199. package/src/nitro-source.ts +4 -0
  200. package/src/nitroContract.ts +7 -0
  201. package/src/react-native-bridge-modules.ts +68 -42
  202. package/src/react-native-host-modules.ts +31 -1
  203. package/src/reactNativeConfigurationContract.ts +14 -0
  204. package/src/reap-browser.ts +15 -3
  205. package/src/sdk.ts +5 -0
  206. package/src/settingsContract.ts +27 -1
  207. package/src/sim-client.ts +4 -1
  208. package/src/storageSnapshotContract.ts +3 -0
  209. package/src/swift-compile.ts +221 -41
  210. package/src/swift-coverage/provenance.ts +1 -0
  211. package/src/swift-coverage/xcode-asset-symbols.ts +922 -0
  212. package/src/swift-coverage/xcode-assets.ts +89 -131
  213. package/src/swift-coverage/xcode.ts +1 -1
  214. package/src/swift-cxx-reachable.ts +2 -1
  215. package/src/swift-distribution.lock.json +14 -13
  216. package/src/swift-host.ts +95 -22
  217. package/src/swift-icu.ts +1 -1
  218. package/src/swift-link-roots.ts +118 -0
  219. package/src/swift-objc-compile.ts +144 -22
  220. package/src/swift-objc-import.ts +6 -0
  221. package/src/swift-objc-standin.ts +2 -14
  222. package/src/swift-package-manifest.ts +14 -6
  223. package/src/swift-packages.ts +75 -11
  224. package/src/swift-pdf-raster.ts +1 -0
  225. package/src/swift-root-lock.ts +17 -1
  226. package/src/swift-source-pods.ts +2 -10
  227. package/src/swift-standin-emit.ts +592 -57
  228. package/src/swift-standins.ts +430 -49
  229. package/src/swift-submit.ts +3 -1
  230. package/src/swift-toolchain.ts +140 -17
  231. package/src/turbo-codegen-intake.ts +91 -0
  232. package/src/vite-plugin-one.ts +13 -9
  233. package/src/vite-plugin.ts +28 -15
  234. package/src/xcode-project.ts +223 -22
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1716 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1728 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -36,8 +36,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
36
36
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
37
 
38
38
  // <define:__SWIFT_COVERAGE_SOURCE_DIGESTS__>
39
+ var define_SWIFT_COVERAGE_SOURCE_DIGESTS_default;
39
40
  var init_define_SWIFT_COVERAGE_SOURCE_DIGESTS = __esm({
40
41
  "<define:__SWIFT_COVERAGE_SOURCE_DIGESTS__>"() {
42
+ define_SWIFT_COVERAGE_SOURCE_DIGESTS_default = { "swift-coverage/indexdump.ts": "1ecc9c90d7e293f9bdc57db5bf90f6670d2aed8f8f9bd647cd55b2c70347aa38", "swift-coverage/indexing.ts": "02b9e91dcee1f48b74bcc8e35fe5dda5442fa235221faf82f0cbaa416a7d5409", "swift-coverage/types.ts": "cfc696535808957bd491dc5f5eefc991f65395eb6fc7ea377c31a12b5c4c3b57", "swift-coverage/source.ts": "8b398ceb60faf4a5729842cab60f49c2e601d6fc6bbbc1faec9023ecb8141990", "swift-coverage/package.ts": "1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b", "swift-coverage/xcode.ts": "9b9efa33fcd6d78e3ab4218b0340a6bf96832faa98ea04f3966167f691043462", "swift-coverage/xcode-assets.ts": "f674c68408df22bff2ac80c89467b6cf4018c7e4ada6f2408d7b5f98ee83289d", "swift-coverage/xcode-asset-symbols.ts": "b94c5836f6f11c400c93b931ed0a980b8067d84a5f7a1ee75f24d6bdbf46013d", "swift-coverage/xcode-bridging.ts": "33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11", "swift-coverage/xcode-packages.ts": "b112ed694771c1df8d9f4dd86691ee83fc9302f05690fae9a5151d0623191b0b", "swift-coverage/xcode-strings.ts": "f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c", "swift-coverage/reader.ts": "da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c", "swift-coverage/provenance.ts": "eb3b41ae8b58b48f6758f084800f188dfb1edb227e483abdd6b80cde66e849b9", "swift-package-manifest.ts": "d9170f454c21b88b10902e601998b42179b94a8a2018f51f92f9ddafdfcfd8f6", "swift-package.ts": "36c0beef4686796e700a479135c58b1680dc30f73e2b6107891898aa46db33b0", "swift-source-file.ts": "7653751b3edfd63479f733427b6767847de0cd2267715c14dc18d6e5233c3a91", "swift-toolchain.ts": "3142399c278b7759ddd50c33a5569bb1a4eab38d19b3f0923064907c90e08e27", "home-paths.ts": "20c49992c57b1e7d279454ff4587208ae3d888bb2e318674a6d405750cdbdc24", "xcode-header-search.ts": "1cfadaf2b1b29fbd72899716fc2469b6b6ca39d6c2b61fee9927fb28668967c5", "xcode-project.ts": "64d7996165ac049f4baa8b04242d4550639c9c5de7d12f61ad0d05f58857d39d", "xcode-target-members.ts": "94e7daaf57b351aa716b2c49e39c5dec8db5377d938a4f16f2d88d9099813c35", "xcode-json-project.ts": "41990ebbe4b488eef34e74c4608b4b48e5a5b299ba98ca7fbcfdfa0e77be63b6", "openstep-plist.ts": "74e6ce1dac80c9c318e0e9f5e3e8cd19a898a8820c36fc160609695bcb59dcd3" };
41
43
  }
42
44
  });
43
45
 
@@ -1169,9 +1171,9 @@ __export(native_app_identity_project_exports, {
1169
1171
  });
1170
1172
  module.exports = __toCommonJS(native_app_identity_project_exports);
1171
1173
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
1172
- var import_node_fs4 = __toESM(require("node:fs"), 1);
1174
+ var import_node_fs5 = __toESM(require("node:fs"), 1);
1173
1175
  var import_node_module = require("node:module");
1174
- var import_node_path6 = __toESM(require("node:path"), 1);
1176
+ var import_node_path7 = __toESM(require("node:path"), 1);
1175
1177
 
1176
1178
  // src/android-app-identity.ts
1177
1179
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
@@ -1308,6 +1310,13 @@ function nativeAppIdentityFromAndroidManifest(source, file, files = {}) {
1308
1310
  ...max === void 0 ? {} : { maxSdkVersion: Number(max) }
1309
1311
  });
1310
1312
  }
1313
+ let androidPhotoLibraryAddOnly;
1314
+ for (const element of application.children) {
1315
+ if (element.name !== "meta-data" || element.attributes[`${attribute}name`] !== "one.photoLibrary.addOnly")
1316
+ continue;
1317
+ if (/^(?:true|True|TRUE)$/.test(element.attributes[`${attribute}value`]?.trim() ?? ""))
1318
+ androidPhotoLibraryAddOnly = true;
1319
+ }
1311
1320
  let label = application.attributes[`${attribute}label`];
1312
1321
  let applicationName = null;
1313
1322
  if (label && !/\$\{|^[@?]/.test(label)) applicationName = label;
@@ -1346,7 +1355,8 @@ function nativeAppIdentityFromAndroidManifest(source, file, files = {}) {
1346
1355
  buildVersion,
1347
1356
  bundleIdentifier,
1348
1357
  platform: "android",
1349
- androidManifestPermissions
1358
+ androidManifestPermissions,
1359
+ ...androidPhotoLibraryAddOnly === void 0 ? {} : { androidPhotoLibraryAddOnly }
1350
1360
  };
1351
1361
  }
1352
1362
  function androidMergedResourceValuesDirectory(manifestFile) {
@@ -1550,7 +1560,7 @@ function parseOpenStepPlist(text2) {
1550
1560
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
1551
1561
  var NEVER_MEMBER = /(?:^|\/)(?:Info\.plist|[^/]+\.entitlements|[^/]+\.xcconfig|\.DS_Store)$/;
1552
1562
  var BUNDLE_DIR = /\.(xcassets|bundle|lproj|xcdatamodeld|scnassets|spriteatlas|rcproject|storyboardc|icon)$/;
1553
- function xcodePathResolver(objects, projectDir, join) {
1563
+ function xcodePathResolver(objects, projectDir, join2) {
1554
1564
  const parents = /* @__PURE__ */ new Map();
1555
1565
  for (const [id, entry] of Object.entries(objects)) {
1556
1566
  if (!isDict(entry)) continue;
@@ -1568,11 +1578,11 @@ function xcodePathResolver(objects, projectDir, join) {
1568
1578
  const own = str(entry.path) ?? "";
1569
1579
  const tree = str(entry.sourceTree) ?? "<group>";
1570
1580
  if (tree === "<absolute>") result = own;
1571
- else if (tree === "SOURCE_ROOT") result = join(projectDir, own);
1581
+ else if (tree === "SOURCE_ROOT") result = join2(projectDir, own);
1572
1582
  else if (tree === "<group>") {
1573
1583
  const parent = parents.get(id);
1574
1584
  const base = parent ? resolve(parent) : projectDir;
1575
- if (base !== null) result = join(base, own);
1585
+ if (base !== null) result = join2(base, own);
1576
1586
  }
1577
1587
  }
1578
1588
  paths.set(id, result);
@@ -1580,7 +1590,7 @@ function xcodePathResolver(objects, projectDir, join) {
1580
1590
  };
1581
1591
  return resolve;
1582
1592
  }
1583
- function visitXcodeTargetMembers(objects, targetId, resolvePath, filesUnder, join, visit) {
1593
+ function visitXcodeTargetMembers(objects, targetId, resolvePath, filesUnder, join2, visit) {
1584
1594
  const target = objects[targetId];
1585
1595
  if (!isDict(target)) return;
1586
1596
  for (const phaseId of list(target.buildPhases)) {
@@ -1616,7 +1626,7 @@ function visitXcodeTargetMembers(objects, targetId, resolvePath, filesUnder, joi
1616
1626
  for (const relative of list(exception.membershipExceptions))
1617
1627
  exceptions.add(relative);
1618
1628
  }
1619
- const members = owned.has(groupId) ? filesUnder(folder) : [...exceptions].flatMap((relative) => filesUnder(join(folder, relative)));
1629
+ const members = owned.has(groupId) ? filesUnder(folder) : [...exceptions].flatMap((relative) => filesUnder(join2(folder, relative)));
1620
1630
  for (const file of members) {
1621
1631
  const relative = file.slice(prefix.length);
1622
1632
  const excepted = [...exceptions].some(
@@ -1992,7 +2002,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
1992
2002
  if (resourceUri) {
1993
2003
  if (!selectedTarget)
1994
2004
  throw new Error("native app icon target membership is unresolved");
1995
- const join = (base, own) => {
2005
+ const join2 = (base, own) => {
1996
2006
  const segments = [];
1997
2007
  for (const segment of `${base}/${own}`.split("/")) {
1998
2008
  if (segment === "" || segment === ".") continue;
@@ -2005,7 +2015,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
2005
2015
  const project = Object.values(objects).find(
2006
2016
  (object) => isRecord(object) && object.isa === "PBXProject"
2007
2017
  );
2008
- const projectDir = join(
2018
+ const projectDir = join2(
2009
2019
  pbxprojPath.replace(/(?:^|\/)[^/]+\.xcodeproj\/project\.pbxproj$/, ""),
2010
2020
  isRecord(project) && typeof project.projectDirPath === "string" ? project.projectDirPath : ""
2011
2021
  );
@@ -2013,7 +2023,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
2013
2023
  visitXcodeTargetMembers(
2014
2024
  objects,
2015
2025
  selectedTarget.id,
2016
- xcodePathResolver(objects, projectDir, join),
2026
+ xcodePathResolver(objects, projectDir, join2),
2017
2027
  (file) => {
2018
2028
  if (Object.hasOwn(files, file)) return [file];
2019
2029
  const prefix = file === "" ? "" : `${file.replace(/\/$/, "")}/`;
@@ -2021,7 +2031,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
2021
2031
  (path7) => path7.startsWith(prefix) && !/(?:^|\/)\./.test(path7.slice(prefix.length))
2022
2032
  );
2023
2033
  },
2024
- join,
2034
+ join2,
2025
2035
  (file, kind) => {
2026
2036
  if (kind === "resource") resources.add(file);
2027
2037
  }
@@ -2123,18 +2133,213 @@ function parsePlistSource(source) {
2123
2133
  // src/xcode-project.ts
2124
2134
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
2125
2135
  var import_node_child_process2 = require("node:child_process");
2126
- var import_node_crypto = require("node:crypto");
2127
- var import_node_fs3 = __toESM(require("node:fs"), 1);
2128
- var import_node_path5 = __toESM(require("node:path"), 1);
2136
+ var import_node_crypto2 = require("node:crypto");
2137
+ var import_node_fs4 = __toESM(require("node:fs"), 1);
2138
+ var import_node_path6 = __toESM(require("node:path"), 1);
2129
2139
  var import_plist2 = __toESM(require("plist"), 1);
2130
2140
 
2131
2141
  // src/swift-coverage/xcode-assets.ts
2132
2142
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
2133
- var assetSymbolSettingKeys = [
2134
- "ASSETCATALOG_COMPILER_GENERATE_ASSET_SYMBOLS",
2135
- "ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS",
2136
- "PRODUCT_BUNDLE_IDENTIFIER",
2137
- "TARGETED_DEVICE_FAMILY",
2143
+
2144
+ // src/swift-coverage/provenance.ts
2145
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
2146
+ var import_node_crypto = require("node:crypto");
2147
+ var import_node_fs = require("node:fs");
2148
+ var import_node_path = require("node:path");
2149
+ var SWIFT_COVERAGE_DIGEST_SOURCES = [
2150
+ "swift-coverage/indexdump.ts",
2151
+ "swift-coverage/indexing.ts",
2152
+ "swift-coverage/types.ts",
2153
+ "swift-coverage/source.ts",
2154
+ "swift-coverage/package.ts",
2155
+ "swift-coverage/xcode.ts",
2156
+ "swift-coverage/xcode-assets.ts",
2157
+ "swift-coverage/xcode-asset-symbols.ts",
2158
+ "swift-coverage/xcode-bridging.ts",
2159
+ "swift-coverage/xcode-packages.ts",
2160
+ "swift-coverage/xcode-strings.ts",
2161
+ "swift-coverage/reader.ts",
2162
+ "swift-coverage/provenance.ts",
2163
+ "swift-package-manifest.ts",
2164
+ "swift-package.ts",
2165
+ "swift-source-file.ts",
2166
+ "swift-toolchain.ts",
2167
+ "home-paths.ts",
2168
+ "xcode-header-search.ts",
2169
+ "xcode-project.ts",
2170
+ "xcode-target-members.ts",
2171
+ "xcode-json-project.ts",
2172
+ "openstep-plist.ts"
2173
+ ];
2174
+ function swiftCoverageSourceDigests(srcDir) {
2175
+ return Object.fromEntries(
2176
+ SWIFT_COVERAGE_DIGEST_SOURCES.map((file) => [
2177
+ file,
2178
+ (0, import_node_crypto.createHash)("sha256").update((0, import_node_fs.readFileSync)((0, import_node_path.join)(srcDir, file))).digest("hex")
2179
+ ])
2180
+ );
2181
+ }
2182
+ var swiftCoverageProvenance = typeof define_SWIFT_COVERAGE_SOURCE_DIGESTS_default === "object" ? define_SWIFT_COVERAGE_SOURCE_DIGESTS_default : swiftCoverageSourceDigests((0, import_node_path.join)(__sootsim_import_meta_dirname, ".."));
2183
+
2184
+ // src/swift-coverage/xcode-asset-symbols.ts
2185
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
2186
+ var silentTypes = /* @__PURE__ */ new Set([
2187
+ "appiconset",
2188
+ "brandassets",
2189
+ "dataset",
2190
+ "iconset",
2191
+ "iconstack",
2192
+ "iconstackgroup",
2193
+ "launchimage",
2194
+ "stickerpack",
2195
+ "stickersiconset",
2196
+ "textureset"
2197
+ ]);
2198
+ var stackTypes = /* @__PURE__ */ new Set(["imagestack", "solidimagestack"]);
2199
+ var unprovenTypes = /* @__PURE__ */ new Set([
2200
+ "arobject",
2201
+ "arreferenceimage",
2202
+ "arresourcegroup",
2203
+ "complicationset",
2204
+ "cubetextureset",
2205
+ "gcdashboardimage",
2206
+ "gcleaderboard",
2207
+ "gcleaderboardset",
2208
+ "glyphset",
2209
+ "iconbadgeset",
2210
+ "iconstacklayer",
2211
+ "imagestacklayer",
2212
+ "mipmapset",
2213
+ "modelset",
2214
+ "sidebariconset",
2215
+ "solidimagestacklayer",
2216
+ "sticker",
2217
+ "stickerframeset",
2218
+ "stickersequence"
2219
+ ]);
2220
+ var knownTypes = /* @__PURE__ */ new Set([
2221
+ "colorset",
2222
+ "imageset",
2223
+ "symbolset",
2224
+ "spriteatlas",
2225
+ ...silentTypes,
2226
+ ...stackTypes,
2227
+ ...unprovenTypes
2228
+ ]);
2229
+ var compressionTypes = [
2230
+ "automatic",
2231
+ "lossless",
2232
+ "lossy",
2233
+ "gpu-optimized-best",
2234
+ "gpu-optimized-smallest"
2235
+ ];
2236
+ var renditionRules = {
2237
+ appearances: "objects",
2238
+ locale: "string",
2239
+ platform: "string",
2240
+ resizing: "object",
2241
+ "alignment-insets": "object",
2242
+ "compression-type": compressionTypes,
2243
+ "display-gamut": ["sRGB", "display-P3"],
2244
+ "minimum-system-version": "string",
2245
+ "matching-style": "string",
2246
+ "template-rendering-intent": "string",
2247
+ size: "string",
2248
+ role: "string",
2249
+ orientation: "string",
2250
+ extent: "string"
2251
+ };
2252
+ var setRules = {
2253
+ localizable: "any",
2254
+ "auto-scaling": "string",
2255
+ "symbol-rendering-intent": "string",
2256
+ "provides-namespace": "any",
2257
+ "on-demand-resource-tags": "any",
2258
+ "template-rendering-intent": "string",
2259
+ "preserves-vector-representation": "any"
2260
+ };
2261
+ var inclusionRules = {
2262
+ idiom: "any",
2263
+ subtype: "any",
2264
+ unassigned: "any"
2265
+ };
2266
+ var rules = {
2267
+ // colors check none of the image traits
2268
+ colorset: {
2269
+ entry: {
2270
+ ...renditionRules,
2271
+ ...inclusionRules,
2272
+ color: "any",
2273
+ scale: "string",
2274
+ "language-direction": "string",
2275
+ "width-class": "string",
2276
+ "height-class": "string",
2277
+ memory: "string",
2278
+ "graphics-feature-set": "string",
2279
+ "screen-width": "string"
2280
+ },
2281
+ set: setRules
2282
+ },
2283
+ imageset: {
2284
+ entry: {
2285
+ ...renditionRules,
2286
+ ...inclusionRules,
2287
+ filename: "any",
2288
+ scale: ["1x", "2x", "3x"],
2289
+ "language-direction": ["left-to-right", "right-to-left"],
2290
+ "width-class": ["compact", "regular", "unspecified"],
2291
+ "height-class": ["compact", "regular"],
2292
+ memory: ["1GB", "2GB", "3GB", "4GB", "6GB", "8GB", "12GB", "16GB"],
2293
+ "graphics-feature-set": [
2294
+ ...Array.from({ length: 10 }, (_, i) => `apple${i + 1}`),
2295
+ "metal1v2",
2296
+ "metal2v2",
2297
+ "metal3v1",
2298
+ "metal3v2",
2299
+ "metal4v1"
2300
+ ],
2301
+ "screen-width": "string"
2302
+ },
2303
+ // an image whose vector flag is not a boolean is dropped
2304
+ set: {
2305
+ ...setRules,
2306
+ "preserves-vector-representation": "boolean",
2307
+ "compression-type": compressionTypes
2308
+ }
2309
+ },
2310
+ symbolset: {
2311
+ entry: { idiom: "any", filename: "any" },
2312
+ set: { "symbol-rendering-intent": "any" }
2313
+ }
2314
+ };
2315
+ var swiftKeywords = new Set(
2316
+ "precedencegroup associatedtype fileprivate fallthrough extension typealias subscript continue internal Protocol protocol operator rethrows private default public static switch return throws repeat struct deinit import guard while where false catch break defer super class inout throw func Type case else true Self self enum init nil var for let Any try if in do as is _".split(
2317
+ " "
2318
+ )
2319
+ );
2320
+ var nsColorConflicts = new Set(
2321
+ "unemphasizedSelectedContentBackgroundColor unemphasizedSelectedTextBackgroundColor controlAlternatingRowBackgroundColors alternatingContentBackgroundColors systemColorsDidChangeNotification alternateSelectedControlTextColor selectedContentBackgroundColor alternateSelectedControlColor secondarySelectedControlColor unemphasizedSelectedTextColor selectedTextBackgroundColor keyboardFocusIndicatorColor scrubberTexturedBackground controlLightHighlightColor selectedMenuItemTextColor underPageBackgroundColor disabledControlTextColor selectedControlTextColor controlBackgroundColor controlDarkShadowColor windowBackgroundColor selectedMenuItemColor controlHighlightColor quaternaryLabelColor selectedControlColor windowFrameTextColor placeholderTextColor textBackgroundColor secondaryLabelColor tertiaryLabelColor findHighlightColor controlAccentColor controlShadowColor currentControlTint selectedKnobColor selectedTextColor windowFrameColor controlTextColor headerTextColor scrollBarColor separatorColor highlightColor ignoresAlpha systemOrange systemPurple systemIndigo controlColor systemYellow systemGreen systemBrown headerColor shadowColor systemBlue systemPink systemTeal systemCyan labelColor systemMint systemGray systemRed knobColor gridColor linkColor textColor lightGray darkGray magenta orange purple yellow white black green brown clear blue cyan gray red".split(
2322
+ " "
2323
+ )
2324
+ );
2325
+ var uiColorConflicts = new Set(
2326
+ "secondarySystemGroupedBackground tertiarySystemGroupedBackground secondarySystemBackground tertiarySystemBackground groupTableViewBackground systemGroupedBackground quaternarySystemFill smallSystemFontSize secondarySystemFill tertiarySystemFill systemBackground quaternaryLabel opaqueSeparator placeholderText systemFontSize buttonFontSize secondaryLabel labelFontSize tertiaryLabel systemOrange systemPurple systemIndigo systemYellow systemGray2 systemGray3 systemGray4 systemGray5 systemGray6 systemGreen systemBrown systemBlue systemPink systemTeal systemFill systemCyan systemMint systemGray systemRed tintColor separator lightText lightGray darkText darkGray magenta orange purple yellow white black label green brown clear blue link cyan gray red".split(
2327
+ " "
2328
+ )
2329
+ );
2330
+ var colorConflicts = new Set(
2331
+ "transferRepresentation accentColor secondary primary orange purple indigo yellow white black green brown clear blue pink teal cyan mint gray red".split(
2332
+ " "
2333
+ )
2334
+ );
2335
+ var nsImageConflicts = new Set(
2336
+ "touchBarAudioOutputVolumeMediumTemplateName touchBarAudioOutputVolumeHighTemplateName touchBarAudioOutputVolumeOffTemplateName touchBarAudioOutputVolumeLowTemplateName touchBarTextJustifiedAlignTemplateName touchBarCommunicationVideoTemplateName touchBarCommunicationAudioTemplateName touchBarSkipAhead30SecondsTemplateName touchBarSkipAhead15SecondsTemplateName touchBarTextStrikethroughTemplateName touchBarSkipBack30SecondsTemplateName touchBarSkipBack15SecondsTemplateName stopProgressFreestandingTemplateName touchBarAudioOutputMuteTemplateName invalidDataFreestandingTemplateName touchBarEnterFullScreenTemplateName touchBarTextCenterAlignTemplateName touchBarAudioInputMuteTemplateName followLinkFreestandingTemplateName touchBarExitFullScreenTemplateName touchBarTextRightAlignTemplateName touchBarTextUnderlineTemplateName touchBarTextLeftAlignTemplateName touchBarOpenInBrowserTemplateName touchBarFolderMoveToTemplateName touchBarFolderCopyToTemplateName touchBarFastForwardTemplateName rightFacingTriangleTemplateName refreshFreestandingTemplateName touchBarRotateRightTemplateName touchBarRecordStartTemplateName touchBarSkipToStartTemplateName touchBarTextItalicTemplateName touchBarNewMessageTemplateName leftFacingTriangleTemplateName revealFreestandingTemplateName touchBarVolumeDownTemplateName touchBarRecordStopTemplateName touchBarRotateLeftTemplateName touchBarAudioInputTemplateName touchBarColorPickerStrokeName touchBarSkipAheadTemplateName touchBarSkipToEndTemplateName touchBarGoForwardTemplateName touchBarPlayPauseTemplateName touchBarQuickLookTemplateName touchBarAddDetailTemplateName touchBarUserGroupTemplateName touchBarNewFolderTemplateName touchBarBookmarksTemplateName touchBarSlideshowTemplateName statusPartiallyAvailableName touchBarPlayheadTemplateName touchBarDownloadTemplateName touchBarTextBoldTemplateName touchBarSkipBackTemplateName touchBarVolumeUpTemplateName touchBarTextListTemplateName touchBarIconViewTemplateName touchBarListViewTemplateName touchBarUserAddTemplateName touchBarComposeTemplateName touchBarRefreshTemplateName enterFullScreenTemplateName touchBarTagIconTemplateName touchBarGetInfoTemplateName touchBarSidebarTemplateName touchBarTextBoxTemplateName touchBarHistoryTemplateName touchBarColorPickerFillName touchBarColorPickerFontName touchBarRewindTemplateName menuMixedStateTemplateName touchBarDeleteTemplateName touchBarRemoveTemplateName touchBarSearchTemplateName touchBarGoBackTemplateName exitFullScreenTemplateName touchBarGoDownTemplateName touchBarFolderTemplateName touchBarShareTemplateName touchBarPauseTemplateName touchBarAlarmTemplateName lockUnlockedTemplateName touchBarMailTemplateName touchBarGoUpTemplateName touchBarUserTemplateName iChatTheaterTemplateName stopProgressTemplateName touchBarPlayTemplateName touchBarAddTemplateName menuOnStateTemplateName lockLockedTemplateName smartBadgeTemplateName columnViewTemplateName preferencesGeneralName statusUnavailableName goForwardTemplateName bluetoothTemplateName quickLookTemplateName bookmarksTemplateName slideshowTemplateName multipleDocumentsName iconViewTemplateName listViewTemplateName flowViewTemplateName imageUnfilteredTypes statusAvailableName refreshTemplateName goRightTemplateName applicationIconName folderBurnableName removeTemplateName goBackTemplateName actionTemplateName goLeftTemplateName shareTemplateName homeTemplateName pathTemplateName userAccountsName addTemplateName folderSmartName statusNoneName colorPanelName trashEmptyName fontPanelName trashFullName userGroupName userGuestName advancedName mobileMeName everyoneName computerName networkName cautionName bonjourName folderName imageTypes infoName userName".split(
2337
+ " "
2338
+ )
2339
+ );
2340
+
2341
+ // src/swift-coverage/xcode-assets.ts
2342
+ var unprovenAssetSettings = [
2138
2343
  "ASSETCATALOG_COMPILER_GENERATE_ASSET_SYMBOL_FRAMEWORKS",
2139
2344
  "ASSETCATALOG_COMPILER_GENERATE_ASSET_SYMBOL_WARNINGS",
2140
2345
  "ASSETCATALOG_COMPILER_GENERATE_ASSET_SYMBOL_ERRORS",
@@ -2143,10 +2348,16 @@ var assetSymbolSettingKeys = [
2143
2348
  "ASSETCATALOG_COMPILER_GENERATE_OBJC_ASSET_SYMBOLS_PATH",
2144
2349
  "ASSETCATALOG_COMPILER_GENERATE_ASSET_SYMBOL_INDEX_PATH",
2145
2350
  "ASSETCATALOG_COMPILER_BUNDLE_IDENTIFIER",
2146
- "ASSETCATALOG_COMPILER_LIGHTWEIGHT_ASSET_RUNTIME_MODE",
2351
+ "ASSETCATALOG_COMPILER_LIGHTWEIGHT_ASSET_RUNTIME_MODE"
2352
+ ];
2353
+ var assetSymbolSettingKeys = [
2354
+ "ASSETCATALOG_COMPILER_GENERATE_ASSET_SYMBOLS",
2355
+ "ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS",
2356
+ "PRODUCT_BUNDLE_IDENTIFIER",
2357
+ "TARGETED_DEVICE_FAMILY",
2358
+ ...unprovenAssetSettings,
2147
2359
  "ASSETCATALOG_OTHER_FLAGS"
2148
2360
  ];
2149
- var unprovenAssetSettings = assetSymbolSettingKeys.slice(4).filter((key) => key !== "ASSETCATALOG_OTHER_FLAGS");
2150
2361
 
2151
2362
  // src/swift-package.ts
2152
2363
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
@@ -2194,40 +2405,49 @@ function swiftPackageIdentity(url) {
2194
2405
  // src/swift-package-manifest.ts
2195
2406
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
2196
2407
  var import_node_child_process = require("node:child_process");
2197
- var import_node_fs2 = __toESM(require("node:fs"), 1);
2408
+ var import_node_fs3 = __toESM(require("node:fs"), 1);
2198
2409
  var import_node_os3 = __toESM(require("node:os"), 1);
2199
- var import_node_path3 = __toESM(require("node:path"), 1);
2410
+ var import_node_path4 = __toESM(require("node:path"), 1);
2200
2411
 
2201
2412
  // src/home-paths.ts
2202
2413
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
2203
2414
  var import_node_os = require("node:os");
2204
- var import_node_path = __toESM(require("node:path"), 1);
2415
+ var import_node_path2 = __toESM(require("node:path"), 1);
2205
2416
  var PEACH_HOME_ENV = "PEACH_HOME";
2206
2417
  function rnxHomeDir() {
2207
2418
  const override = process.env[PEACH_HOME_ENV];
2208
- if (override && override.length > 0) return import_node_path.default.resolve(override);
2209
- return import_node_path.default.join((0, import_node_os.homedir)(), ".peach");
2419
+ if (override && override.length > 0) return import_node_path2.default.resolve(override);
2420
+ return import_node_path2.default.join((0, import_node_os.homedir)(), ".peach");
2210
2421
  }
2211
2422
  function cacheDir() {
2212
- return import_node_path.default.join(rnxHomeDir(), "cache");
2423
+ return import_node_path2.default.join(rnxHomeDir(), "cache");
2424
+ }
2425
+ var BUILDERS_ROOT_ENV = "CONTRAST_BUILDERS_ROOT";
2426
+ function buildersRootEnv() {
2427
+ const root = process.env[BUILDERS_ROOT_ENV]?.trim();
2428
+ return root ? root : null;
2429
+ }
2430
+ function swiftCacheDir() {
2431
+ const root = buildersRootEnv();
2432
+ return root ? import_node_path2.default.join(root, "peach-cache") : cacheDir();
2213
2433
  }
2214
2434
  function swiftPackageCacheOptions() {
2215
- const root = import_node_path.default.join(cacheDir(), "swiftpm");
2435
+ const root = import_node_path2.default.join(swiftCacheDir(), "swiftpm");
2216
2436
  return ["cache", "config", "security"].flatMap((name) => [
2217
2437
  `--${name}-path`,
2218
- import_node_path.default.join(root, name)
2438
+ import_node_path2.default.join(root, name)
2219
2439
  ]);
2220
2440
  }
2221
2441
  var DAEMON_LOCKFILE_MAX_BYTES = 16 * 1024;
2222
2442
 
2223
2443
  // src/swift-distribution.lock.json
2224
2444
  var swift_distribution_lock_default = {
2225
- id: "d2c6d715951f5e98",
2226
- release: "swift-6.4.0-RELEASE-custom-ecd2ad9d3fe59329",
2445
+ id: "95a0e12e7c0af807",
2446
+ release: "swift-6.4.0-RELEASE-custom-0b2d0a9011c88e66",
2227
2447
  wasmSdkId: "swift-6.4.0-RELEASE_wasm-peach-cbf01f4b",
2228
2448
  wasmSdkUrl: "https://r2.sootsim.com/swift-wasm-sdk/swift-6.4.0-RELEASE_wasm-peach-cbf01f4b.artifactbundle.tar.gz",
2229
2449
  wasmSdkChecksum: "2243db65b12743d577fecc6aa27761363ccef470202f1fef2582e58750c0da4f",
2230
- source: "723697c8df030077d06e7e760259e494f6a1c5a8",
2450
+ source: "56ee2df2c863050b8261f4f20f6a51c008682ce9",
2231
2451
  targets: [
2232
2452
  "ImagePlayground",
2233
2453
  "QuickLookThumbnailing",
@@ -2267,6 +2487,7 @@ var swift_distribution_lock_default = {
2267
2487
  "PeachFoundation",
2268
2488
  "FoundationNetworking",
2269
2489
  "DeveloperToolsSupport",
2490
+ "CoreImageEnums",
2270
2491
  "SwiftUI",
2271
2492
  "DarwinRecords",
2272
2493
  "Darwin",
@@ -2398,11 +2619,12 @@ var swift_distribution_lock_default = {
2398
2619
  ],
2399
2620
  systemEnvironment: {
2400
2621
  scenePhase: ["string:active", "string:inactive", "string:background"],
2401
- colorScheme: ["string:light", "string:dark"],
2402
- semanticColors: ["object"],
2403
2622
  deviceModel: ["string"],
2404
2623
  systemName: ["string"],
2405
2624
  systemVersion: ["string"],
2625
+ colorScheme: ["string:light", "string:dark"],
2626
+ semanticColors: ["object"],
2627
+ imageAssets: ["object"],
2406
2628
  locale: ["string"],
2407
2629
  dynamicTypeSize: [
2408
2630
  "string:xSmall",
@@ -2418,51 +2640,88 @@ var swift_distribution_lock_default = {
2418
2640
  "string:accessibility4",
2419
2641
  "string:accessibility5"
2420
2642
  ],
2421
- accessibilityReduceMotion: ["bool"],
2422
2643
  horizontalSizeClass: ["string:compact", "string:regular"],
2423
2644
  verticalSizeClass: ["string:compact", "string:regular"],
2424
- imageAssets: ["object"]
2645
+ accessibilityReduceMotion: ["bool"]
2425
2646
  },
2426
2647
  hosts: {
2427
2648
  "darwin-arm64": {
2428
- sha256: "3b47173dfa25473dfc3c76e46b1203efdc7c2101eca02eb6c89692d66561e78e",
2429
- size: 81210958
2649
+ sha256: "2ab6cf8ee1a10b76ef46c90c8ee384f44594aa5be63ac267f55ab6cd30722595",
2650
+ size: 88639020
2430
2651
  },
2431
2652
  "linux-x64": {
2432
- sha256: "d11f5fe29845064c390ec980c641c6a70b0199a7f5b6cd445ddc362ff5a2394f",
2433
- size: 81209921
2653
+ sha256: "e159994e38c6043515c97d818c63f1e1b0170fb73b2cb721a6913b21691b1ec7",
2654
+ size: 91386228
2434
2655
  },
2435
2656
  "linux-arm64": {
2436
- sha256: "df9ab4453985dbbaf335610f6ab62a15f6f63175869dd484f359b702f316dfac",
2437
- size: 81209987
2657
+ sha256: "80ef20a79414516631bc1394c1fcd045d0381a3c8be8b65967d6a089ad768d23",
2658
+ size: 90878300
2438
2659
  }
2439
2660
  }
2440
2661
  };
2441
2662
 
2442
2663
  // src/swift-toolchain.ts
2443
2664
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
2444
- var import_node_fs = __toESM(require("node:fs"), 1);
2665
+ var import_node_fs2 = __toESM(require("node:fs"), 1);
2445
2666
  var import_node_os2 = __toESM(require("node:os"), 1);
2446
- var import_node_path2 = __toESM(require("node:path"), 1);
2667
+ var import_node_path3 = __toESM(require("node:path"), 1);
2668
+ var SWIFT_HOST_COMPILER_RELEASE = "swift-6.4.0-RELEASE-custom-0b2d0a9011c88e66";
2669
+ var SWIFT_HOST_COMPILER_ID = "0b2d0a9011c88e66";
2670
+ var compilerArchives = {
2671
+ "swift-6.4.0-RELEASE-custom-ecd2ad9d3fe59329": {
2672
+ identity: "ecd2ad9d3fe59329",
2673
+ hosts: {
2674
+ "darwin-arm64": {
2675
+ checksum: "ab42a13b34e410ca09737420d1ee1d6af417eec039ab44f9a60502bdb5c76506",
2676
+ manifest: "8a93b6b1e6ff577f6dacd81a511d415ca3b396698f9b0c4abc35a4ca807e9d1a"
2677
+ },
2678
+ "linux-x64": {
2679
+ checksum: "b174baa2c578fb32f09c79590d65d03951b04cdec52101b23a46c0b274249fc3",
2680
+ manifest: "330e6cbae5890111c22a58e645049a971eff30334c3f240c650fcfedfeab4ef6"
2681
+ },
2682
+ "linux-arm64": {
2683
+ checksum: "25f722334dd9d79391cb2e47301165e9ef98dd9a8036927652f3c5db3c56b2ae",
2684
+ manifest: "94e5667febf26f8a4ee8c5456f83f62d17453e503d261a4c46d2b80f872470ab"
2685
+ }
2686
+ }
2687
+ },
2688
+ [SWIFT_HOST_COMPILER_RELEASE]: {
2689
+ identity: SWIFT_HOST_COMPILER_ID,
2690
+ hosts: {
2691
+ "darwin-arm64": {
2692
+ checksum: "dc6a494227297ea657e8e5f7c5b4a861cb5e142bdbcfcb028ace2aeb19db90cc",
2693
+ manifest: "d8e9eee0fb9b847f1e9350525d6c68606df46101745f553332309ed026b3c26a"
2694
+ },
2695
+ "linux-x64": {
2696
+ checksum: "85c04b4496aea1657c21a47f448e01d6ccc1c7920d130a566db37fb8350a7be2",
2697
+ manifest: "8451659e74235ad53b700c1afbe293512197900eb98cb1f79e36df2f5c85d511"
2698
+ },
2699
+ "linux-arm64": {
2700
+ checksum: "196606ed62c5c926d18e6ef0769cb1ab21c9943f9084070ddf14a7bc696768b8",
2701
+ manifest: "85fb8d5b6527bd75003a6dbd25b68b22540665cf9df9b13f41f82e5d8acdbf1d"
2702
+ }
2703
+ }
2704
+ }
2705
+ };
2447
2706
  function swiftToolchainBin(release) {
2448
2707
  if (process.platform === "darwin") {
2449
2708
  const dirs = [import_node_os2.default.homedir(), "/"].map(
2450
- (base) => import_node_path2.default.join(base, `Library/Developer/Toolchains/${release}.xctoolchain/usr/bin`)
2709
+ (base) => import_node_path3.default.join(base, `Library/Developer/Toolchains/${release}.xctoolchain/usr/bin`)
2451
2710
  );
2452
- return dirs.find((dir) => import_node_fs.default.existsSync(import_node_path2.default.join(dir, "swift"))) ?? dirs[0];
2711
+ return dirs.find((dir) => import_node_fs2.default.existsSync(import_node_path3.default.join(dir, "swift"))) ?? dirs[0];
2453
2712
  }
2454
2713
  if (process.env.CONTRAST_SWIFT_TOOLCHAINS) {
2455
- return import_node_path2.default.join(process.env.CONTRAST_SWIFT_TOOLCHAINS, release, "usr/bin");
2714
+ return import_node_path3.default.join(process.env.CONTRAST_SWIFT_TOOLCHAINS, release, "usr/bin");
2456
2715
  }
2457
- const image = import_node_path2.default.join("/opt/swift", release, "usr/bin");
2458
- if (import_node_fs.default.existsSync(import_node_path2.default.join(image, "swift"))) return image;
2716
+ const image = import_node_path3.default.join("/opt/swift", release, "usr/bin");
2717
+ if (import_node_fs2.default.existsSync(import_node_path3.default.join(image, "swift"))) return image;
2459
2718
  if (release.includes("-custom-"))
2460
- return import_node_path2.default.join(peachHome(), "swift", "toolchains", release, "usr/bin");
2461
- return (process.env.PATH ?? "").split(import_node_path2.default.delimiter).find((dir) => dir && import_node_fs.default.existsSync(import_node_path2.default.join(dir, "swift"))) ?? image;
2719
+ return import_node_path3.default.join(peachHome(), "swift", "toolchains", release, "usr/bin");
2720
+ return (process.env.PATH ?? "").split(import_node_path3.default.delimiter).find((dir) => dir && import_node_fs2.default.existsSync(import_node_path3.default.join(dir, "swift"))) ?? image;
2462
2721
  }
2463
2722
  function peachHome() {
2464
2723
  const override = process.env.PEACH_HOME;
2465
- return override ? import_node_path2.default.resolve(override) : import_node_path2.default.join(import_node_os2.default.homedir(), ".peach");
2724
+ return override ? import_node_path3.default.resolve(override) : import_node_path3.default.join(import_node_os2.default.homedir(), ".peach");
2466
2725
  }
2467
2726
  var scratch;
2468
2727
  function swiftEnvironment(base = process.env) {
@@ -2470,18 +2729,23 @@ function swiftEnvironment(base = process.env) {
2470
2729
  return {
2471
2730
  ...base,
2472
2731
  TMPDIR: scratch.directory,
2473
- XDG_CONFIG_HOME: import_node_path2.default.join(scratch.home, ".config"),
2474
- XDG_CACHE_HOME: import_node_path2.default.join(scratch.home, ".cache"),
2475
- XDG_DATA_HOME: import_node_path2.default.join(scratch.home, ".local", "share"),
2732
+ XDG_CONFIG_HOME: import_node_path3.default.join(scratch.home, ".config"),
2733
+ XDG_CACHE_HOME: import_node_path3.default.join(scratch.home, ".cache"),
2734
+ XDG_DATA_HOME: import_node_path3.default.join(scratch.home, ".local", "share"),
2476
2735
  ...process.platform === "linux" ? { HOME: scratch.home } : {}
2477
2736
  };
2478
2737
  }
2479
2738
 
2480
2739
  // src/swift-package-manifest.ts
2481
2740
  function swiftCommand() {
2482
- return import_node_path3.default.join(swiftToolchainBin(swift_distribution_lock_default.release), "swift");
2741
+ return import_node_path4.default.join(swiftToolchainBin(swift_distribution_lock_default.release), "swift");
2742
+ }
2743
+ function swiftPackageFailure(error) {
2744
+ if (!(error instanceof Error)) return String(error);
2745
+ const stderr = "stderr" in error && (typeof error.stderr === "string" || Buffer.isBuffer(error.stderr)) ? error.stderr.toString().trim() : "";
2746
+ return stderr || error.message;
2483
2747
  }
2484
- var cacheDir2 = import_node_path3.default.join(cacheDir(), "swift-manifests");
2748
+ var cacheDir2 = import_node_path4.default.join(cacheDir(), "swift-manifests");
2485
2749
  var requirementClause = (item) => {
2486
2750
  const url = JSON.stringify(item.url);
2487
2751
  const requirement = item.requirement;
@@ -2521,9 +2785,9 @@ let package = Package(
2521
2785
  ]
2522
2786
  )
2523
2787
  `;
2524
- const dir = import_node_fs2.default.mkdtempSync(import_node_path3.default.join(import_node_os3.default.tmpdir(), "peach-resolve-"));
2788
+ const dir = import_node_fs3.default.mkdtempSync(import_node_path4.default.join(import_node_os3.default.tmpdir(), "peach-resolve-"));
2525
2789
  try {
2526
- import_node_fs2.default.writeFileSync(import_node_path3.default.join(dir, "Package.swift"), manifest);
2790
+ import_node_fs3.default.writeFileSync(import_node_path4.default.join(dir, "Package.swift"), manifest);
2527
2791
  try {
2528
2792
  (0, import_node_child_process.execFileSync)(
2529
2793
  swiftCommand(),
@@ -2533,7 +2797,7 @@ let package = Package(
2533
2797
  "--package-path",
2534
2798
  dir,
2535
2799
  "--scratch-path",
2536
- import_node_path3.default.join(dir, ".build"),
2800
+ import_node_path4.default.join(dir, ".build"),
2537
2801
  "resolve"
2538
2802
  ],
2539
2803
  {
@@ -2544,24 +2808,24 @@ let package = Package(
2544
2808
  }
2545
2809
  );
2546
2810
  } catch (error) {
2547
- const stderr = error instanceof Error && "stderr" in error ? String(error.stderr).trim() : "";
2548
2811
  throw new Error(
2549
- `swiftpm could not resolve ${clauses.length} package requirements${stderr ? `: ${stderr}` : ""}`
2812
+ `swiftpm could not resolve ${clauses.length} package requirements (${clauses.join(", ")}): ${swiftPackageFailure(error)}`,
2813
+ { cause: error }
2550
2814
  );
2551
2815
  }
2552
- const resolved = import_node_path3.default.join(dir, "Package.resolved");
2553
- if (!import_node_fs2.default.existsSync(resolved))
2816
+ const resolved = import_node_path4.default.join(dir, "Package.resolved");
2817
+ if (!import_node_fs3.default.existsSync(resolved))
2554
2818
  throw new Error("swift package resolve wrote no Package.resolved");
2555
- import_node_fs2.default.mkdirSync(import_node_path3.default.dirname(destination), { recursive: true });
2556
- import_node_fs2.default.copyFileSync(resolved, destination);
2819
+ import_node_fs3.default.mkdirSync(import_node_path4.default.dirname(destination), { recursive: true });
2820
+ import_node_fs3.default.copyFileSync(resolved, destination);
2557
2821
  } finally {
2558
- import_node_fs2.default.rmSync(dir, { recursive: true, force: true });
2822
+ import_node_fs3.default.rmSync(dir, { recursive: true, force: true });
2559
2823
  }
2560
2824
  }
2561
2825
 
2562
2826
  // src/xcode-json-project.ts
2563
2827
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
2564
- var import_node_path4 = __toESM(require("node:path"), 1);
2828
+ var import_node_path5 = __toESM(require("node:path"), 1);
2565
2829
  var import_json5 = __toESM(require_lib(), 1);
2566
2830
  var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
2567
2831
  var text = (value) => typeof value === "string" ? value : void 0;
@@ -2619,7 +2883,7 @@ var PHASE_ISA = {
2619
2883
  function readXcodeJsonProject(xcodeproj, source) {
2620
2884
  const json = import_json5.default.parse(source);
2621
2885
  if (!isJsonObject(json)) throw new Error(`${xcodeproj}/project.xcproj is not an object`);
2622
- const projectDir = import_node_path4.default.dirname(xcodeproj);
2886
+ const projectDir = import_node_path5.default.dirname(xcodeproj);
2623
2887
  const objects = {};
2624
2888
  let next = 0;
2625
2889
  const add = (entry, id) => {
@@ -2632,7 +2896,7 @@ function readXcodeJsonProject(xcodeproj, source) {
2632
2896
  const base = /^<([A-Z]+)>\/(.*)$/.exec(raw);
2633
2897
  if (base) {
2634
2898
  if (base[1] === "PROJECT")
2635
- return { sourceTree: "<absolute>", path: import_node_path4.default.join(projectDir, base[2]) };
2899
+ return { sourceTree: "<absolute>", path: import_node_path5.default.join(projectDir, base[2]) };
2636
2900
  if (base[1] === "PRODUCTS")
2637
2901
  return { sourceTree: "BUILT_PRODUCTS_DIR", path: base[2] };
2638
2902
  return null;
@@ -2640,7 +2904,7 @@ function readXcodeJsonProject(xcodeproj, source) {
2640
2904
  const unescaped = raw.replaceAll("\\<", "<");
2641
2905
  if (unescaped.startsWith("/")) return { sourceTree: "<absolute>", path: unescaped };
2642
2906
  if (unescaped.startsWith("~")) return null;
2643
- return groupDir === null ? null : { sourceTree: "<absolute>", path: import_node_path4.default.join(groupDir, unescaped) };
2907
+ return groupDir === null ? null : { sourceTree: "<absolute>", path: import_node_path5.default.join(groupDir, unescaped) };
2644
2908
  };
2645
2909
  const memberships = [];
2646
2910
  const folders = [];
@@ -2651,7 +2915,7 @@ function readXcodeJsonProject(xcodeproj, source) {
2651
2915
  const kind = text(entry.kind) ?? "file-reference";
2652
2916
  const raw = text(entry.path) ?? "";
2653
2917
  const located = raw === "" ? null : locate(raw, parent.dir);
2654
- const name = text(entry.name) ?? import_node_path4.default.basename(raw);
2918
+ const name = text(entry.name) ?? import_node_path5.default.basename(raw);
2655
2919
  const node = { id: "", name, dir: null, parent, children: [] };
2656
2920
  if (kind === "group" || kind === "variant-group" || kind === "version-group") {
2657
2921
  node.dir = raw === "" ? parent.dir : located?.sourceTree === "<absolute>" ? located.path : null;
@@ -2772,7 +3036,7 @@ function readXcodeJsonProject(xcodeproj, source) {
2772
3036
  if (!isObject(entry)) continue;
2773
3037
  const repository = text(entry.repository);
2774
3038
  const local = text(entry.path);
2775
- const name = local !== void 0 ? import_node_path4.default.basename(import_node_path4.default.resolve(import_node_path4.default.dirname(xcodeproj), local)) : import_node_path4.default.basename(repository ?? "").replace(/\.git$/, "");
3039
+ const name = local !== void 0 ? import_node_path5.default.basename(import_node_path5.default.resolve(import_node_path5.default.dirname(xcodeproj), local)) : import_node_path5.default.basename(repository ?? "").replace(/\.git$/, "");
2776
3040
  const id = text(entry.kind) === "local" && local !== void 0 ? add({ isa: "XCLocalSwiftPackageReference", relativePath: local }) : add({
2777
3041
  isa: "XCRemoteSwiftPackageReference",
2778
3042
  repositoryURL: repository ?? "",
@@ -2947,7 +3211,23 @@ function isJsonObject(value) {
2947
3211
 
2948
3212
  // src/xcode-project.ts
2949
3213
  var XCODE_DEFAULT_IOS_DEPLOYMENT_TARGET = "27.0";
3214
+ var CXX_STANDARD_ALIASES = {
3215
+ "c++0x": "c++11",
3216
+ "gnu++0x": "gnu++11"
3217
+ };
3218
+ var PRE_CXX20_STANDARDS = /* @__PURE__ */ new Set([
3219
+ "c++98",
3220
+ "gnu++98",
3221
+ "c++0x",
3222
+ "gnu++0x",
3223
+ "c++14",
3224
+ "gnu++14",
3225
+ "c++17",
3226
+ "gnu++17",
3227
+ "compiler-default"
3228
+ ]);
2950
3229
  var APPLICATION = "com.apple.product-type.application";
3230
+ var RESOURCE_BUNDLE = "com.apple.product-type.bundle";
2951
3231
  var FRAMEWORK_PRODUCTS = /* @__PURE__ */ new Set([
2952
3232
  "com.apple.product-type.framework",
2953
3233
  "com.apple.product-type.framework.static"
@@ -2965,28 +3245,28 @@ var CONDITIONS = {
2965
3245
  variant: "normal"
2966
3246
  };
2967
3247
  function walkFiles(dir) {
2968
- if (!import_node_fs3.default.existsSync(dir)) return [];
3248
+ if (!import_node_fs4.default.existsSync(dir)) return [];
2969
3249
  const out = [];
2970
- for (const entry of import_node_fs3.default.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name))) {
3250
+ for (const entry of import_node_fs4.default.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name))) {
2971
3251
  if (entry.name.startsWith(".")) continue;
2972
- const full = import_node_path5.default.join(dir, entry.name);
3252
+ const full = import_node_path6.default.join(dir, entry.name);
2973
3253
  if (entry.isDirectory()) out.push(...walkFiles(full));
2974
3254
  else if (entry.isFile()) out.push(full);
2975
3255
  }
2976
3256
  return out;
2977
3257
  }
2978
- var isDirectory = (dir) => import_node_fs3.default.existsSync(dir) && import_node_fs3.default.statSync(dir).isDirectory();
3258
+ var isDirectory = (dir) => import_node_fs4.default.existsSync(dir) && import_node_fs4.default.statSync(dir).isDirectory();
2979
3259
  function readXcconfig(file, read) {
2980
- if (read.includes(file) || !import_node_fs3.default.existsSync(file)) return {};
3260
+ if (read.includes(file) || !import_node_fs4.default.existsSync(file)) return {};
2981
3261
  read.push(file);
2982
3262
  const settings = {};
2983
- for (const raw of import_node_fs3.default.readFileSync(file, "utf8").split("\n")) {
3263
+ for (const raw of import_node_fs4.default.readFileSync(file, "utf8").split("\n")) {
2984
3264
  const line = raw.replace(/\/\/.*$/, "").trim();
2985
3265
  const include = /^#include\??\s+"([^"]+)"/.exec(line);
2986
3266
  if (include) {
2987
3267
  Object.assign(
2988
3268
  settings,
2989
- readXcconfig(import_node_path5.default.resolve(import_node_path5.default.dirname(file), include[1]), read)
3269
+ readXcconfig(import_node_path6.default.resolve(import_node_path6.default.dirname(file), include[1]), read)
2990
3270
  );
2991
3271
  continue;
2992
3272
  }
@@ -3036,22 +3316,22 @@ function decodeXml(text2) {
3036
3316
  return text2.replaceAll("&quot;", '"').replaceAll("&apos;", "'").replaceAll("&lt;", "<").replaceAll("&gt;", ">").replaceAll("&amp;", "&");
3037
3317
  }
3038
3318
  function workspaceReferences(workspace) {
3039
- const data = import_node_path5.default.join(workspace, "contents.xcworkspacedata");
3040
- if (!import_node_fs3.default.existsSync(data))
3319
+ const data = import_node_path6.default.join(workspace, "contents.xcworkspacedata");
3320
+ if (!import_node_fs4.default.existsSync(data))
3041
3321
  throw new Error(`${workspace} has no contents.xcworkspacedata`);
3042
- const container = import_node_path5.default.dirname(workspace);
3322
+ const container = import_node_path6.default.dirname(workspace);
3043
3323
  const locate = (location, base) => {
3044
3324
  const colon = location.indexOf(":");
3045
3325
  const kind = location.slice(0, colon);
3046
3326
  const rest = location.slice(colon + 1);
3047
- if (kind === "group") return import_node_path5.default.resolve(base, rest);
3048
- if (kind === "container" || kind === "self") return import_node_path5.default.resolve(container, rest);
3049
- if (kind === "absolute") return import_node_path5.default.resolve(rest);
3050
- throw new Error(`${import_node_path5.default.basename(workspace)} has an unsupported location ${location}`);
3327
+ if (kind === "group") return import_node_path6.default.resolve(base, rest);
3328
+ if (kind === "container" || kind === "self") return import_node_path6.default.resolve(container, rest);
3329
+ if (kind === "absolute") return import_node_path6.default.resolve(rest);
3330
+ throw new Error(`${import_node_path6.default.basename(workspace)} has an unsupported location ${location}`);
3051
3331
  };
3052
3332
  const groups = [container];
3053
3333
  const references = [];
3054
- for (const [, closing, tag, attributes, selfClosing] of import_node_fs3.default.readFileSync(data, "utf8").matchAll(/<(\/?)(Group|FileRef)\b([^>]*?)(\/?)>/g)) {
3334
+ for (const [, closing, tag, attributes, selfClosing] of import_node_fs4.default.readFileSync(data, "utf8").matchAll(/<(\/?)(Group|FileRef)\b([^>]*?)(\/?)>/g)) {
3055
3335
  if (closing) {
3056
3336
  if (tag === "Group") groups.pop();
3057
3337
  continue;
@@ -3102,8 +3382,8 @@ function remotePackageRequirements(projects) {
3102
3382
  var loaded = /* @__PURE__ */ new Map();
3103
3383
  function xcodeProjectFile(xcodeproj) {
3104
3384
  for (const name of ["project.pbxproj", "project.xcproj"]) {
3105
- const file = import_node_path5.default.join(xcodeproj, name);
3106
- if (import_node_fs3.default.existsSync(file)) return file;
3385
+ const file = import_node_path6.default.join(xcodeproj, name);
3386
+ if (import_node_fs4.default.existsSync(file)) return file;
3107
3387
  }
3108
3388
  return null;
3109
3389
  }
@@ -3111,8 +3391,8 @@ function loadProject(xcodeproj) {
3111
3391
  const projectFile = xcodeProjectFile(xcodeproj);
3112
3392
  if (!projectFile)
3113
3393
  throw new Error(`${xcodeproj} has no project.pbxproj or project.xcproj`);
3114
- const source = import_node_fs3.default.readFileSync(projectFile, "utf8");
3115
- const digest = (0, import_node_crypto.createHash)("sha256").update(source).digest("hex");
3394
+ const source = import_node_fs4.default.readFileSync(projectFile, "utf8");
3395
+ const digest = (0, import_node_crypto2.createHash)("sha256").update(source).digest("hex");
3116
3396
  const cached = loaded.get(projectFile);
3117
3397
  if (cached?.digest === digest) return cached.project;
3118
3398
  const root = projectFile.endsWith(".xcproj") ? readXcodeJsonProject(xcodeproj, source) : parseOpenStepPlist(source);
@@ -3128,10 +3408,10 @@ function loadProject(xcodeproj) {
3128
3408
  if (!project || project.isa !== "PBXProject") {
3129
3409
  throw new Error(`${projectFile} has no PBXProject root`);
3130
3410
  }
3131
- const projectDir = import_node_fs3.default.realpathSync(
3132
- import_node_path5.default.resolve(import_node_path5.default.dirname(xcodeproj), str(project.projectDirPath) ?? "")
3411
+ const projectDir = import_node_fs4.default.realpathSync(
3412
+ import_node_path6.default.resolve(import_node_path6.default.dirname(xcodeproj), str(project.projectDirPath) ?? "")
3133
3413
  );
3134
- const resolvePath = xcodePathResolver(objects, projectDir, import_node_path5.default.join);
3414
+ const resolvePath = xcodePathResolver(objects, projectDir, import_node_path6.default.join);
3135
3415
  const result = {
3136
3416
  xcodeproj,
3137
3417
  projectFile,
@@ -3165,8 +3445,8 @@ function targetSettings(ref, configuration, builtins, options = {}, overrides =
3165
3445
  const relative = str(config.baseConfigurationReferenceRelativePath);
3166
3446
  const own = isDict(config.buildSettings) ? config.buildSettings : {};
3167
3447
  const directory = anchor ? project.resolvePath(anchor) : null;
3168
- const baseFile = base ? project.resolvePath(base) : directory && relative ? import_node_path5.default.resolve(directory, relative) : null;
3169
- if (options.requireSources !== false && (base || anchor || relative) && (!baseFile || !import_node_fs3.default.existsSync(baseFile)))
3448
+ const baseFile = base ? project.resolvePath(base) : directory && relative ? import_node_path6.default.resolve(directory, relative) : null;
3449
+ if (options.requireSources !== false && (base || anchor || relative) && (!baseFile || !import_node_fs4.default.existsSync(baseFile)))
3170
3450
  throw new Error(
3171
3451
  `Unable to open base configuration reference file '${baseFile ?? base ?? relative ?? anchor}'`
3172
3452
  );
@@ -3222,7 +3502,7 @@ function targetSettings(ref, configuration, builtins, options = {}, overrides =
3222
3502
  const derived = (key) => {
3223
3503
  if (key === "AppIdentifierPrefix" || key === "TeamIdentifierPrefix")
3224
3504
  return teamPrefix();
3225
- return Object.hasOwn(derivedSettings, key) ? derivedSettings[key]() : process.env[key] ?? "";
3505
+ return Object.hasOwn(derivedSettings, key) ? derivedSettings[key]() : options.environment?.[key] ?? process.env[key] ?? "";
3226
3506
  };
3227
3507
  return {
3228
3508
  get,
@@ -3244,27 +3524,27 @@ function settingList(value) {
3244
3524
  );
3245
3525
  return items2;
3246
3526
  }
3247
- function expandSearchPath(directory, rules) {
3248
- if (import_node_path5.default.basename(directory) !== "**") return [directory];
3527
+ function expandSearchPath(directory, rules2) {
3528
+ if (import_node_path6.default.basename(directory) !== "**") return [directory];
3249
3529
  const expanded = [];
3250
3530
  const seen = /* @__PURE__ */ new Set();
3251
- const queue = [import_node_path5.default.dirname(directory)];
3531
+ const queue = [import_node_path6.default.dirname(directory)];
3252
3532
  for (let at = 0; at < queue.length; at++) {
3253
3533
  const current = queue[at];
3254
3534
  let real;
3255
3535
  try {
3256
- real = import_node_fs3.default.realpathSync(current);
3536
+ real = import_node_fs4.default.realpathSync(current);
3257
3537
  } catch {
3258
3538
  continue;
3259
3539
  }
3260
- if (!import_node_fs3.default.statSync(real).isDirectory() || seen.has(real)) continue;
3540
+ if (!import_node_fs4.default.statSync(real).isDirectory() || seen.has(real)) continue;
3261
3541
  seen.add(real);
3262
3542
  expanded.push(current);
3263
- for (const entry of import_node_fs3.default.readdirSync(real, { withFileTypes: true }).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
3264
- if (entry.isSymbolicLink() ? !rules.followLinks : !entry.isDirectory()) continue;
3265
- if (rules.excluded.some((pattern) => pattern.test(entry.name)) && !rules.included.some((pattern) => pattern.test(entry.name)))
3543
+ for (const entry of import_node_fs4.default.readdirSync(real, { withFileTypes: true }).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
3544
+ if (entry.isSymbolicLink() ? !rules2.followLinks : !entry.isDirectory()) continue;
3545
+ if (rules2.excluded.some((pattern) => pattern.test(entry.name)) && !rules2.included.some((pattern) => pattern.test(entry.name)))
3266
3546
  continue;
3267
- queue.push(import_node_path5.default.join(current, entry.name));
3547
+ queue.push(import_node_path6.default.join(current, entry.name));
3268
3548
  }
3269
3549
  }
3270
3550
  return expanded;
@@ -3346,14 +3626,14 @@ function shellCopies(script, settings, projectDir) {
3346
3626
  if (operands.length !== 2 || operands.some((operand) => operand.startsWith("-")))
3347
3627
  return [];
3348
3628
  copies.push({
3349
- from: import_node_path5.default.resolve(projectDir, operands[0]),
3350
- to: import_node_path5.default.resolve(projectDir, operands[1])
3629
+ from: import_node_path6.default.resolve(projectDir, operands[0]),
3630
+ to: import_node_path6.default.resolve(projectDir, operands[1])
3351
3631
  });
3352
3632
  }
3353
3633
  return copies;
3354
3634
  }
3355
3635
  function fileListEntries(file, absolute) {
3356
- return import_node_fs3.default.readFileSync(file, "utf8").split(/\r?\n/).map((line) => line.trim()).filter((line) => line !== "" && !line.startsWith("#")).map(absolute);
3636
+ return import_node_fs4.default.readFileSync(file, "utf8").split(/\r?\n/).map((line) => line.trim()).filter((line) => line !== "" && !line.startsWith("#")).map(absolute);
3357
3637
  }
3358
3638
  function targetMembers(ref, settings, options, settingKeys, projectInputs) {
3359
3639
  const { project, target, id: targetId } = ref;
@@ -3366,7 +3646,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
3366
3646
  const copiedFiles = [];
3367
3647
  let generatedInfoPlist = false;
3368
3648
  const declaredInfoPlist = settings("INFOPLIST_FILE");
3369
- const infoPlistOutput = declaredInfoPlist ? import_node_path5.default.resolve(project.projectDir, declaredInfoPlist) : null;
3649
+ const infoPlistOutput = declaredInfoPlist ? import_node_path6.default.resolve(project.projectDir, declaredInfoPlist) : null;
3370
3650
  const isPreparedOutput = (file) => file === infoPlistOutput || options.requireSources !== false && file.endsWith(".swift");
3371
3651
  for (const phaseId of list(target.buildPhases)) {
3372
3652
  const phase = project.object(phaseId);
@@ -3375,7 +3655,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
3375
3655
  copiedFiles.push(
3376
3656
  ...shellCopies(str(phase.shellScript) ?? "", settings, project.projectDir)
3377
3657
  );
3378
- const absolute = (raw) => import_node_path5.default.resolve(project.projectDir, expand(raw, settings));
3658
+ const absolute = (raw) => import_node_path6.default.resolve(project.projectDir, expand(raw, settings));
3379
3659
  const inputs = list(phase.inputPaths).map(absolute);
3380
3660
  const outputs = list(phase.outputPaths).map(absolute);
3381
3661
  const fileLists = /* @__PURE__ */ new Map();
@@ -3384,7 +3664,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
3384
3664
  kind === "INPUT" ? phase.inputFileListPaths : phase.outputFileListPaths
3385
3665
  ).map((raw) => {
3386
3666
  const file = absolute(raw);
3387
- if (!import_node_fs3.default.existsSync(file)) {
3667
+ if (!import_node_fs4.default.existsSync(file)) {
3388
3668
  return { file, entries: [] };
3389
3669
  }
3390
3670
  return { file, entries: fileListEntries(file, absolute) };
@@ -3405,13 +3685,13 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
3405
3685
  ...fileLists.get("OUTPUT").map((item) => item.file)
3406
3686
  ];
3407
3687
  if (allOutputs.some((file) => file.endsWith(".swift") || file === infoPlistOutput)) {
3408
- for (const file of inputFiles) if (import_node_fs3.default.existsSync(file)) projectInputs.add(file);
3688
+ for (const file of inputFiles) if (import_node_fs4.default.existsSync(file)) projectInputs.add(file);
3409
3689
  }
3410
3690
  if (options.prepareGeneratedSources === true && allOutputs.some(isPreparedOutput)) {
3411
- const phaseDir = import_node_path5.default.join(settings("TARGET_TEMP_DIR"), `Script-${phaseId}`);
3691
+ const phaseDir = import_node_path6.default.join(settings("TARGET_TEMP_DIR"), `Script-${phaseId}`);
3412
3692
  for (const lists of fileLists.values())
3413
3693
  for (const { file } of lists)
3414
- if (!import_node_fs3.default.existsSync(file))
3694
+ if (!import_node_fs4.default.existsSync(file))
3415
3695
  throw new Error(
3416
3696
  `${targetName}: Run Script "${script}" missing file list ${file}`
3417
3697
  );
@@ -3430,34 +3710,34 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
3430
3710
  const lists = fileLists.get(kind);
3431
3711
  env[`SCRIPT_${kind}_FILE_LIST_COUNT`] = String(lists.length);
3432
3712
  lists.forEach((_item, index) => {
3433
- env[`SCRIPT_${kind}_FILE_LIST_${index}`] = import_node_path5.default.join(
3713
+ env[`SCRIPT_${kind}_FILE_LIST_${index}`] = import_node_path6.default.join(
3434
3714
  phaseDir,
3435
3715
  `${kind}-${index}.xcfilelist`
3436
3716
  );
3437
3717
  });
3438
3718
  }
3439
- const signature = (0, import_node_crypto.createHash)("sha256").update(
3719
+ const signature = (0, import_node_crypto2.createHash)("sha256").update(
3440
3720
  JSON.stringify([phase, [...settingKeys].map((key2) => [key2, settings(key2)])])
3441
3721
  );
3442
3722
  for (const file of inputFiles) {
3443
3723
  signature.update(file);
3444
- if (import_node_fs3.default.existsSync(file)) {
3445
- const stat = import_node_fs3.default.statSync(file);
3724
+ if (import_node_fs4.default.existsSync(file)) {
3725
+ const stat = import_node_fs4.default.statSync(file);
3446
3726
  signature.update(`${stat.mtimeMs}:${stat.ctimeMs}:${stat.size}`);
3447
3727
  } else signature.update("missing");
3448
3728
  }
3449
3729
  const stamp = signature.digest("hex");
3450
3730
  const key = `${project.projectFile}:${targetId}:${phaseId}:${settings("CONFIGURATION")}`;
3451
- if (preparedSourcePhases.get(key) === stamp && allOutputs.every((file) => import_node_fs3.default.existsSync(file)))
3731
+ if (preparedSourcePhases.get(key) === stamp && allOutputs.every((file) => import_node_fs4.default.existsSync(file)))
3452
3732
  continue;
3453
- import_node_fs3.default.mkdirSync(phaseDir, { recursive: true });
3454
- import_node_fs3.default.mkdirSync(settings("BUILT_PRODUCTS_DIR"), { recursive: true });
3455
- import_node_fs3.default.mkdirSync(settings("DERIVED_FILE_DIR"), { recursive: true });
3733
+ import_node_fs4.default.mkdirSync(phaseDir, { recursive: true });
3734
+ import_node_fs4.default.mkdirSync(settings("BUILT_PRODUCTS_DIR"), { recursive: true });
3735
+ import_node_fs4.default.mkdirSync(settings("DERIVED_FILE_DIR"), { recursive: true });
3456
3736
  for (const output of allOutputs)
3457
- import_node_fs3.default.mkdirSync(import_node_path5.default.dirname(output), { recursive: true });
3737
+ import_node_fs4.default.mkdirSync(import_node_path6.default.dirname(output), { recursive: true });
3458
3738
  for (const [kind, lists] of fileLists)
3459
3739
  lists.forEach((item, index) => {
3460
- import_node_fs3.default.writeFileSync(
3740
+ import_node_fs4.default.writeFileSync(
3461
3741
  env[`SCRIPT_${kind}_FILE_LIST_${index}`],
3462
3742
  `${item.entries.join("\n")}
3463
3743
  `
@@ -3483,7 +3763,7 @@ ${output}`
3483
3763
  );
3484
3764
  }
3485
3765
  const missing = allOutputs.filter(
3486
- (file) => file === infoPlistOutput && !import_node_fs3.default.existsSync(file)
3766
+ (file) => file === infoPlistOutput && !import_node_fs4.default.existsSync(file)
3487
3767
  );
3488
3768
  if (missing.length > 0)
3489
3769
  throw new Error(
@@ -3496,8 +3776,8 @@ ${output}`
3496
3776
  project.objects,
3497
3777
  targetId,
3498
3778
  project.resolvePath,
3499
- (file) => isDirectory(file) ? walkFiles(file) : import_node_fs3.default.existsSync(file) ? [file] : [],
3500
- import_node_path5.default.join,
3779
+ (file) => isDirectory(file) ? walkFiles(file) : import_node_fs4.default.existsSync(file) ? [file] : [],
3780
+ import_node_path6.default.join,
3501
3781
  (file, kind) => {
3502
3782
  if (kind === "header") {
3503
3783
  headers.add(file);
@@ -3507,9 +3787,9 @@ ${output}`
3507
3787
  resources.add(file);
3508
3788
  return;
3509
3789
  }
3510
- if (!import_node_fs3.default.existsSync(file)) {
3790
+ if (!import_node_fs4.default.existsSync(file)) {
3511
3791
  if (options.requireSources === false) return;
3512
- const script = scriptForOutput.get(import_node_path5.default.normalize(file));
3792
+ const script = scriptForOutput.get(import_node_path6.default.normalize(file));
3513
3793
  throw new Error(
3514
3794
  script ? `${targetName}: missing generated source ${file} (Run Script "${script}" declares it in outputPaths; run the script or check in its output)` : `${targetName}: missing source ${file}`
3515
3795
  );
@@ -3520,8 +3800,8 @@ ${output}`
3520
3800
  );
3521
3801
  for (const [file] of scriptForOutput) {
3522
3802
  if (sources.has(file) || allSources.has(file)) continue;
3523
- if (!import_node_fs3.default.existsSync(file)) continue;
3524
- const canonical = import_node_fs3.default.realpathSync(file);
3803
+ if (!import_node_fs4.default.existsSync(file)) continue;
3804
+ const canonical = import_node_fs4.default.realpathSync(file);
3525
3805
  if (sources.has(canonical) || allSources.has(canonical)) continue;
3526
3806
  allSources.add(canonical);
3527
3807
  sources.add(canonical);
@@ -3538,37 +3818,37 @@ ${output}`
3538
3818
  function commonAncestor(dirs) {
3539
3819
  let common = dirs[0];
3540
3820
  for (const dir of dirs) {
3541
- while (common !== import_node_path5.default.dirname(common) && import_node_path5.default.relative(common, dir).startsWith(".."))
3542
- common = import_node_path5.default.dirname(common);
3821
+ while (common !== import_node_path6.default.dirname(common) && import_node_path6.default.relative(common, dir).startsWith(".."))
3822
+ common = import_node_path6.default.dirname(common);
3543
3823
  }
3544
3824
  return common;
3545
3825
  }
3546
- var isPodsProject = (xcodeproj) => import_node_path5.default.basename(xcodeproj) === "Pods.xcodeproj" && import_node_path5.default.basename(import_node_path5.default.dirname(xcodeproj)) === "Pods";
3826
+ var isPodsProject = (xcodeproj) => import_node_path6.default.basename(xcodeproj) === "Pods.xcodeproj" && import_node_path6.default.basename(import_node_path6.default.dirname(xcodeproj)) === "Pods";
3547
3827
  function installedPodsSandbox(pods) {
3548
- const podfileLock = import_node_path5.default.join(import_node_path5.default.dirname(pods), "Podfile.lock");
3549
- const manifestLock = import_node_path5.default.join(pods, "Manifest.lock");
3550
- if (!import_node_fs3.default.existsSync(podfileLock))
3828
+ const podfileLock = import_node_path6.default.join(import_node_path6.default.dirname(pods), "Podfile.lock");
3829
+ const manifestLock = import_node_path6.default.join(pods, "Manifest.lock");
3830
+ if (!import_node_fs4.default.existsSync(podfileLock))
3551
3831
  throw new Error(
3552
- `${pods} has no ${podfileLock}: run \`pod install\` in ${import_node_path5.default.dirname(pods)}`
3832
+ `${pods} has no ${podfileLock}: run \`pod install\` in ${import_node_path6.default.dirname(pods)}`
3553
3833
  );
3554
- if (!import_node_fs3.default.existsSync(manifestLock) || !import_node_fs3.default.readFileSync(manifestLock).equals(import_node_fs3.default.readFileSync(podfileLock)))
3834
+ if (!import_node_fs4.default.existsSync(manifestLock) || !import_node_fs4.default.readFileSync(manifestLock).equals(import_node_fs4.default.readFileSync(podfileLock)))
3555
3835
  throw new Error(
3556
- `The sandbox is not in sync with the Podfile.lock: ${manifestLock} differs from ${podfileLock}. Run \`pod install\` in ${import_node_path5.default.dirname(pods)}`
3836
+ `The sandbox is not in sync with the Podfile.lock: ${manifestLock} differs from ${podfileLock}. Run \`pod install\` in ${import_node_path6.default.dirname(pods)}`
3557
3837
  );
3558
3838
  const specChecksums = {};
3559
- const lines = import_node_fs3.default.readFileSync(manifestLock, "utf8").split("\n");
3839
+ const lines = import_node_fs4.default.readFileSync(manifestLock, "utf8").split("\n");
3560
3840
  const start = lines.indexOf("SPEC CHECKSUMS:");
3561
3841
  for (const line of start === -1 ? [] : lines.slice(start + 1)) {
3562
3842
  const entry = /^ {2}"?([^":]+)"?: ([0-9a-f]+)$/.exec(line);
3563
3843
  if (!entry) break;
3564
3844
  specChecksums[entry[1]] = entry[2];
3565
3845
  }
3566
- const specs = import_node_path5.default.join(pods, "Local Podspecs");
3846
+ const specs = import_node_path6.default.join(pods, "Local Podspecs");
3567
3847
  return {
3568
3848
  podfileLock,
3569
3849
  manifestLock,
3570
3850
  specChecksums,
3571
- localPodspecs: isDirectory(specs) ? import_node_fs3.default.readdirSync(specs).filter((name) => name.endsWith(".podspec.json")).sort().map((name) => import_node_path5.default.join(specs, name)) : []
3851
+ localPodspecs: isDirectory(specs) ? import_node_fs4.default.readdirSync(specs).filter((name) => name.endsWith(".podspec.json")).sort().map((name) => import_node_path6.default.join(specs, name)) : []
3572
3852
  };
3573
3853
  }
3574
3854
  function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
@@ -3580,14 +3860,14 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
3580
3860
  if (!xcodeProjectFile(xcodeproj)) {
3581
3861
  if (installedPods && isPodsProject(xcodeproj))
3582
3862
  throw new Error(
3583
- `${import_node_path5.default.basename(xcodeprojOrWorkspace)} builds ${xcodeproj}, which is not installed: run \`pod install\` in ${import_node_path5.default.dirname(import_node_path5.default.dirname(xcodeproj))}`
3863
+ `${import_node_path6.default.basename(xcodeprojOrWorkspace)} builds ${xcodeproj}, which is not installed: run \`pod install\` in ${import_node_path6.default.dirname(import_node_path6.default.dirname(xcodeproj))}`
3584
3864
  );
3585
3865
  return;
3586
3866
  }
3587
- const key = import_node_fs3.default.realpathSync(xcodeproj);
3588
- if (projectAt.has(key) || !installedPods && key.split(import_node_path5.default.sep).includes("Pods"))
3867
+ const key = import_node_fs4.default.realpathSync(xcodeproj);
3868
+ if (projectAt.has(key) || !installedPods && key.split(import_node_path6.default.sep).includes("Pods"))
3589
3869
  return;
3590
- if (isPodsProject(key)) cocoapods = installedPodsSandbox(import_node_path5.default.dirname(key));
3870
+ if (isPodsProject(key)) cocoapods = installedPodsSandbox(import_node_path6.default.dirname(key));
3591
3871
  const project = loadProject(key);
3592
3872
  projectAt.set(key, project);
3593
3873
  projects.push(project);
@@ -3603,12 +3883,12 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
3603
3883
  for (const reference of listed)
3604
3884
  if (reference.endsWith(".xcodeproj")) addProject(reference);
3605
3885
  if (projects.length === 0) {
3606
- throw new Error(`${import_node_path5.default.basename(xcodeprojOrWorkspace)} lists no Xcode project`);
3886
+ throw new Error(`${import_node_path6.default.basename(xcodeprojOrWorkspace)} lists no Xcode project`);
3607
3887
  }
3608
- const podfile = import_node_path5.default.join(import_node_path5.default.dirname(xcodeprojOrWorkspace), "Podfile");
3609
- if (installedPods && !cocoapods && import_node_fs3.default.existsSync(podfile))
3888
+ const podfile = import_node_path6.default.join(import_node_path6.default.dirname(xcodeprojOrWorkspace), "Podfile");
3889
+ if (installedPods && !cocoapods && import_node_fs4.default.existsSync(podfile))
3610
3890
  throw new Error(
3611
- `${podfile} is not installed into ${import_node_path5.default.basename(xcodeprojOrWorkspace)}: run \`pod install\` in ${import_node_path5.default.dirname(podfile)} and open the workspace it writes`
3891
+ `${podfile} is not installed into ${import_node_path6.default.basename(xcodeprojOrWorkspace)}: run \`pod install\` in ${import_node_path6.default.dirname(podfile)} and open the workspace it writes`
3612
3892
  );
3613
3893
  return { listed, projects, projectAt, cocoapods };
3614
3894
  }
@@ -3644,7 +3924,7 @@ function listXcodeAppTargets(xcodeprojOrWorkspace, options = {}) {
3644
3924
  return workspaceProjects(xcodeprojOrWorkspace).projects.flatMap(projectTargets).filter((ref) => isIosAppTarget(ref, options)).map((ref) => str(ref.target.name) ?? ref.id);
3645
3925
  }
3646
3926
  function readXcodeAppTarget(input, targetName, configurationName, options = {}) {
3647
- const xcodeprojOrWorkspace = import_node_fs3.default.realpathSync(input);
3927
+ const xcodeprojOrWorkspace = import_node_fs4.default.realpathSync(input);
3648
3928
  const workspace = xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : null;
3649
3929
  const { listed, projects, projectAt, cocoapods } = workspaceProjects(
3650
3930
  xcodeprojOrWorkspace,
@@ -3653,7 +3933,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
3653
3933
  const allTargets = projects.flatMap(projectTargets);
3654
3934
  const appTargets = allTargets.filter((ref) => isIosAppTarget(ref, options));
3655
3935
  const appTargetNames = appTargets.map((ref) => str(ref.target.name) ?? ref.id);
3656
- const container = import_node_path5.default.basename(xcodeprojOrWorkspace);
3936
+ const container = import_node_path6.default.basename(xcodeprojOrWorkspace);
3657
3937
  const named = targetName ? appTargets.filter((ref) => ref.target.name === targetName) : appTargets;
3658
3938
  if (named.length !== 1) {
3659
3939
  throw new Error(
@@ -3666,15 +3946,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
3666
3946
  for (const ref of allTargets) {
3667
3947
  const product = ref.project.object(str(ref.target.productReference));
3668
3948
  const file = str(product?.path);
3669
- if (file && !byProduct.has(import_node_path5.default.basename(file)))
3670
- byProduct.set(import_node_path5.default.basename(file), ref);
3949
+ if (file && !byProduct.has(import_node_path6.default.basename(file)))
3950
+ byProduct.set(import_node_path6.default.basename(file), ref);
3671
3951
  }
3672
3952
  const proxied = (project, proxyId) => {
3673
3953
  const proxy = project.object(proxyId);
3674
3954
  if (proxy?.isa !== "PBXContainerItemProxy") return void 0;
3675
3955
  const portal = str(proxy.containerPortal);
3676
3956
  const portalPath = project.resolvePath(portal ?? "");
3677
- const owner = project.object(portal)?.isa === "PBXProject" ? project : portalPath && import_node_fs3.default.existsSync(portalPath) ? projectAt.get(import_node_fs3.default.realpathSync(portalPath)) : void 0;
3957
+ const owner = project.object(portal)?.isa === "PBXProject" ? project : portalPath && import_node_fs4.default.existsSync(portalPath) ? projectAt.get(import_node_fs4.default.realpathSync(portalPath)) : void 0;
3678
3958
  const remote = str(proxy.remoteGlobalIDString);
3679
3959
  if (!owner || !remote) return void 0;
3680
3960
  return projectTargets(owner).find(
@@ -3695,12 +3975,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
3695
3975
  if (phase?.isa !== "PBXFrameworksBuildPhase") continue;
3696
3976
  for (const buildFileId of list(phase.files)) {
3697
3977
  const file = project.object(str(project.object(buildFileId)?.fileRef));
3698
- const resolved = file?.isa === "PBXReferenceProxy" ? proxied(project, str(file.remoteRef)) : file && str(file.sourceTree) === "BUILT_PRODUCTS_DIR" ? byProduct.get(import_node_path5.default.basename(str(file.path) ?? "")) : void 0;
3978
+ const resolved = file?.isa === "PBXReferenceProxy" ? proxied(project, str(file.remoteRef)) : file && str(file.sourceTree) === "BUILT_PRODUCTS_DIR" ? byProduct.get(import_node_path6.default.basename(str(file.path) ?? "")) : void 0;
3699
3979
  if (resolved) found.push(resolved);
3700
3980
  }
3701
3981
  }
3702
3982
  return found.filter(
3703
- (candidate) => candidate.target.isa === "PBXAggregateTarget" || MODULE_PRODUCTS.has(str(candidate.target.productType) ?? "")
3983
+ (candidate) => candidate.target.isa === "PBXAggregateTarget" || candidate.target.productType === RESOURCE_BUNDLE || MODULE_PRODUCTS.has(str(candidate.target.productType) ?? "")
3704
3984
  );
3705
3985
  };
3706
3986
  const order = [];
@@ -3744,8 +4024,8 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
3744
4024
  ref.project.objects,
3745
4025
  ref.id,
3746
4026
  ref.project.resolvePath,
3747
- (file) => isDirectory(file) ? walkFiles(file) : import_node_fs3.default.existsSync(file) ? [file] : [],
3748
- import_node_path5.default.join,
4027
+ (file) => isDirectory(file) ? walkFiles(file) : import_node_fs4.default.existsSync(file) ? [file] : [],
4028
+ import_node_path6.default.join,
3749
4029
  (file, kind) => {
3750
4030
  if (kind === "header") found.push(file);
3751
4031
  }
@@ -3761,12 +4041,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
3761
4041
  for (const ref of projectTargets(project)) {
3762
4042
  const product = productName(ref);
3763
4043
  for (const { file, visibility } of headerPhase(ref)) {
3764
- const name = import_node_path5.default.basename(file);
4044
+ const name = import_node_path6.default.basename(file);
3765
4045
  if (!entries.has(name))
3766
4046
  entries.set(name, visibility !== "Project" ? `${product}/${name}` : file);
3767
4047
  }
3768
4048
  for (const file of synchronizedHeaders(ref)) {
3769
- const name = import_node_path5.default.basename(file);
4049
+ const name = import_node_path6.default.basename(file);
3770
4050
  if (!entries.has(name)) entries.set(name, file);
3771
4051
  }
3772
4052
  }
@@ -3776,7 +4056,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
3776
4056
  if (folder === null) continue;
3777
4057
  for (const file of walkFiles(folder)) {
3778
4058
  if (!HEADER_FILE.test(file)) continue;
3779
- const name = import_node_path5.default.basename(file);
4059
+ const name = import_node_path6.default.basename(file);
3780
4060
  if (!entries.has(name)) entries.set(name, file);
3781
4061
  }
3782
4062
  }
@@ -3784,18 +4064,18 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
3784
4064
  for (const id of Object.keys(project.objects)) {
3785
4065
  if (project.object(id)?.isa !== "PBXFileReference") continue;
3786
4066
  const file = project.resolvePath(id);
3787
- if (file && HEADER_FILE.test(file) && !entries.has(import_node_path5.default.basename(file)))
3788
- entries.set(import_node_path5.default.basename(file), file);
4067
+ if (file && HEADER_FILE.test(file) && !entries.has(import_node_path6.default.basename(file)))
4068
+ entries.set(import_node_path6.default.basename(file), file);
3789
4069
  }
3790
4070
  const map = [...entries];
3791
4071
  projectHeaderMaps.set(project, map);
3792
4072
  return map;
3793
4073
  };
3794
4074
  const xcconfigs = /* @__PURE__ */ new Set();
3795
- const buildDir = (project) => import_node_path5.default.join(project.projectDir, ".build/peach-xcode/Build");
4075
+ const buildDir = (project) => import_node_path6.default.join(project.projectDir, ".build/peach-xcode/Build");
3796
4076
  const podsBuild = {
3797
- SYMROOT: import_node_path5.default.join(buildDir(app.project), "Products"),
3798
- OBJROOT: import_node_path5.default.join(buildDir(app.project), "Intermediates.noindex")
4077
+ SYMROOT: import_node_path6.default.join(buildDir(app.project), "Products"),
4078
+ OBJROOT: import_node_path6.default.join(buildDir(app.project), "Intermediates.noindex")
3799
4079
  };
3800
4080
  const moduleTarget = (ref) => {
3801
4081
  const name = str(ref.target.name) ?? ref.id;
@@ -3810,18 +4090,19 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
3810
4090
  TARGET_NAME: name,
3811
4091
  TARGETNAME: "$(TARGET_NAME)",
3812
4092
  PROJECT: "$(PROJECT_NAME)",
3813
- PROJECT_NAME: import_node_path5.default.basename(ref.project.xcodeproj, ".xcodeproj"),
4093
+ PROJECT_NAME: import_node_path6.default.basename(ref.project.xcodeproj, ".xcodeproj"),
3814
4094
  PROJECT_FILE_PATH: ref.project.xcodeproj,
3815
4095
  SRCROOT: ref.project.projectDir,
3816
4096
  SOURCE_ROOT: ref.project.projectDir,
3817
4097
  PROJECT_DIR: ref.project.projectDir,
3818
- SYMROOT: import_node_path5.default.join(buildDir(ref.project), "Products"),
4098
+ SYMROOT: import_node_path6.default.join(buildDir(ref.project), "Products"),
3819
4099
  BUILD_DIR: "$(SYMROOT)",
3820
4100
  BUILD_ROOT: "$(SYMROOT)",
3821
- OBJROOT: import_node_path5.default.join(buildDir(ref.project), "Intermediates.noindex"),
4101
+ OBJROOT: import_node_path6.default.join(buildDir(ref.project), "Intermediates.noindex"),
3822
4102
  CONFIGURATION_BUILD_DIR: "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)",
3823
4103
  BUILT_PRODUCTS_DIR: "$(CONFIGURATION_BUILD_DIR)",
3824
4104
  TARGET_BUILD_DIR: "$(CONFIGURATION_BUILD_DIR)",
4105
+ UNLOCALIZED_RESOURCES_FOLDER_PATH: str(ref.project.object(str(ref.target.productReference))?.path) ?? "",
3825
4106
  PROJECT_TEMP_DIR: "$(OBJROOT)/$(PROJECT_NAME).build",
3826
4107
  CONFIGURATION_TEMP_DIR: "$(PROJECT_TEMP_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)",
3827
4108
  TARGET_TEMP_DIR: "$(CONFIGURATION_TEMP_DIR)/$(TARGET_NAME).build",
@@ -3829,6 +4110,11 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
3829
4110
  TEMP_FILES_DIR: "$(TEMP_DIR)",
3830
4111
  TEMP_FILE_DIR: "$(TEMP_DIR)",
3831
4112
  TEMP_ROOT: "$(OBJROOT)",
4113
+ OBJECT_FILE_DIR: "$(TARGET_TEMP_DIR)/Objects",
4114
+ // the per-variant object directory carries no arch: xcode defines
4115
+ // OBJECT_FILE_DIR_normal as OBJECT_FILE_DIR-normal, and the target
4116
+ // appends $(CURRENT_ARCH) itself for the per-arch directory.
4117
+ OBJECT_FILE_DIR_normal: "$(OBJECT_FILE_DIR)-normal",
3832
4118
  DERIVED_FILE_DIR: "$(TARGET_TEMP_DIR)/DerivedSources",
3833
4119
  DERIVED_FILES_DIR: "$(DERIVED_FILE_DIR)",
3834
4120
  DERIVED_SOURCES_DIR: "$(DERIVED_FILE_DIR)",
@@ -3852,7 +4138,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
3852
4138
  xcconfigs
3853
4139
  );
3854
4140
  const searchRules = recursiveSearchRules(settings2);
3855
- const absolute = (file) => import_node_path5.default.resolve(ref.project.projectDir, file);
4141
+ const absolute = (file) => import_node_path6.default.resolve(ref.project.projectDir, file);
3856
4142
  const framework = FRAMEWORK_PRODUCTS.has(str(ref.target.productType) ?? "");
3857
4143
  const product = settings2("PRODUCT_NAME");
3858
4144
  const moduleName = applyOperator(settings2("PRODUCT_MODULE_NAME"), "c99extidentifier");
@@ -3883,7 +4169,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
3883
4169
  `${name}: Swift compatibility header phase has no Swift producer sources`
3884
4170
  );
3885
4171
  const building = options.prepareGeneratedSources && options.requireSources !== false;
3886
- const versioning = building && allSources.length > 0 && settings2("VERSIONING_SYSTEM") === "apple-generic" ? import_node_path5.default.join(settings2("DERIVED_FILE_DIR"), `${product}_vers.c`) : null;
4172
+ const versioning = building && allSources.length > 0 && settings2("VERSIONING_SYSTEM") === "apple-generic" ? import_node_path6.default.join(settings2("DERIVED_FILE_DIR"), `${product}_vers.c`) : null;
3887
4173
  if (versioning) {
3888
4174
  const version = settings2("CURRENT_PROJECT_VERSION");
3889
4175
  const custom = [
@@ -3896,7 +4182,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
3896
4182
  ].filter((key) => settings2(key));
3897
4183
  if (custom.length)
3898
4184
  throw new Error(
3899
- `${name}: Xcode generates ${import_node_path5.default.basename(versioning)} with ${custom.join(", ")}; peach does not model VERSION_INFO_* overrides`
4185
+ `${name}: Xcode generates ${import_node_path6.default.basename(versioning)} with ${custom.join(", ")}; peach does not model VERSION_INFO_* overrides`
3900
4186
  );
3901
4187
  const symbol = product.replace(/^[^A-Za-z_]/, "_").replace(/[^A-Za-z0-9_]/g, "_");
3902
4188
  const [major, minor] = version.split(".");
@@ -3909,9 +4195,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
3909
4195
  ` const double ${symbol}VersionNumber __attribute__ ((used)) = (double)${number};`,
3910
4196
  ""
3911
4197
  ].join("\n");
3912
- if (!import_node_fs3.default.existsSync(versioning) || import_node_fs3.default.readFileSync(versioning, "utf8") !== unit) {
3913
- import_node_fs3.default.mkdirSync(import_node_path5.default.dirname(versioning), { recursive: true });
3914
- import_node_fs3.default.writeFileSync(versioning, unit);
4198
+ if (!import_node_fs4.default.existsSync(versioning) || import_node_fs4.default.readFileSync(versioning, "utf8") !== unit) {
4199
+ import_node_fs4.default.mkdirSync(import_node_path6.default.dirname(versioning), { recursive: true });
4200
+ import_node_fs4.default.writeFileSync(versioning, unit);
3915
4201
  }
3916
4202
  allSources.push(versioning);
3917
4203
  }
@@ -3930,7 +4216,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
3930
4216
  const headerFiles = headerPhase(ref);
3931
4217
  const ownHeaders = /* @__PURE__ */ new Map();
3932
4218
  for (const { file, visibility } of headerFiles) {
3933
- const name2 = import_node_path5.default.basename(file);
4219
+ const name2 = import_node_path6.default.basename(file);
3934
4220
  const published = visibility !== "Project";
3935
4221
  if (!ownHeaders.has(name2))
3936
4222
  ownHeaders.set(name2, published ? `${product}/${name2}` : file);
@@ -3938,7 +4224,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
3938
4224
  ownHeaders.set(`${product}/${name2}`, file);
3939
4225
  }
3940
4226
  for (const file of synchronizedHeaders(ref)) {
3941
- const name2 = import_node_path5.default.basename(file);
4227
+ const name2 = import_node_path6.default.basename(file);
3942
4228
  if (ownHeaders.has(name2)) continue;
3943
4229
  ownHeaders.set(name2, file);
3944
4230
  const qualified = `${product}/${name2}`;
@@ -3950,16 +4236,41 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
3950
4236
  const otherProduct = productName(other);
3951
4237
  for (const { file, visibility } of headerPhase(other)) {
3952
4238
  if (visibility === "Project") continue;
3953
- const key = `${otherProduct}/${import_node_path5.default.basename(file)}`;
4239
+ const key = `${otherProduct}/${import_node_path6.default.basename(file)}`;
3954
4240
  if (!nonFrameworkHeaders.has(key)) nonFrameworkHeaders.set(key, file);
3955
4241
  }
3956
4242
  }
3957
- const wrapper = import_node_path5.default.join(settings2("BUILT_PRODUCTS_DIR"), `${product}.framework`);
4243
+ const wrapper = import_node_path6.default.join(settings2("BUILT_PRODUCTS_DIR"), `${product}.framework`);
3958
4244
  const moduleMap = (settings2("DEFINES_MODULE") === "YES" || !framework) && settings2("MODULEMAP_FILE") ? absolute(settings2("MODULEMAP_FILE")) : null;
3959
- const podHeaders = !framework && isPodsProject(ref.project.xcodeproj) && moduleMap && import_node_path5.default.relative(import_node_path5.default.join(ref.project.projectDir, "Headers", "Public"), moduleMap).split(import_node_path5.default.sep)[0] !== ".." && import_node_fs3.default.existsSync(moduleMap) ? import_node_fs3.default.readdirSync(import_node_path5.default.dirname(moduleMap)).flatMap((entry) => {
4245
+ const frameworkUmbrella = !compatibility && framework && members.sources.length > 0 && moduleMap ? import_node_path6.default.join(import_node_path6.default.dirname(moduleMap), `${moduleName}-umbrella.h`) : null;
4246
+ const frameworkCompatibility = frameworkUmbrella && moduleMap && import_node_fs4.default.existsSync(moduleMap) && import_node_fs4.default.existsSync(frameworkUmbrella) ? {
4247
+ framework: true,
4248
+ moduleMap,
4249
+ umbrella: frameworkUmbrella,
4250
+ outputModuleMap: import_node_path6.default.join(wrapper, "Modules", "module.modulemap"),
4251
+ outputUmbrella: import_node_path6.default.join(
4252
+ wrapper,
4253
+ "Headers",
4254
+ import_node_path6.default.basename(frameworkUmbrella)
4255
+ ),
4256
+ outputHeader: import_node_path6.default.join(
4257
+ wrapper,
4258
+ "Headers",
4259
+ settings2("SWIFT_OBJC_INTERFACE_HEADER_NAME") || `${moduleName}-Swift.h`
4260
+ )
4261
+ } : null;
4262
+ const swiftCompatibility = compatibility ? {
4263
+ framework: false,
4264
+ moduleMap: compatibility.moduleMap,
4265
+ umbrella: compatibility.umbrella,
4266
+ outputModuleMap: compatibility.outputModuleMap,
4267
+ outputUmbrella: compatibility.outputUmbrella,
4268
+ outputHeader: compatibility.outputHeader
4269
+ } : frameworkCompatibility;
4270
+ const podHeaders = !framework && isPodsProject(ref.project.xcodeproj) && moduleMap && import_node_path6.default.relative(import_node_path6.default.join(ref.project.projectDir, "Headers", "Public"), moduleMap).split(import_node_path6.default.sep)[0] !== ".." && import_node_fs4.default.existsSync(moduleMap) ? import_node_fs4.default.readdirSync(import_node_path6.default.dirname(moduleMap)).flatMap((entry) => {
3960
4271
  if (!/\.(h|hh|hpp|hxx|modulemap)$/.test(entry)) return [];
3961
- const file = import_node_path5.default.join(import_node_path5.default.dirname(moduleMap), entry);
3962
- return import_node_fs3.default.existsSync(file) ? [file] : [];
4272
+ const file = import_node_path6.default.join(import_node_path6.default.dirname(moduleMap), entry);
4273
+ return import_node_fs4.default.existsSync(file) ? [file] : [];
3963
4274
  }) : [];
3964
4275
  const fileFlags = {};
3965
4276
  for (const phaseId of list(ref.target.buildPhases)) {
@@ -3977,6 +4288,8 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
3977
4288
  );
3978
4289
  }
3979
4290
  }
4291
+ const cStandard = settings2("GCC_C_LANGUAGE_STANDARD");
4292
+ const cxxStandard = settings2("CLANG_CXX_LANGUAGE_STANDARD");
3980
4293
  return {
3981
4294
  settings: settings2,
3982
4295
  keys,
@@ -4002,13 +4315,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
4002
4315
  swift: {
4003
4316
  flags: settingList(settings2("OTHER_SWIFT_FLAGS")),
4004
4317
  includePaths: settingList(settings2("SWIFT_INCLUDE_PATHS")).map(absolute),
4005
- compatibility: compatibility ? {
4006
- moduleMap: compatibility.moduleMap,
4007
- umbrella: compatibility.umbrella,
4008
- outputModuleMap: compatibility.outputModuleMap,
4009
- outputUmbrella: compatibility.outputUmbrella,
4010
- outputHeader: compatibility.outputHeader
4011
- } : null
4318
+ compatibility: swiftCompatibility
4012
4319
  }
4013
4320
  } : {},
4014
4321
  ...native ? {
@@ -4024,7 +4331,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
4024
4331
  ...headers,
4025
4332
  ...Object.keys(ref.project.objects).flatMap((id) => {
4026
4333
  const file = ref.project.resolvePath(id);
4027
- return file && HEADER_FILE.test(file) && import_node_fs3.default.existsSync(file) ? [file] : [];
4334
+ return file && HEADER_FILE.test(file) && import_node_fs4.default.existsSync(file) ? [file] : [];
4028
4335
  })
4029
4336
  ])
4030
4337
  ],
@@ -4033,15 +4340,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
4033
4340
  // xcode searches its products' include directory before
4034
4341
  // HEADER_SEARCH_PATHS and the target's derived sources after.
4035
4342
  headerSearchPaths: [
4036
- import_node_path5.default.join(settings2("BUILT_PRODUCTS_DIR"), "include"),
4343
+ import_node_path6.default.join(settings2("BUILT_PRODUCTS_DIR"), "include"),
4037
4344
  ...settingList(settings2("HEADER_SEARCH_PATHS")).flatMap(
4038
4345
  (raw) => expandSearchPath(absolute(raw), searchRules)
4039
4346
  ),
4040
- import_node_path5.default.join(
4347
+ import_node_path6.default.join(
4041
4348
  `${settings2("DERIVED_FILE_DIR")}-normal`,
4042
4349
  settings2("CURRENT_ARCH")
4043
4350
  ),
4044
- import_node_path5.default.join(settings2("DERIVED_FILE_DIR"), settings2("CURRENT_ARCH")),
4351
+ import_node_path6.default.join(settings2("DERIVED_FILE_DIR"), settings2("CURRENT_ARCH")),
4045
4352
  settings2("DERIVED_FILE_DIR")
4046
4353
  ],
4047
4354
  userHeaderSearchPaths: settingList(
@@ -4058,14 +4365,18 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
4058
4365
  settings2("CLANG_ENABLE_OBJC_ARC") === "YES" ? "-fobjc-arc" : "-fno-objc-arc",
4059
4366
  ...settings2("CLANG_ENABLE_OBJC_WEAK") === "YES" ? ["-fobjc-weak"] : [],
4060
4367
  ...settings2("CLANG_ENABLE_MODULES") === "YES" ? ["-fmodules"] : [],
4061
- ...settings2("GCC_C_LANGUAGE_STANDARD") ? [`-std=${settings2("GCC_C_LANGUAGE_STANDARD")}`] : [],
4368
+ ...cStandard && cStandard !== "compiler-default" ? [`-std=${cStandard}`] : [],
4062
4369
  ...settingList(settings2("GCC_PREPROCESSOR_DEFINITIONS")).map(
4063
4370
  (value) => `-D${value}`
4064
4371
  ),
4065
4372
  ...settingList(settings2("OTHER_CFLAGS"))
4066
4373
  ],
4067
4374
  cxxFlags: [
4068
- ...settings2("CLANG_CXX_LANGUAGE_STANDARD") ? [`-std=${settings2("CLANG_CXX_LANGUAGE_STANDARD")}`] : [],
4375
+ ...cxxStandard && cxxStandard !== "compiler-default" ? [`-std=${CXX_STANDARD_ALIASES[cxxStandard] ?? cxxStandard}`] : [],
4376
+ // clang.xcspec's hidden CLANG_DISABLE_CXX_MODULES (default
4377
+ // YES) keeps c++ and objective-c++ units out of modules when
4378
+ // modules are on or the standard is c++20 or later.
4379
+ ...settings2("CLANG_DISABLE_CXX_MODULES") !== "NO" && (settings2("CLANG_ENABLE_MODULES") === "YES" || !PRE_CXX20_STANDARDS.has(cxxStandard || "compiler-default")) ? ["-fno-cxx-modules"] : [],
4069
4380
  ...settingList(settings2("OTHER_CPLUSPLUSFLAGS"))
4070
4381
  ],
4071
4382
  fileFlags,
@@ -4081,16 +4392,42 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
4081
4392
  ...headerFiles.flatMap(
4082
4393
  ({ file, visibility }) => visibility === "Project" ? [] : [
4083
4394
  [
4084
- import_node_path5.default.join(
4395
+ import_node_path6.default.join(
4085
4396
  wrapper,
4086
4397
  visibility === "Public" ? "Headers" : "PrivateHeaders",
4087
- import_node_path5.default.basename(file)
4398
+ import_node_path6.default.basename(file)
4088
4399
  ),
4089
4400
  file
4090
4401
  ]
4091
4402
  ]
4092
4403
  ),
4093
- ...moduleMap ? [[import_node_path5.default.join(wrapper, "Modules", "module.modulemap"), moduleMap]] : []
4404
+ // a copy files phase into the products directory, as
4405
+ // cocoapods writes for each header_mappings_dir folder.
4406
+ ...list(ref.target.buildPhases).flatMap((phaseId) => {
4407
+ const phase = ref.project.object(phaseId);
4408
+ if (phase?.isa !== "PBXCopyFilesBuildPhase" || str(phase.dstSubfolderSpec) !== "16")
4409
+ return [];
4410
+ const destination = expand(
4411
+ str(phase.dstPath) ?? "",
4412
+ (name2) => name2 === "PUBLIC_HEADERS_FOLDER_PATH" ? import_node_path6.default.join(wrapper, "Headers") : name2 === "PRIVATE_HEADERS_FOLDER_PATH" ? import_node_path6.default.join(wrapper, "PrivateHeaders") : settings2(name2)
4413
+ );
4414
+ return list(phase.files).flatMap((id) => {
4415
+ const file = ref.project.resolvePath(
4416
+ str(ref.project.object(id)?.fileRef) ?? ""
4417
+ );
4418
+ return file && HEADER_FILE.test(file) ? [
4419
+ [
4420
+ import_node_path6.default.resolve(
4421
+ settings2("BUILT_PRODUCTS_DIR"),
4422
+ destination,
4423
+ import_node_path6.default.basename(file)
4424
+ ),
4425
+ file
4426
+ ]
4427
+ ] : [];
4428
+ });
4429
+ }),
4430
+ ...moduleMap ? [[import_node_path6.default.join(wrapper, "Modules", "module.modulemap"), moduleMap]] : []
4094
4431
  ]) : Object.fromEntries(podHeaders.map((file) => [file, file]))
4095
4432
  }
4096
4433
  } : {}
@@ -4099,29 +4436,94 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
4099
4436
  };
4100
4437
  const builtTargets = order.map((ref) => ({ ref, ...moduleTarget(ref) }));
4101
4438
  const { settings, keys: settingKeys, module: module2 } = builtTargets.at(-1);
4102
- const frameworkTargets = builtTargets.slice(0, -1).filter(({ ref }) => ref.target.isa === "PBXNativeTarget").map(({ ref, module: module3 }) => ({ ref, framework: module3 }));
4439
+ const frameworkTargets = builtTargets.slice(0, -1).filter(({ ref }) => MODULE_PRODUCTS.has(str(ref.target.productType) ?? "")).map(({ ref, module: module3 }) => ({ ref, framework: module3 }));
4103
4440
  const frameworks = frameworkTargets.map(({ framework }) => framework);
4104
4441
  const podSourceDirs = frameworkTargets.flatMap(
4105
- ({ ref, framework }) => isPodsProject(ref.project.xcodeproj) ? [...framework.allSources, ...framework.objc?.headers ?? []].map((file) => import_node_path5.default.dirname(file)).filter((dir) => import_node_fs3.default.existsSync(dir)) : []
4442
+ ({ ref, framework }) => isPodsProject(ref.project.xcodeproj) ? [...framework.allSources, ...framework.objc?.headers ?? []].map((file) => import_node_path6.default.dirname(file)).filter((dir) => import_node_fs4.default.existsSync(dir)) : []
4106
4443
  );
4107
- const expandValue = (value) => {
4108
- if (typeof value === "string") return expand(value, settings);
4109
- if (Array.isArray(value)) return value.map(expandValue);
4444
+ const expandValue = (value, settings2) => {
4445
+ if (typeof value === "string") return expand(value, settings2);
4446
+ if (Array.isArray(value)) return value.map((item) => expandValue(item, settings2));
4110
4447
  if (typeof value === "object" && !(value instanceof Date) && !Buffer.isBuffer(value)) {
4111
4448
  return Object.fromEntries(
4112
- Object.entries(value).map(([key, value2]) => [key, expandValue(value2)])
4449
+ Object.entries(value).map(([key, value2]) => [key, expandValue(value2, settings2)])
4113
4450
  );
4114
4451
  }
4115
4452
  return value;
4116
4453
  };
4117
- const infoPlistFile = settings("INFOPLIST_FILE") ? import_node_path5.default.resolve(app.project.projectDir, settings("INFOPLIST_FILE")) : null;
4454
+ const resourceProducts = [];
4455
+ const bundleTargets = builtTargets.filter(
4456
+ ({ ref }) => ref.target.productType === RESOURCE_BUNDLE
4457
+ );
4458
+ for (const owner of options.installedPods ? builtTargets : []) {
4459
+ for (const phaseId of list(owner.ref.target.buildPhases)) {
4460
+ const phase = owner.ref.project.object(phaseId);
4461
+ if (phase?.isa !== "PBXShellScriptBuildPhase" || str(phase.name) !== "[CP] Copy Pods Resources")
4462
+ continue;
4463
+ const absolute = (raw) => import_node_path6.default.resolve(owner.ref.project.projectDir, expand(raw, owner.settings));
4464
+ const entries = (paths) => paths.flatMap((raw) => {
4465
+ const file = absolute(raw);
4466
+ xcconfigs.add(file);
4467
+ return fileListEntries(file, absolute);
4468
+ });
4469
+ const inputs = entries(list(phase.inputFileListPaths)).filter(
4470
+ (file) => file.endsWith(".bundle")
4471
+ );
4472
+ const outputs = entries(list(phase.outputFileListPaths)).filter(
4473
+ (file) => file.endsWith(".bundle")
4474
+ );
4475
+ if (inputs.length !== outputs.length)
4476
+ throw new Error(`${owner.module.name}: resource bundle copy lists differ`);
4477
+ const destinationRoot = import_node_path6.default.join(
4478
+ owner.settings("TARGET_BUILD_DIR"),
4479
+ owner.settings("UNLOCALIZED_RESOURCES_FOLDER_PATH")
4480
+ );
4481
+ for (const [index, input2] of inputs.entries()) {
4482
+ const product = bundleTargets.find((target) => {
4483
+ const file = str(
4484
+ target.ref.project.object(str(target.ref.target.productReference))?.path
4485
+ );
4486
+ return file && import_node_path6.default.join(target.settings("TARGET_BUILD_DIR"), file) === input2;
4487
+ });
4488
+ if (!product)
4489
+ throw new Error(
4490
+ `${owner.module.name}: resource bundle input has no selected producer: ${input2}`
4491
+ );
4492
+ const destination = import_node_path6.default.relative(destinationRoot, outputs[index]);
4493
+ if (destination === ".." || destination.startsWith(`..${import_node_path6.default.sep}`) || import_node_path6.default.isAbsolute(destination) || import_node_path6.default.basename(input2) !== import_node_path6.default.basename(destination))
4494
+ throw new Error(
4495
+ `${owner.module.name}: invalid resource bundle copy destination`
4496
+ );
4497
+ const infoFile = import_node_path6.default.resolve(
4498
+ product.ref.project.projectDir,
4499
+ product.settings("INFOPLIST_FILE")
4500
+ );
4501
+ xcconfigs.add(infoFile);
4502
+ const parsed = import_plist2.default.parse(import_node_fs4.default.readFileSync(infoFile, "utf8"));
4503
+ const infoPlist = import_plist2.default.build(expandValue(parsed, product.settings));
4504
+ const prefix = owner.ref === app ? "" : `Frameworks/${owner.module.moduleName}.framework/`;
4505
+ const bundlePath = prefix + destination.split(import_node_path6.default.sep).join("/");
4506
+ if (resourceProducts.some((resource) => resource.path === bundlePath))
4507
+ throw new Error(
4508
+ `${owner.module.name}: duplicate resource bundle destination ${bundlePath}`
4509
+ );
4510
+ resourceProducts.push({
4511
+ path: bundlePath,
4512
+ resources: product.module.resources,
4513
+ infoPlist
4514
+ });
4515
+ }
4516
+ }
4517
+ }
4518
+ const infoPlistFile = settings("INFOPLIST_FILE") ? import_node_path6.default.resolve(app.project.projectDir, settings("INFOPLIST_FILE")) : null;
4118
4519
  const infoPlistPending = module2.generatedInfoPlist && !options.prepareGeneratedSources;
4119
- const sourceInfo = infoPlistFile && !infoPlistPending ? import_plist2.default.parse(import_node_fs3.default.readFileSync(infoPlistFile, "utf8")) : {};
4520
+ const sourceInfo = infoPlistFile && !infoPlistPending ? import_plist2.default.parse(import_node_fs4.default.readFileSync(infoPlistFile, "utf8")) : {};
4120
4521
  if (!sourceInfo || typeof sourceInfo !== "object" || Array.isArray(sourceInfo) || sourceInfo instanceof Date || Buffer.isBuffer(sourceInfo)) {
4121
4522
  throw new Error(`${module2.name} Info.plist must contain a dictionary`);
4122
4523
  }
4123
4524
  const info = {};
4124
- for (const [key, value] of Object.entries(sourceInfo)) info[key] = expandValue(value);
4525
+ for (const [key, value] of Object.entries(sourceInfo))
4526
+ info[key] = expandValue(value, settings);
4125
4527
  for (const key of settingKeys) {
4126
4528
  if (!key.startsWith("INFOPLIST_KEY_") || key.endsWith("_Generation")) continue;
4127
4529
  const value = settings(key);
@@ -4144,7 +4546,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
4144
4546
  };
4145
4547
  }
4146
4548
  const localPackageDirs = [
4147
- ...listed.filter((reference) => import_node_fs3.default.existsSync(import_node_path5.default.join(reference, "Package.swift"))),
4549
+ ...listed.filter((reference) => import_node_fs4.default.existsSync(import_node_path6.default.join(reference, "Package.swift"))),
4148
4550
  ...projects.flatMap(
4149
4551
  (project) => Object.entries(project.objects).flatMap(([id, entry]) => {
4150
4552
  if (!isDict(entry)) return [];
@@ -4154,19 +4556,19 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
4154
4556
  const packages = [];
4155
4557
  while (pending.length > 0) {
4156
4558
  const dir = pending.pop();
4157
- if (import_node_fs3.default.existsSync(import_node_path5.default.join(dir, "Package.swift"))) {
4559
+ if (import_node_fs4.default.existsSync(import_node_path6.default.join(dir, "Package.swift"))) {
4158
4560
  packages.push(dir);
4159
4561
  continue;
4160
4562
  }
4161
4563
  if (!isDirectory(dir)) continue;
4162
- for (const child of import_node_fs3.default.readdirSync(dir, { withFileTypes: true }))
4564
+ for (const child of import_node_fs4.default.readdirSync(dir, { withFileTypes: true }))
4163
4565
  if (child.isDirectory() && !child.name.startsWith("."))
4164
- pending.push(import_node_path5.default.join(dir, child.name));
4566
+ pending.push(import_node_path6.default.join(dir, child.name));
4165
4567
  }
4166
4568
  return packages;
4167
4569
  }
4168
- const candidate = entry.isa === "XCLocalSwiftPackageReference" ? import_node_path5.default.resolve(project.projectDir, str(entry.relativePath) ?? "") : entry.isa === "PBXFileReference" ? project.resolvePath(id) : null;
4169
- return candidate && import_node_fs3.default.existsSync(import_node_path5.default.join(candidate, "Package.swift")) ? [candidate] : [];
4570
+ const candidate = entry.isa === "XCLocalSwiftPackageReference" ? import_node_path6.default.resolve(project.projectDir, str(entry.relativePath) ?? "") : entry.isa === "PBXFileReference" ? project.resolvePath(id) : null;
4571
+ return candidate && import_node_fs4.default.existsSync(import_node_path6.default.join(candidate, "Package.swift")) ? [candidate] : [];
4170
4572
  })
4171
4573
  )
4172
4574
  ];
@@ -4187,12 +4589,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
4187
4589
  const linkedProductKeys = /* @__PURE__ */ new Set();
4188
4590
  const binaryFrameworks = /* @__PURE__ */ new Map();
4189
4591
  for (const { ref, settings: settings2 } of builtTargets) {
4190
- const absolute = (raw) => import_node_path5.default.resolve(ref.project.projectDir, expand(raw, settings2));
4592
+ const absolute = (raw) => import_node_path6.default.resolve(ref.project.projectDir, expand(raw, settings2));
4191
4593
  for (const raw of settingList(settings2("SWIFT_INCLUDE_PATHS"))) {
4192
4594
  const dir = absolute(raw);
4193
- const modulemap = import_node_path5.default.join(dir, "module.modulemap");
4194
- if (!import_node_fs3.default.existsSync(modulemap)) continue;
4195
- const name = moduleMapName(import_node_fs3.default.readFileSync(modulemap, "utf8"));
4595
+ const modulemap = import_node_path6.default.join(dir, "module.modulemap");
4596
+ if (!import_node_fs4.default.existsSync(modulemap)) continue;
4597
+ const name = moduleMapName(import_node_fs4.default.readFileSync(modulemap, "utf8"));
4196
4598
  if (name && !binaryFrameworks.has(name)) binaryFrameworks.set(name, dir);
4197
4599
  }
4198
4600
  for (const phaseId of list(ref.target.buildPhases)) {
@@ -4201,7 +4603,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
4201
4603
  const inputs = list(phase.inputPaths).map(absolute);
4202
4604
  for (const raw of list(phase.inputFileListPaths)) {
4203
4605
  const file = absolute(raw);
4204
- if (!import_node_fs3.default.existsSync(file)) continue;
4606
+ if (!import_node_fs4.default.existsSync(file)) continue;
4205
4607
  xcconfigs.add(file);
4206
4608
  inputs.push(...fileListEntries(file, absolute));
4207
4609
  }
@@ -4240,7 +4642,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
4240
4642
  product,
4241
4643
  source: reference?.isa === "XCRemoteSwiftPackageReference" ? { kind: "remote", url: str(reference.repositoryURL) ?? "" } : reference?.isa === "XCLocalSwiftPackageReference" ? {
4242
4644
  kind: "local",
4243
- dir: import_node_path5.default.resolve(
4645
+ dir: import_node_path6.default.resolve(
4244
4646
  project.projectDir,
4245
4647
  str(reference.relativePath) ?? ""
4246
4648
  )
@@ -4263,11 +4665,20 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
4263
4665
  const fileId = str(project.object(buildFileId)?.fileRef);
4264
4666
  const file = project.object(fileId);
4265
4667
  const tree = str(file?.sourceTree);
4266
- const name = /([^/]+)\.(xc)?framework$/.exec(str(file?.path) ?? "")?.[1];
4668
+ const rawPath = str(file?.path) ?? "";
4669
+ const name = /([^/]+)\.(xc)?framework$/.exec(rawPath)?.[1];
4267
4670
  if (file?.isa !== "PBXFileReference" || !name) continue;
4268
- if (tree === "BUILT_PRODUCTS_DIR" || tree === "SDKROOT" || tree === "DEVELOPER_DIR")
4671
+ if (tree === "BUILT_PRODUCTS_DIR" || tree === "SDKROOT" || tree === "DEVELOPER_DIR" || // a path into the sdk's own frameworks folder is the sdk's own
4672
+ // however it is rooted: xcode links -framework <name> from the sdk
4673
+ // and a stale group-relative path to it contributes nothing.
4674
+ /\/System\/Library\/Frameworks\/[^/]+$/.test(`/${rawPath}`) || // a target in the workspace builds it, so it exists only after that build
4675
+ byProduct.has(import_node_path6.default.basename(rawPath)))
4269
4676
  continue;
4270
4677
  const resolved = fileId ? project.resolvePath(fileId) : null;
4678
+ if (fileId && resolved !== null && !import_node_fs4.default.existsSync(resolved))
4679
+ throw new Error(
4680
+ `${str(target.name) ?? "target"}: linked framework ${name} (${fileId}) points at missing ${resolved} in ${project.projectFile}`
4681
+ );
4271
4682
  if (!binaryFrameworks.get(name)) binaryFrameworks.set(name, resolved);
4272
4683
  }
4273
4684
  }
@@ -4282,18 +4693,18 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
4282
4693
  }
4283
4694
  for (const built of builtTargets)
4284
4695
  built.module.packageProducts = productsByTarget.get(built.ref) ?? [];
4285
- const resolvedFile = import_node_path5.default.join(
4286
- workspace ?? import_node_path5.default.join(xcodeprojOrWorkspace, "project.xcworkspace"),
4696
+ const resolvedFile = import_node_path6.default.join(
4697
+ workspace ?? import_node_path6.default.join(xcodeprojOrWorkspace, "project.xcworkspace"),
4287
4698
  "xcshareddata",
4288
4699
  "swiftpm",
4289
4700
  "Package.resolved"
4290
4701
  );
4291
- let packageResolved = import_node_fs3.default.existsSync(resolvedFile) ? [import_node_fs3.default.realpathSync(resolvedFile)] : [...new Set(localPackageDirs.map((dir) => import_node_path5.default.join(dir, "Package.resolved")))].filter((file) => import_node_fs3.default.existsSync(file)).map((file) => import_node_fs3.default.realpathSync(file)).sort();
4702
+ let packageResolved = import_node_fs4.default.existsSync(resolvedFile) ? [import_node_fs4.default.realpathSync(resolvedFile)] : [...new Set(localPackageDirs.map((dir) => import_node_path6.default.join(dir, "Package.resolved")))].filter((file) => import_node_fs4.default.existsSync(file)).map((file) => import_node_fs4.default.realpathSync(file)).sort();
4292
4703
  if (packageResolved.length === 0) {
4293
4704
  const requirements = remotePackageRequirements(projects);
4294
4705
  if (requirements.length > 0) {
4295
4706
  resolveSwiftPackageRequirements(requirements, resolvedFile);
4296
- packageResolved = [import_node_fs3.default.realpathSync(resolvedFile)];
4707
+ packageResolved = [import_node_fs4.default.realpathSync(resolvedFile)];
4297
4708
  }
4298
4709
  }
4299
4710
  const used = order.map((ref) => ref.project);
@@ -4301,14 +4712,14 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
4301
4712
  ...module2,
4302
4713
  rootDir: commonAncestor(
4303
4714
  [
4304
- workspace ? import_node_path5.default.dirname(workspace) : app.project.projectDir,
4715
+ workspace ? import_node_path6.default.dirname(workspace) : app.project.projectDir,
4305
4716
  ...used.map((project) => project.projectDir),
4306
4717
  ...localPackageDirs,
4307
4718
  ...linkedProducts.flatMap(
4308
- ({ source }) => source.kind === "local" && import_node_fs3.default.existsSync(source.dir) ? [source.dir] : []
4719
+ ({ source }) => source.kind === "local" && import_node_fs4.default.existsSync(source.dir) ? [source.dir] : []
4309
4720
  ),
4310
4721
  ...new Set(podSourceDirs)
4311
- ].map((dir) => import_node_fs3.default.realpathSync(dir))
4722
+ ].map((dir) => import_node_fs4.default.realpathSync(dir))
4312
4723
  ),
4313
4724
  projectFiles: [
4314
4725
  .../* @__PURE__ */ new Set([
@@ -4321,10 +4732,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
4321
4732
  appIconName: settings("ASSETCATALOG_COMPILER_APPICON_NAME"),
4322
4733
  infoPlist: infoPlistPending ? null : import_plist2.default.build(info),
4323
4734
  infoPlistFile,
4735
+ developmentRegion: str(app.project.project.developmentRegion) ?? "en",
4324
4736
  frameworks,
4737
+ resourceProducts,
4325
4738
  linkedProducts,
4326
4739
  localPackageDirs: [
4327
- ...new Set(localPackageDirs.map((dir) => import_node_fs3.default.realpathSync(dir)))
4740
+ ...new Set(localPackageDirs.map((dir) => import_node_fs4.default.realpathSync(dir)))
4328
4741
  ].sort(),
4329
4742
  binaryFrameworks: [...binaryFrameworks].map(([name, file]) => ({ name, path: file })).sort((left, right) => left.name.localeCompare(right.name)),
4330
4743
  packageResolved,
@@ -4403,7 +4816,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
4403
4816
  const rtcAppGroupIdentifier = nonEmptyString2(dictionary.RTCAppGroupIdentifier);
4404
4817
  const screenShareExtensionBundleId = typeof dictionary.ScreenShareExtensionBundleId === "string" ? dictionary.ScreenShareExtensionBundleId : void 0;
4405
4818
  const rootModuleName = readRootModuleName(
4406
- app.allSources.filter((file) => /\.(?:swift|mm|m)$/.test(file) && import_node_fs4.default.existsSync(file)).map((file) => import_node_fs4.default.readFileSync(file, "utf8"))
4819
+ app.allSources.filter((file) => /\.(?:swift|mm|m)$/.test(file) && import_node_fs5.default.existsSync(file)).map((file) => import_node_fs5.default.readFileSync(file, "utf8"))
4407
4820
  );
4408
4821
  return {
4409
4822
  applicationName,
@@ -4424,7 +4837,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
4424
4837
  googleSignIn: readGoogleSignInConfiguration(
4425
4838
  dictionary,
4426
4839
  Object.fromEntries(
4427
- app.resources.filter((file) => file.endsWith(".plist")).map((file) => [file, parseInfoPlist(import_node_fs4.default.readFileSync(file, "utf8"))])
4840
+ app.resources.filter((file) => file.endsWith(".plist")).map((file) => [file, parseInfoPlist(import_node_fs5.default.readFileSync(file, "utf8"))])
4428
4841
  )
4429
4842
  ),
4430
4843
  supportedInterfaceOrientations,
@@ -4433,11 +4846,11 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
4433
4846
  alternateIconNames: [...alternateIconNames],
4434
4847
  appIconArtwork: resolveNativeAppIconArtwork(
4435
4848
  app.resources,
4436
- (file) => import_node_fs4.default.readFileSync(file, "utf8"),
4849
+ (file) => import_node_fs5.default.readFileSync(file, "utf8"),
4437
4850
  (file) => {
4438
- const extension = import_node_path6.default.extname(file).toLowerCase();
4851
+ const extension = import_node_path7.default.extname(file).toLowerCase();
4439
4852
  const contentType = extension === ".jpg" || extension === ".jpeg" ? "image/jpeg" : extension === ".webp" ? "image/webp" : "image/png";
4440
- return `data:${contentType};base64,${import_node_fs4.default.readFileSync(file).toString("base64")}`;
4853
+ return `data:${contentType};base64,${import_node_fs5.default.readFileSync(file).toString("base64")}`;
4441
4854
  },
4442
4855
  icons,
4443
4856
  app.appIconName,
@@ -4457,10 +4870,10 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
4457
4870
  }
4458
4871
  var NativeAppTargetSelectionError = class extends Error {
4459
4872
  };
4460
- function readNativeAppIdentityFromProject(projectRoot, platform, parseInfoPlist = parsePlistSource, iosTarget, androidMergedManifest) {
4873
+ function readNativeAppIdentityFromProject(projectRoot, platform, parseInfoPlist = parsePlistSource, iosTarget, androidMergedManifest, environment) {
4461
4874
  const read = selectNativeAppIdentityReader(platform, {
4462
4875
  android: () => readAndroidNativeAppIdentity(projectRoot, androidMergedManifest),
4463
- ios: () => readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget)
4876
+ ios: () => readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget, environment)
4464
4877
  });
4465
4878
  return read ? read() : null;
4466
4879
  }
@@ -4468,22 +4881,22 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
4468
4881
  const read = selectNativeAppIdentityReader(platform, {
4469
4882
  android: () => null,
4470
4883
  ios: () => {
4471
- const iosRoot = import_node_path6.default.join(projectRoot, "ios");
4472
- if (!import_node_fs4.default.existsSync(iosRoot)) return null;
4884
+ const iosRoot = import_node_path7.default.join(projectRoot, "ios");
4885
+ if (!import_node_fs5.default.existsSync(iosRoot)) return null;
4473
4886
  const files = {};
4474
- for (const entry of import_node_fs4.default.readdirSync(iosRoot, { withFileTypes: true })) {
4887
+ for (const entry of import_node_fs5.default.readdirSync(iosRoot, { withFileTypes: true })) {
4475
4888
  if (entry.name === "Pods") continue;
4476
4889
  if (entry.isDirectory()) {
4477
4890
  const names = entry.name.endsWith(".xcodeproj") ? ["project.pbxproj"] : ["Info.plist", "AppDelegate.swift", "AppDelegate.mm", "AppDelegate.m"];
4478
4891
  for (const name of names) {
4479
4892
  const relative = `ios/${entry.name}/${name}`;
4480
- const file = import_node_path6.default.join(projectRoot, relative);
4481
- if (import_node_fs4.default.existsSync(file)) files[relative] = import_node_fs4.default.readFileSync(file, "utf8");
4893
+ const file = import_node_path7.default.join(projectRoot, relative);
4894
+ if (import_node_fs5.default.existsSync(file)) files[relative] = import_node_fs5.default.readFileSync(file, "utf8");
4482
4895
  }
4483
4896
  } else if (/AppDelegate\.(?:swift|mm|m)$/.test(entry.name)) {
4484
4897
  const relative = `ios/${entry.name}`;
4485
- const file = import_node_path6.default.join(projectRoot, relative);
4486
- if (import_node_fs4.default.existsSync(file)) files[relative] = import_node_fs4.default.readFileSync(file, "utf8");
4898
+ const file = import_node_path7.default.join(projectRoot, relative);
4899
+ if (import_node_fs5.default.existsSync(file)) files[relative] = import_node_fs5.default.readFileSync(file, "utf8");
4487
4900
  }
4488
4901
  }
4489
4902
  return extractNativeAppIdentityFromFiles(files, "ios", parseInfoPlist, iosTarget);
@@ -4494,41 +4907,41 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
4494
4907
  function readAndroidNativeAppIdentity(projectRoot, androidMergedManifest) {
4495
4908
  const files = {};
4496
4909
  if (androidMergedManifest) {
4497
- const file = import_node_path6.default.resolve(projectRoot, androidMergedManifest);
4498
- if (!import_node_fs4.default.existsSync(file)) return null;
4499
- files[androidMergedManifest] = import_node_fs4.default.readFileSync(file, "utf8");
4910
+ const file = import_node_path7.default.resolve(projectRoot, androidMergedManifest);
4911
+ if (!import_node_fs5.default.existsSync(file)) return null;
4912
+ files[androidMergedManifest] = import_node_fs5.default.readFileSync(file, "utf8");
4500
4913
  } else {
4501
- const androidRoot = import_node_path6.default.join(projectRoot, "android");
4502
- if (!import_node_fs4.default.existsSync(androidRoot)) return null;
4914
+ const androidRoot = import_node_path7.default.join(projectRoot, "android");
4915
+ if (!import_node_fs5.default.existsSync(androidRoot)) return null;
4503
4916
  const collect = (directory) => {
4504
- for (const entry of import_node_fs4.default.readdirSync(directory, { withFileTypes: true })) {
4505
- const file = import_node_path6.default.join(directory, entry.name);
4917
+ for (const entry of import_node_fs5.default.readdirSync(directory, { withFileTypes: true })) {
4918
+ const file = import_node_path7.default.join(directory, entry.name);
4506
4919
  if (entry.isDirectory()) collect(file);
4507
4920
  else if (entry.isFile() && entry.name === "AndroidManifest.xml")
4508
- files[import_node_path6.default.relative(projectRoot, file).split(import_node_path6.default.sep).join("/")] = import_node_fs4.default.readFileSync(file, "utf8");
4921
+ files[import_node_path7.default.relative(projectRoot, file).split(import_node_path7.default.sep).join("/")] = import_node_fs5.default.readFileSync(file, "utf8");
4509
4922
  }
4510
4923
  };
4511
- for (const module2 of import_node_fs4.default.readdirSync(androidRoot, { withFileTypes: true })) {
4924
+ for (const module2 of import_node_fs5.default.readdirSync(androidRoot, { withFileTypes: true })) {
4512
4925
  if (!module2.isDirectory()) continue;
4513
- const outputs = import_node_path6.default.join(
4926
+ const outputs = import_node_path7.default.join(
4514
4927
  androidRoot,
4515
4928
  module2.name,
4516
4929
  "build/intermediates/merged_manifests"
4517
4930
  );
4518
- if (import_node_fs4.default.existsSync(outputs)) collect(outputs);
4931
+ if (import_node_fs5.default.existsSync(outputs)) collect(outputs);
4519
4932
  }
4520
4933
  }
4521
4934
  for (const manifest of Object.keys(files)) {
4522
4935
  const resourceDirectory = androidMergedResourceValuesDirectory(manifest);
4523
4936
  if (!resourceDirectory) continue;
4524
- const absolute = import_node_path6.default.resolve(projectRoot, resourceDirectory);
4525
- if (!import_node_fs4.default.existsSync(absolute)) continue;
4526
- for (const entry of import_node_fs4.default.readdirSync(absolute, { withFileTypes: true })) {
4937
+ const absolute = import_node_path7.default.resolve(projectRoot, resourceDirectory);
4938
+ if (!import_node_fs5.default.existsSync(absolute)) continue;
4939
+ for (const entry of import_node_fs5.default.readdirSync(absolute, { withFileTypes: true })) {
4527
4940
  if (!entry.isDirectory() || !/^values(?:-|$)/.test(entry.name)) continue;
4528
- for (const resource of import_node_fs4.default.readdirSync(import_node_path6.default.join(absolute, entry.name))) {
4941
+ for (const resource of import_node_fs5.default.readdirSync(import_node_path7.default.join(absolute, entry.name))) {
4529
4942
  if (!resource.endsWith(".xml")) continue;
4530
4943
  const file = `${resourceDirectory}/${entry.name}/${resource}`;
4531
- files[file] = import_node_fs4.default.readFileSync(import_node_path6.default.resolve(projectRoot, file), "utf8");
4944
+ files[file] = import_node_fs5.default.readFileSync(import_node_path7.default.resolve(projectRoot, file), "utf8");
4532
4945
  }
4533
4946
  }
4534
4947
  }
@@ -4541,11 +4954,11 @@ function readAndroidNativeAppIdentity(projectRoot, androidMergedManifest) {
4541
4954
  androidMergedManifest
4542
4955
  );
4543
4956
  }
4544
- function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget) {
4545
- const app = readIosAppTarget(projectRoot, iosTarget);
4957
+ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget, environment) {
4958
+ const app = readIosAppTarget(projectRoot, iosTarget, environment);
4546
4959
  if (!app) return null;
4547
4960
  const identity = readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist);
4548
- const projectManifestPath = import_node_path6.default.join(projectRoot, "package.json");
4961
+ const projectManifestPath = import_node_path7.default.join(projectRoot, "package.json");
4549
4962
  const projectRequire = (0, import_node_module.createRequire)(projectManifestPath);
4550
4963
  let reanimatedManifestPath;
4551
4964
  try {
@@ -4559,22 +4972,22 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget) {
4559
4972
  throw error;
4560
4973
  }
4561
4974
  const installedManifest = JSON.parse(
4562
- import_node_fs4.default.readFileSync(reanimatedManifestPath, "utf8")
4975
+ import_node_fs5.default.readFileSync(reanimatedManifestPath, "utf8")
4563
4976
  );
4564
4977
  const installedVersion = isRecord(installedManifest) ? nonEmptyString2(installedManifest.version) : void 0;
4565
4978
  if (!installedVersion) throw new Error("Reanimated package version is malformed");
4566
4979
  if (Number.parseInt(installedVersion, 10) < 4) return identity;
4567
4980
  const defaults = JSON.parse(
4568
- import_node_fs4.default.readFileSync(
4569
- import_node_path6.default.join(
4570
- import_node_path6.default.dirname(reanimatedManifestPath),
4981
+ import_node_fs5.default.readFileSync(
4982
+ import_node_path7.default.join(
4983
+ import_node_path7.default.dirname(reanimatedManifestPath),
4571
4984
  "src/featureFlags/staticFlags.json"
4572
4985
  ),
4573
4986
  "utf8"
4574
4987
  )
4575
4988
  );
4576
4989
  if (!isRecord(defaults)) throw new Error("Reanimated static flags are malformed");
4577
- const manifest = JSON.parse(import_node_fs4.default.readFileSync(projectManifestPath, "utf8"));
4990
+ const manifest = JSON.parse(import_node_fs5.default.readFileSync(projectManifestPath, "utf8"));
4578
4991
  const reanimated = isRecord(manifest) ? manifest.reanimated : void 0;
4579
4992
  const overrides = isRecord(reanimated) ? reanimated.staticFeatureFlags : void 0;
4580
4993
  if (overrides !== void 0 && !isRecord(overrides)) {
@@ -4596,10 +5009,10 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget) {
4596
5009
  }
4597
5010
  return { ...identity, reanimatedStaticFeatureFlags: flags };
4598
5011
  }
4599
- function readIosAppTarget(projectRoot, iosTarget) {
4600
- const iosRoot = import_node_path6.default.join(projectRoot, "ios");
4601
- if (!import_node_fs4.default.existsSync(iosRoot)) return null;
4602
- const projects = import_node_fs4.default.readdirSync(iosRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj"));
5012
+ function readIosAppTarget(projectRoot, iosTarget, environment) {
5013
+ const iosRoot = import_node_path7.default.join(projectRoot, "ios");
5014
+ if (!import_node_fs5.default.existsSync(iosRoot)) return null;
5015
+ const projects = import_node_fs5.default.readdirSync(iosRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj"));
4603
5016
  if (projects.length === 0) return null;
4604
5017
  if (projects.length > 1 && !iosTarget) {
4605
5018
  throw new NativeAppTargetSelectionError(
@@ -4609,7 +5022,7 @@ function readIosAppTarget(projectRoot, iosTarget) {
4609
5022
  let project = projects[0];
4610
5023
  if (iosTarget && projects.length > 1) {
4611
5024
  const matches = projects.filter(
4612
- (entry) => listXcodeAppTargets(import_node_path6.default.join(iosRoot, entry.name), {
5025
+ (entry) => listXcodeAppTargets(import_node_path7.default.join(iosRoot, entry.name), {
4613
5026
  requireSources: false
4614
5027
  }).includes(iosTarget)
4615
5028
  );
@@ -4623,7 +5036,7 @@ function readIosAppTarget(projectRoot, iosTarget) {
4623
5036
  }
4624
5037
  project = matches[0];
4625
5038
  }
4626
- const xcodeproj = import_node_path6.default.join(iosRoot, project.name);
5039
+ const xcodeproj = import_node_path7.default.join(iosRoot, project.name);
4627
5040
  const appTargets = listXcodeAppTargets(xcodeproj, { requireSources: false });
4628
5041
  if (!iosTarget && appTargets.length > 1) {
4629
5042
  throw new NativeAppTargetSelectionError(
@@ -4632,7 +5045,8 @@ function readIosAppTarget(projectRoot, iosTarget) {
4632
5045
  }
4633
5046
  return readXcodeAppTarget(xcodeproj, iosTarget ?? appTargets[0], "Release", {
4634
5047
  requireSources: false,
4635
- prepareGeneratedSources: true
5048
+ prepareGeneratedSources: true,
5049
+ environment
4636
5050
  });
4637
5051
  }
4638
5052
  // Annotate the CommonJS export names for ESM import in node: