peachsim 0.1.2608 → 0.1.2610
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.
- package/cli/commands/perf-native.ts +120 -6
- package/cli/drivers/playwright-provisioning.ts +4 -1
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +2 -2
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +5 -5
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +3 -3
- package/dist-lib/bundle-channel.cjs +60485 -60177
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +3 -3
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +3 -3
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +2 -2
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +7 -7
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +5 -5
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/esm-chunks/{acorn-4QDEL7IO.mjs → acorn-L2SFCOHG.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-4C57RZXG.mjs → chunk-2LJTZ2KG.mjs} +17 -328
- package/dist-lib/esm-chunks/{chunk-X6CONUT6.mjs → chunk-42NDD4R7.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-F724FZHJ.mjs → chunk-73NIGS7D.mjs} +1490 -3950
- package/dist-lib/esm-chunks/{chunk-KNCWQQZG.mjs → chunk-CUBTZPSZ.mjs} +1 -1
- package/dist-lib/esm-chunks/chunk-EU5WMP5O.mjs +322 -0
- package/dist-lib/esm-chunks/{chunk-NXG27NGU.mjs → chunk-EYSNLE5V.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-IKFFQXJN.mjs → chunk-FP447MCW.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-JIW4PICV.mjs → chunk-HMTSU22Q.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-7KU5ROOE.mjs → chunk-KTAGV5U6.mjs} +14 -12
- package/dist-lib/esm-chunks/{chunk-3DUFAH5J.mjs → chunk-MJP4WOSX.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-H3QASOKR.mjs → chunk-MK4DOEDN.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-ZFI5OF6U.mjs → chunk-N3M5KT33.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-F2FHFORX.mjs → chunk-N7XU2WWO.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-UHYHEJ3N.mjs → chunk-RN73P2DY.mjs} +34 -28
- package/dist-lib/esm-chunks/{chunk-VICI67J5.mjs → chunk-VDLPNJ6P.mjs} +1 -1
- package/dist-lib/esm-chunks/chunk-W3LNUIUA.mjs +2655 -0
- package/dist-lib/esm-chunks/{chunk-R25MOOFS.mjs → chunk-WBQFHIGS.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-YBMBAXAZ.mjs → chunk-WZHEW7Z7.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-RTXAZMTP.mjs → chunk-X74N3K5N.mjs} +4 -4
- package/dist-lib/esm-chunks/{chunk-IJX7PBNG.mjs → chunk-XN74REO2.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-RZLGVWHK.mjs → chunk-YLUD2UET.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-BEWJL2LY.mjs → chunk-YVLXYLNV.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-W5EHCHDD.mjs → chunk-YYGSN3BN.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-GPPOU5DO.mjs → chunk-ZZB2LFYV.mjs} +1 -1
- package/dist-lib/esm-chunks/{metro-layout-parser-YWPJI3L6.mjs → metro-layout-parser-VDPXJ7LW.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-MWTLCMQD.mjs → swift-package-prebuilt-HRPDLN2P.mjs} +14 -11
- package/dist-lib/esm-chunks/{swift-sdk-app-module-PF5QMK5X.mjs → swift-sdk-app-module-5DOGMU3M.mjs} +16 -14
- package/dist-lib/esm-chunks/{swift-sdk-image-5IMAACRF.mjs → swift-sdk-image-W3UU4H4L.mjs} +16 -14
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-JPIJI25U.mjs → swift-sdk-image-producer-OJWD6ZOH.mjs} +8 -6
- package/dist-lib/expo-swift-bundle.cjs +42524 -42216
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +7 -7
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +43716 -43244
- package/dist-lib/host/fetch-proxy-handler.cjs +670 -645
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +3 -3
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +3 -3
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +4 -4
- package/dist-lib/native-app-identity-project.cjs +1499 -2889
- package/dist-lib/native-app-identity-project.mjs +317 -339
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +6 -6
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +3 -3
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +2 -2
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +3 -3
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +166 -154
- package/dist-lib/public-origins-lib.json +141 -198
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +2 -2
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +8 -8
- package/dist-lib/skills.cjs +38979 -38507
- package/dist-lib/swift-compile.cjs +12239 -12121
- package/dist-lib/swift-compile.mjs +36 -33
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +3 -3
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +6 -6
- package/dist-lib/swift-svg-raster.cjs +1 -1
- package/dist-lib/swift-svg-raster.mjs +2 -2
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
- package/dist-lib/vendor/acorn.cjs +1 -1
- package/dist-lib/vendor/magic-string.cjs +1 -1
- package/dist-lib/vendor/stream-json.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
- package/dist-lib/vendor/sucrase.cjs +1 -1
- package/dist-lib/vendor/terser.cjs +1 -1
- package/dist-lib/vendor/valibot.cjs +1 -1
- package/dist-lib/vendor/ws.cjs +1 -1
- package/dist-lib/vendor/zod.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +3 -3
- package/dist-types/packages/peach-engine/src/ios/apps/canvas-map-data.d.ts +13 -0
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +3 -0
- package/package.json +1 -1
- package/src/agent-prompt.ts +15 -2
- package/src/binaryen.lock.json +3 -3
- package/src/genrule-archives.ts +5 -2
- package/src/native-framework-compiler.ts +1 -1
- package/src/native-static-libraries.ts +2 -3
- package/src/native-swift-slices.ts +1 -1
- package/src/nitro-dependencies.ts +3 -7
- package/src/one-native-controls-package.ts +165 -11
- package/src/oneNativeControlsContract.ts +1 -0
- package/src/rive-runtime-dependencies.ts +1 -2
- package/src/swift-compile.ts +165 -1796
- package/src/swift-compiler-digest.ts +2 -0
- package/src/swift-distribution.ts +39 -15
- package/src/swift-objc-compile.ts +194 -32
- package/src/swift-package-manifest.ts +6 -29
- package/src/swift-packages.ts +6 -14
- package/src/swift-sdk-surface.ts +1811 -0
- package/src/swift-standin-digest.ts +28 -5
- package/src/swift-standins.ts +16 -19
- package/src/swift-wasm-archive.ts +200 -0
- package/src/swift-wasm-prune.ts +3 -93
- package/src/swift-wasm64-native-source.ts +4 -2
- package/src/swiftWasm64ConfigContract.ts +10 -0
- package/src/wasm-optimize.ts +18 -14
- package/src/xcode-project.ts +2 -4
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2610 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
import {
|
|
3
3
|
swiftNativePin
|
|
4
|
-
} from "./esm-chunks/chunk-
|
|
5
|
-
import "./esm-chunks/chunk-
|
|
6
|
-
import "./esm-chunks/chunk-
|
|
4
|
+
} from "./esm-chunks/chunk-RN73P2DY.mjs";
|
|
5
|
+
import "./esm-chunks/chunk-42NDD4R7.mjs";
|
|
6
|
+
import "./esm-chunks/chunk-YVLXYLNV.mjs";
|
|
7
7
|
import {
|
|
8
8
|
NATIVE_GRAPH_SDK_VERSION,
|
|
9
9
|
cacheDir
|
|
10
|
-
} from "./esm-chunks/chunk-
|
|
10
|
+
} from "./esm-chunks/chunk-W3LNUIUA.mjs";
|
|
11
11
|
import {
|
|
12
12
|
privateSwiftRelease,
|
|
13
13
|
swiftEnvironment,
|
|
14
14
|
swiftToolchainBin
|
|
15
|
-
} from "./esm-chunks/chunk-
|
|
16
|
-
import "./esm-chunks/chunk-
|
|
15
|
+
} from "./esm-chunks/chunk-2LJTZ2KG.mjs";
|
|
16
|
+
import "./esm-chunks/chunk-MK4DOEDN.mjs";
|
|
17
17
|
import {
|
|
18
18
|
SWIFT_OBJCXX_LANGUAGE_FLAG,
|
|
19
19
|
isSwiftNativeTranslationUnit,
|
|
20
20
|
moduleMapName
|
|
21
|
-
} from "./esm-chunks/chunk-
|
|
21
|
+
} from "./esm-chunks/chunk-CUBTZPSZ.mjs";
|
|
22
22
|
import {
|
|
23
23
|
androidMergedResourceValuesDirectory,
|
|
24
24
|
extractNativeAppIdentityFromFiles,
|
|
@@ -36,28 +36,27 @@ import {
|
|
|
36
36
|
xcodeBuildFileBuildsForIos,
|
|
37
37
|
xcodePathResolver,
|
|
38
38
|
xcodeTargetMemberVisitor
|
|
39
|
-
} from "./esm-chunks/chunk-
|
|
40
|
-
import "./esm-chunks/chunk-
|
|
39
|
+
} from "./esm-chunks/chunk-X74N3K5N.mjs";
|
|
40
|
+
import "./esm-chunks/chunk-EYSNLE5V.mjs";
|
|
41
41
|
import {
|
|
42
42
|
buildPlist,
|
|
43
43
|
parsePlist,
|
|
44
44
|
parsePlistSource,
|
|
45
45
|
parseXmlPlist
|
|
46
|
-
} from "./esm-chunks/chunk-
|
|
47
|
-
import "./esm-chunks/chunk-
|
|
48
|
-
import "./esm-chunks/chunk-
|
|
49
|
-
import "./esm-chunks/chunk-RZLGVWHK.mjs";
|
|
46
|
+
} from "./esm-chunks/chunk-FP447MCW.mjs";
|
|
47
|
+
import "./esm-chunks/chunk-WZHEW7Z7.mjs";
|
|
48
|
+
import "./esm-chunks/chunk-YLUD2UET.mjs";
|
|
50
49
|
import {
|
|
51
50
|
isRecord
|
|
52
|
-
} from "./esm-chunks/chunk-
|
|
51
|
+
} from "./esm-chunks/chunk-XN74REO2.mjs";
|
|
53
52
|
import {
|
|
54
53
|
__publicField
|
|
55
|
-
} from "./esm-chunks/chunk-
|
|
54
|
+
} from "./esm-chunks/chunk-N3M5KT33.mjs";
|
|
56
55
|
|
|
57
56
|
// src/native-app-identity-project.ts
|
|
58
|
-
import
|
|
57
|
+
import fs6 from "node:fs";
|
|
59
58
|
import { createRequire as createRequire2 } from "node:module";
|
|
60
|
-
import
|
|
59
|
+
import path6 from "node:path";
|
|
61
60
|
|
|
62
61
|
// src/plist-bytes.ts
|
|
63
62
|
import assert from "node:assert/strict";
|
|
@@ -191,11 +190,11 @@ function parsePlistBytes(source, parseXml = parsePlistSource) {
|
|
|
191
190
|
}
|
|
192
191
|
|
|
193
192
|
// src/xcode-project.ts
|
|
194
|
-
import { execFileSync as
|
|
195
|
-
import { createHash as
|
|
196
|
-
import
|
|
193
|
+
import { execFileSync as execFileSync2, spawnSync } from "node:child_process";
|
|
194
|
+
import { createHash as createHash7 } from "node:crypto";
|
|
195
|
+
import fs5 from "node:fs";
|
|
197
196
|
import { createRequire } from "node:module";
|
|
198
|
-
import
|
|
197
|
+
import path5 from "node:path";
|
|
199
198
|
|
|
200
199
|
// src/bazel-project.ts
|
|
201
200
|
import { execFileSync } from "node:child_process";
|
|
@@ -1532,7 +1531,7 @@ import { join as join3, relative, sep } from "node:path";
|
|
|
1532
1531
|
import { createHash as createHash3 } from "node:crypto";
|
|
1533
1532
|
import { readFileSync } from "node:fs";
|
|
1534
1533
|
import { join } from "node:path";
|
|
1535
|
-
var swiftCoverageProvenance = true ? JSON.parse('{"swift-coverage/indexdump.ts":"0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412","swift-coverage/indexing.ts":"633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272","swift-coverage/types.ts":"bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1","swift-coverage/source.ts":"c151758a9f67631bc61473c375df0dc017da6902a34533b2cf4fc4fd7d19b6ee","swift-coverage/package.ts":"1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b","swift-coverage/xcode.ts":"d6a3228567a46c6d5280895383093889d9b868958a117881061bdd74729a225f","swift-coverage/xcode-assets.ts":"d98d6294b359528f7733b26db6f80f554782354faa235605f9562be4ad98b8a3","swift-coverage/xcode-asset-symbols.ts":"1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671","swift-coverage/xcode-bridging.ts":"33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11","swift-coverage/xcode-packages.ts":"5c83f56357d880243ab485b260d23abd0094583ffa2287dac6e9e7eb18c3673d","swift-coverage/xcode-strings.ts":"facdbeb9de6bb12da4ab4954553edfaadd0e486f1181443138be70c3d8396236","swift-coverage/reader.ts":"da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c","swift-coverage/provenance.ts":"f5039c16e63c6129e22b71203f58982c68cef6e282a4f236b93da28edd39c108","swift-package-manifest.ts":"
|
|
1534
|
+
var swiftCoverageProvenance = true ? JSON.parse('{"swift-coverage/indexdump.ts":"0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412","swift-coverage/indexing.ts":"633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272","swift-coverage/types.ts":"bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1","swift-coverage/source.ts":"c151758a9f67631bc61473c375df0dc017da6902a34533b2cf4fc4fd7d19b6ee","swift-coverage/package.ts":"1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b","swift-coverage/xcode.ts":"d6a3228567a46c6d5280895383093889d9b868958a117881061bdd74729a225f","swift-coverage/xcode-assets.ts":"d98d6294b359528f7733b26db6f80f554782354faa235605f9562be4ad98b8a3","swift-coverage/xcode-asset-symbols.ts":"1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671","swift-coverage/xcode-bridging.ts":"33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11","swift-coverage/xcode-packages.ts":"5c83f56357d880243ab485b260d23abd0094583ffa2287dac6e9e7eb18c3673d","swift-coverage/xcode-strings.ts":"facdbeb9de6bb12da4ab4954553edfaadd0e486f1181443138be70c3d8396236","swift-coverage/reader.ts":"da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c","swift-coverage/provenance.ts":"f5039c16e63c6129e22b71203f58982c68cef6e282a4f236b93da28edd39c108","swift-package-manifest.ts":"523fdfffc0cff95c8df7beeca437622a07d4fd666f0bb22b0ff67d14c42a7b10","swift-package.ts":"05c6cf101fbc944f6684a70db0a9c5aede846b2f0482a6b4a5a0abed737d4658","swift-source-file.ts":"8becce5e73b76a61d9d202c1ecfb39b1238e9bbf0e77841f1c51c98fa9ac7bd3","swift-toolchain.ts":"32bf10d6f3396dd1a20ff6d415499a5990ec2550c63306fd9ef071bdf4a58f1e","home-paths.ts":"d1606390f0e8e50f0ff72544eadb3d49dfabf08e004c1218f2998c36fb8995dd","xcode-header-search.ts":"c72b724fc497e4cf603c355f86eb3c07c929ad299758cffbc6ff88ed241654c6","xcode-project.ts":"e30510099ee19d34de62d8ae859df53f77594a4ab105fdb5bcd7e005ec9689ca","xcode-target-members.ts":"96f6a9f5567a4fbd9806252229b35b9a451a112b20f70f8c20189ffd428815fd","xcode-json-project.ts":"df6d6db28e0c8cfdf1f480e1e32d35f12c9cf1936642d5dda923889fb18a8fd6","openstep-plist.ts":"da11f86885ef1e25979ad989f332195c113c4b7a43f108e8d36646973430b81b"}') : swiftCoverageSourceDigests(join(import.meta.dirname, ".."));
|
|
1536
1535
|
|
|
1537
1536
|
// src/swift-coverage/xcode-asset-symbols.ts
|
|
1538
1537
|
import { existsSync, readdirSync, readFileSync as readFileSync2 } from "node:fs";
|
|
@@ -1717,31 +1716,10 @@ var assetSymbolSettingKeys = [
|
|
|
1717
1716
|
"ASSETCATALOG_OTHER_FLAGS"
|
|
1718
1717
|
];
|
|
1719
1718
|
|
|
1720
|
-
// src/
|
|
1721
|
-
import {
|
|
1722
|
-
execFile,
|
|
1723
|
-
execFileSync as execFileSync2
|
|
1724
|
-
} from "node:child_process";
|
|
1725
|
-
import { createHash as createHash5 } from "node:crypto";
|
|
1719
|
+
// src/xcode-intents.ts
|
|
1720
|
+
import { createHash as createHash6 } from "node:crypto";
|
|
1726
1721
|
import fs4 from "node:fs";
|
|
1727
|
-
import os2 from "node:os";
|
|
1728
1722
|
import path3 from "node:path";
|
|
1729
|
-
import { promisify } from "node:util";
|
|
1730
|
-
|
|
1731
|
-
// src/git-repo-env.ts
|
|
1732
|
-
var UNATTENDED_GIT_ENV = {
|
|
1733
|
-
GIT_TERMINAL_PROMPT: "0",
|
|
1734
|
-
GIT_SSH_COMMAND: process.env.GIT_SSH_COMMAND ?? "ssh -o BatchMode=yes"
|
|
1735
|
-
};
|
|
1736
|
-
|
|
1737
|
-
// src/swift-package-manifest.ts
|
|
1738
|
-
var cacheDir3 = path3.join(cacheDir(), "swift-manifests");
|
|
1739
|
-
var execFileAsync = promisify(execFile);
|
|
1740
|
-
|
|
1741
|
-
// src/xcode-intents.ts
|
|
1742
|
-
import { createHash as createHash7 } from "node:crypto";
|
|
1743
|
-
import fs5 from "node:fs";
|
|
1744
|
-
import path4 from "node:path";
|
|
1745
1723
|
|
|
1746
1724
|
// src/intent-definition/fields.ts
|
|
1747
1725
|
import assert2 from "node:assert/strict";
|
|
@@ -2185,7 +2163,7 @@ function customObjectFields(definition, customTypes) {
|
|
|
2185
2163
|
|
|
2186
2164
|
// src/intent-definition/metadata.ts
|
|
2187
2165
|
import assert4 from "node:assert/strict";
|
|
2188
|
-
import { createHash as
|
|
2166
|
+
import { createHash as createHash5 } from "node:crypto";
|
|
2189
2167
|
|
|
2190
2168
|
// src/intent-definition/hash-input.ts
|
|
2191
2169
|
import assert3 from "node:assert/strict";
|
|
@@ -2343,7 +2321,7 @@ function normalizedEnums(input) {
|
|
|
2343
2321
|
}
|
|
2344
2322
|
function localizationIdentifier(field, key) {
|
|
2345
2323
|
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
2346
|
-
const digest =
|
|
2324
|
+
const digest = createHash5("sha256").update(JSON.stringify([...field, key])).digest();
|
|
2347
2325
|
return Array.from(
|
|
2348
2326
|
digest.subarray(0, 6),
|
|
2349
2327
|
(byte) => alphabet[byte % alphabet.length]
|
|
@@ -3283,17 +3261,17 @@ function preparePortableIntent(definition, derivedDirectory, prefix, language, m
|
|
|
3283
3261
|
throw new Error(`${definition}: invalid intent code generation language ${language}`);
|
|
3284
3262
|
if (prefix) identifier(prefix);
|
|
3285
3263
|
if (module) identifier(module);
|
|
3286
|
-
const source =
|
|
3287
|
-
const key =
|
|
3264
|
+
const source = fs4.readFileSync(definition);
|
|
3265
|
+
const key = createHash6("sha256").update(
|
|
3288
3266
|
JSON.stringify([intentCompilerRevision, definition, prefix, language, module])
|
|
3289
3267
|
).update("\0").update(source).digest("hex");
|
|
3290
|
-
const cache =
|
|
3291
|
-
const output =
|
|
3292
|
-
const localization = definition.split(
|
|
3293
|
-
const compiledRelative =
|
|
3294
|
-
const compiled =
|
|
3295
|
-
const generated =
|
|
3296
|
-
if (
|
|
3268
|
+
const cache = path3.join(derivedDirectory, "IntentDefinitions");
|
|
3269
|
+
const output = path3.join(cache, key);
|
|
3270
|
+
const localization = definition.split(path3.sep).findLast((part) => part.endsWith(".lproj")) ?? "";
|
|
3271
|
+
const compiledRelative = path3.join("Resources", localization, path3.basename(definition));
|
|
3272
|
+
const compiled = path3.join(output, compiledRelative);
|
|
3273
|
+
const generated = path3.join(output, "Sources");
|
|
3274
|
+
if (fs4.existsSync(compiled) && fs4.existsSync(generated)) return { compiled, generated };
|
|
3297
3275
|
let metadata;
|
|
3298
3276
|
let sources;
|
|
3299
3277
|
try {
|
|
@@ -3303,30 +3281,30 @@ function preparePortableIntent(definition, derivedDirectory, prefix, language, m
|
|
|
3303
3281
|
} catch (cause) {
|
|
3304
3282
|
throw new Error(`could not compile intent definition ${definition}`, { cause });
|
|
3305
3283
|
}
|
|
3306
|
-
|
|
3307
|
-
const stage =
|
|
3284
|
+
fs4.mkdirSync(cache, { recursive: true });
|
|
3285
|
+
const stage = fs4.mkdtempSync(path3.join(cache, ".compile-"));
|
|
3308
3286
|
try {
|
|
3309
|
-
const sourceDirectory =
|
|
3310
|
-
const resource =
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3287
|
+
const sourceDirectory = path3.join(stage, "Sources");
|
|
3288
|
+
const resource = path3.join(stage, compiledRelative);
|
|
3289
|
+
fs4.mkdirSync(sourceDirectory);
|
|
3290
|
+
fs4.mkdirSync(path3.dirname(resource), { recursive: true });
|
|
3291
|
+
fs4.writeFileSync(resource, metadata);
|
|
3314
3292
|
for (const [file, contents] of sources)
|
|
3315
|
-
|
|
3293
|
+
fs4.writeFileSync(path3.join(sourceDirectory, file), contents);
|
|
3316
3294
|
try {
|
|
3317
|
-
|
|
3295
|
+
fs4.renameSync(stage, output);
|
|
3318
3296
|
} catch (error) {
|
|
3319
|
-
if (!isRecord(error) || error.code !== "EEXIST" && error.code !== "ENOTEMPTY" || !
|
|
3297
|
+
if (!isRecord(error) || error.code !== "EEXIST" && error.code !== "ENOTEMPTY" || !fs4.existsSync(compiled) || !fs4.existsSync(generated))
|
|
3320
3298
|
throw error;
|
|
3321
3299
|
}
|
|
3322
3300
|
return { compiled, generated };
|
|
3323
3301
|
} finally {
|
|
3324
|
-
|
|
3302
|
+
fs4.rmSync(stage, { recursive: true, force: true });
|
|
3325
3303
|
}
|
|
3326
3304
|
}
|
|
3327
3305
|
|
|
3328
3306
|
// src/xcode-json-project.ts
|
|
3329
|
-
import
|
|
3307
|
+
import path4 from "node:path";
|
|
3330
3308
|
var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3331
3309
|
var text = (value) => typeof value === "string" ? value : void 0;
|
|
3332
3310
|
var items = (value) => Array.isArray(value) ? value : [];
|
|
@@ -3383,7 +3361,7 @@ var PHASE_ISA = {
|
|
|
3383
3361
|
function readXcodeJsonProject(xcodeproj, source) {
|
|
3384
3362
|
const json = Bun.JSON5.parse(source);
|
|
3385
3363
|
if (!isJsonObject(json)) throw new Error(`${xcodeproj}/project.xcproj is not an object`);
|
|
3386
|
-
const projectDir =
|
|
3364
|
+
const projectDir = path4.dirname(xcodeproj);
|
|
3387
3365
|
const objects = {};
|
|
3388
3366
|
let next = 0;
|
|
3389
3367
|
const add = (entry, id) => {
|
|
@@ -3396,7 +3374,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
3396
3374
|
const base = /^<([A-Z]+)>\/(.*)$/.exec(raw);
|
|
3397
3375
|
if (base) {
|
|
3398
3376
|
if (base[1] === "PROJECT")
|
|
3399
|
-
return { sourceTree: "<absolute>", path:
|
|
3377
|
+
return { sourceTree: "<absolute>", path: path4.join(projectDir, base[2]) };
|
|
3400
3378
|
if (base[1] === "PRODUCTS")
|
|
3401
3379
|
return { sourceTree: "BUILT_PRODUCTS_DIR", path: base[2] };
|
|
3402
3380
|
return null;
|
|
@@ -3404,7 +3382,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
3404
3382
|
const unescaped = raw.replaceAll("\\<", "<");
|
|
3405
3383
|
if (unescaped.startsWith("/")) return { sourceTree: "<absolute>", path: unescaped };
|
|
3406
3384
|
if (unescaped.startsWith("~")) return null;
|
|
3407
|
-
return groupDir === null ? null : { sourceTree: "<absolute>", path:
|
|
3385
|
+
return groupDir === null ? null : { sourceTree: "<absolute>", path: path4.join(groupDir, unescaped) };
|
|
3408
3386
|
};
|
|
3409
3387
|
const memberships = [];
|
|
3410
3388
|
const folders = [];
|
|
@@ -3415,7 +3393,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
3415
3393
|
const kind = text(entry.kind) ?? "file-reference";
|
|
3416
3394
|
const raw = text(entry.path) ?? "";
|
|
3417
3395
|
const located = raw === "" ? null : locate(raw, parent.dir);
|
|
3418
|
-
const name = text(entry.name) ??
|
|
3396
|
+
const name = text(entry.name) ?? path4.basename(raw);
|
|
3419
3397
|
const node = { id: "", name, dir: null, parent, children: [] };
|
|
3420
3398
|
if (kind === "group" || kind === "variant-group" || kind === "version-group") {
|
|
3421
3399
|
node.dir = raw === "" ? parent.dir : located?.sourceTree === "<absolute>" ? located.path : null;
|
|
@@ -3536,7 +3514,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
3536
3514
|
if (!isObject(entry)) continue;
|
|
3537
3515
|
const repository = text(entry.repository);
|
|
3538
3516
|
const local = text(entry.path);
|
|
3539
|
-
const name = local !== void 0 ?
|
|
3517
|
+
const name = local !== void 0 ? path4.basename(path4.resolve(path4.dirname(xcodeproj), local)) : path4.basename(repository ?? "").replace(/\.git$/, "");
|
|
3540
3518
|
const id = text(entry.kind) === "local" && local !== void 0 ? add({ isa: "XCLocalSwiftPackageReference", relativePath: local }) : add({
|
|
3541
3519
|
isa: "XCRemoteSwiftPackageReference",
|
|
3542
3520
|
repositoryURL: repository ?? "",
|
|
@@ -3816,28 +3794,28 @@ var CONDITIONS = {
|
|
|
3816
3794
|
variant: "normal"
|
|
3817
3795
|
};
|
|
3818
3796
|
function walkFiles(dir) {
|
|
3819
|
-
if (!
|
|
3797
|
+
if (!fs5.existsSync(dir)) return [];
|
|
3820
3798
|
const out = [];
|
|
3821
|
-
for (const entry of
|
|
3799
|
+
for (const entry of fs5.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name))) {
|
|
3822
3800
|
if (entry.name.startsWith(".")) continue;
|
|
3823
|
-
const full =
|
|
3801
|
+
const full = path5.join(dir, entry.name);
|
|
3824
3802
|
if (entry.isDirectory()) out.push(...walkFiles(full));
|
|
3825
3803
|
else if (entry.isFile()) out.push(full);
|
|
3826
3804
|
}
|
|
3827
3805
|
return out;
|
|
3828
3806
|
}
|
|
3829
|
-
var isDirectory = (dir) =>
|
|
3807
|
+
var isDirectory = (dir) => fs5.existsSync(dir) && fs5.statSync(dir).isDirectory();
|
|
3830
3808
|
function readXcconfig(file, read) {
|
|
3831
|
-
if (read.includes(file) || !
|
|
3809
|
+
if (read.includes(file) || !fs5.existsSync(file)) return {};
|
|
3832
3810
|
read.push(file);
|
|
3833
3811
|
const settings = {};
|
|
3834
|
-
for (const raw of
|
|
3812
|
+
for (const raw of fs5.readFileSync(file, "utf8").split("\n")) {
|
|
3835
3813
|
const line = raw.replace(/\/\/.*$/, "").trim();
|
|
3836
3814
|
const include = /^#include\??\s+"([^"]+)"/.exec(line);
|
|
3837
3815
|
if (include) {
|
|
3838
3816
|
Object.assign(
|
|
3839
3817
|
settings,
|
|
3840
|
-
readXcconfig(
|
|
3818
|
+
readXcconfig(path5.resolve(path5.dirname(file), include[1]), read)
|
|
3841
3819
|
);
|
|
3842
3820
|
continue;
|
|
3843
3821
|
}
|
|
@@ -3882,8 +3860,8 @@ function applyOperator(value, operator) {
|
|
|
3882
3860
|
return value.replace(/[^A-Za-z0-9_]/g, "_").replace(/^[0-9]/, "_");
|
|
3883
3861
|
case "standardizepath":
|
|
3884
3862
|
if (value === ".") return value;
|
|
3885
|
-
if (
|
|
3886
|
-
return
|
|
3863
|
+
if (path5.posix.isAbsolute(value))
|
|
3864
|
+
return path5.posix.normalize(value).replace(/(?<=.)\/$/, "");
|
|
3887
3865
|
return value.split("/").filter((component) => component !== "" && component !== ".").join("/");
|
|
3888
3866
|
}
|
|
3889
3867
|
throw new Error(`unsupported build setting operator :${operator}`);
|
|
@@ -3892,22 +3870,22 @@ function decodeXml(text2) {
|
|
|
3892
3870
|
return text2.replaceAll(""", '"').replaceAll("'", "'").replaceAll("<", "<").replaceAll(">", ">").replaceAll("&", "&");
|
|
3893
3871
|
}
|
|
3894
3872
|
function workspaceReferences(workspace) {
|
|
3895
|
-
const data =
|
|
3896
|
-
if (!
|
|
3873
|
+
const data = path5.join(workspace, "contents.xcworkspacedata");
|
|
3874
|
+
if (!fs5.existsSync(data))
|
|
3897
3875
|
throw new Error(`${workspace} has no contents.xcworkspacedata`);
|
|
3898
|
-
const container =
|
|
3876
|
+
const container = path5.dirname(workspace);
|
|
3899
3877
|
const locate = (location, base) => {
|
|
3900
3878
|
const colon = location.indexOf(":");
|
|
3901
3879
|
const kind = location.slice(0, colon);
|
|
3902
3880
|
const rest = location.slice(colon + 1);
|
|
3903
|
-
if (kind === "group") return
|
|
3904
|
-
if (kind === "container" || kind === "self") return
|
|
3905
|
-
if (kind === "absolute") return
|
|
3906
|
-
throw new Error(`${
|
|
3881
|
+
if (kind === "group") return path5.resolve(base, rest);
|
|
3882
|
+
if (kind === "container" || kind === "self") return path5.resolve(container, rest);
|
|
3883
|
+
if (kind === "absolute") return path5.resolve(rest);
|
|
3884
|
+
throw new Error(`${path5.basename(workspace)} has an unsupported location ${location}`);
|
|
3907
3885
|
};
|
|
3908
3886
|
const groups = [container];
|
|
3909
3887
|
const references = [];
|
|
3910
|
-
for (const [, closing, tag, attributes, selfClosing] of
|
|
3888
|
+
for (const [, closing, tag, attributes, selfClosing] of fs5.readFileSync(data, "utf8").matchAll(/<(\/?)(Group|FileRef)\b([^>]*?)(\/?)>/g)) {
|
|
3911
3889
|
if (closing) {
|
|
3912
3890
|
if (tag === "Group") groups.pop();
|
|
3913
3891
|
continue;
|
|
@@ -3958,8 +3936,8 @@ function remotePackageRequirements(projects) {
|
|
|
3958
3936
|
var loaded = /* @__PURE__ */ new Map();
|
|
3959
3937
|
function xcodeProjectFile(xcodeproj) {
|
|
3960
3938
|
for (const name of ["project.pbxproj", "project.xcproj"]) {
|
|
3961
|
-
const file =
|
|
3962
|
-
if (
|
|
3939
|
+
const file = path5.join(xcodeproj, name);
|
|
3940
|
+
if (fs5.existsSync(file)) return file;
|
|
3963
3941
|
}
|
|
3964
3942
|
return null;
|
|
3965
3943
|
}
|
|
@@ -3967,8 +3945,8 @@ function loadProject(xcodeproj) {
|
|
|
3967
3945
|
const projectFile = xcodeProjectFile(xcodeproj);
|
|
3968
3946
|
if (!projectFile)
|
|
3969
3947
|
throw new Error(`${xcodeproj} has no project.pbxproj or project.xcproj`);
|
|
3970
|
-
const source =
|
|
3971
|
-
const digest =
|
|
3948
|
+
const source = fs5.readFileSync(projectFile, "utf8");
|
|
3949
|
+
const digest = createHash7("sha256").update(source).digest("hex");
|
|
3972
3950
|
const cached = loaded.get(projectFile);
|
|
3973
3951
|
if (cached?.digest === digest) return cached.project;
|
|
3974
3952
|
const root = projectFile.endsWith(".xcproj") ? readXcodeJsonProject(xcodeproj, source) : parseOpenStepPlist(source);
|
|
@@ -3984,10 +3962,10 @@ function loadProject(xcodeproj) {
|
|
|
3984
3962
|
if (!project || project.isa !== "PBXProject") {
|
|
3985
3963
|
throw new Error(`${projectFile} has no PBXProject root`);
|
|
3986
3964
|
}
|
|
3987
|
-
const projectDir =
|
|
3988
|
-
|
|
3965
|
+
const projectDir = fs5.realpathSync.native(
|
|
3966
|
+
path5.resolve(path5.dirname(xcodeproj), str(project.projectDirPath) ?? "")
|
|
3989
3967
|
);
|
|
3990
|
-
const resolvePath = xcodePathResolver(objects, projectDir,
|
|
3968
|
+
const resolvePath = xcodePathResolver(objects, projectDir, path5.join);
|
|
3991
3969
|
const result = {
|
|
3992
3970
|
xcodeproj,
|
|
3993
3971
|
projectFile,
|
|
@@ -4032,7 +4010,7 @@ function expandValue(value, settings) {
|
|
|
4032
4010
|
return value;
|
|
4033
4011
|
}
|
|
4034
4012
|
function processedInfoPlist(name, file, settings, settingKeys) {
|
|
4035
|
-
const source = file ? parsePlist(
|
|
4013
|
+
const source = file ? parsePlist(fs5.readFileSync(file, "utf8")) : {};
|
|
4036
4014
|
if (!source || typeof source !== "object" || Array.isArray(source) || source instanceof Date || Buffer.isBuffer(source))
|
|
4037
4015
|
throw new Error(`${name} Info.plist must contain a dictionary`);
|
|
4038
4016
|
const info = {};
|
|
@@ -4072,8 +4050,8 @@ function targetSettings(ref, configuration, builtins, options2 = {}, overrides =
|
|
|
4072
4050
|
const relative2 = str(config.baseConfigurationReferenceRelativePath);
|
|
4073
4051
|
const own = isDict(config.buildSettings) ? config.buildSettings : {};
|
|
4074
4052
|
const directory = anchor ? project.resolvePath(anchor) : null;
|
|
4075
|
-
const baseFile = base ? project.resolvePath(base) : directory && relative2 ?
|
|
4076
|
-
if ((options2.requireSources !== false || options2.installedPods) && (base || anchor || relative2) && (!baseFile || !
|
|
4053
|
+
const baseFile = base ? project.resolvePath(base) : directory && relative2 ? path5.resolve(directory, relative2) : null;
|
|
4054
|
+
if ((options2.requireSources !== false || options2.installedPods) && (base || anchor || relative2) && (!baseFile || !fs5.existsSync(baseFile)))
|
|
4077
4055
|
throw new Error(
|
|
4078
4056
|
`Unable to open base configuration reference file '${baseFile ?? base ?? relative2 ?? anchor}'`
|
|
4079
4057
|
);
|
|
@@ -4166,10 +4144,10 @@ function hostMacroPluginFlags(flags) {
|
|
|
4166
4144
|
if (flags[index - 1] !== "-load-plugin-executable") return flag;
|
|
4167
4145
|
const separator = flag.lastIndexOf("#");
|
|
4168
4146
|
if (separator < 0) return flag;
|
|
4169
|
-
const root =
|
|
4170
|
-
const manifest =
|
|
4171
|
-
if (!
|
|
4172
|
-
const pkg = JSON.parse(
|
|
4147
|
+
const root = path5.dirname(path5.dirname(flag.slice(0, separator)));
|
|
4148
|
+
const manifest = path5.join(root, "package.json");
|
|
4149
|
+
if (!fs5.existsSync(manifest)) return flag;
|
|
4150
|
+
const pkg = JSON.parse(fs5.readFileSync(manifest, "utf8"));
|
|
4173
4151
|
if (!isRecord(pkg) || pkg.name !== "expo-modules-macros") return flag;
|
|
4174
4152
|
const macros = createRequire(manifest)(root);
|
|
4175
4153
|
if (!isRecord(macros) || typeof macros.getScannerBinaryPath !== "function")
|
|
@@ -4187,26 +4165,26 @@ function scriptCommand(shell, script) {
|
|
|
4187
4165
|
return [executable, ...args, "-c", script];
|
|
4188
4166
|
}
|
|
4189
4167
|
function expandSearchPath(directory, rules2) {
|
|
4190
|
-
if (
|
|
4168
|
+
if (path5.basename(directory) !== "**") return [directory];
|
|
4191
4169
|
const expanded = [];
|
|
4192
4170
|
const seen = /* @__PURE__ */ new Set();
|
|
4193
|
-
const queue = [
|
|
4171
|
+
const queue = [path5.dirname(directory)];
|
|
4194
4172
|
for (let at = 0; at < queue.length; at++) {
|
|
4195
4173
|
const current = queue[at];
|
|
4196
4174
|
let real;
|
|
4197
4175
|
try {
|
|
4198
|
-
real =
|
|
4176
|
+
real = fs5.realpathSync.native(current);
|
|
4199
4177
|
} catch {
|
|
4200
4178
|
continue;
|
|
4201
4179
|
}
|
|
4202
|
-
if (!
|
|
4180
|
+
if (!fs5.statSync(real).isDirectory() || seen.has(real)) continue;
|
|
4203
4181
|
seen.add(real);
|
|
4204
4182
|
expanded.push(current);
|
|
4205
|
-
for (const entry of
|
|
4183
|
+
for (const entry of fs5.readdirSync(real, { withFileTypes: true }).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
|
|
4206
4184
|
if (entry.isSymbolicLink() ? !rules2.followLinks : !entry.isDirectory()) continue;
|
|
4207
4185
|
if (rules2.excluded.some((pattern) => pattern.test(entry.name)) && !rules2.included.some((pattern) => pattern.test(entry.name)))
|
|
4208
4186
|
continue;
|
|
4209
|
-
queue.push(
|
|
4187
|
+
queue.push(path5.join(current, entry.name));
|
|
4210
4188
|
}
|
|
4211
4189
|
}
|
|
4212
4190
|
return expanded;
|
|
@@ -4217,7 +4195,7 @@ function searchedLinkerFlags(projectDir, settings, libraryDirectories) {
|
|
|
4217
4195
|
const rules2 = recursiveSearchRules(settings);
|
|
4218
4196
|
const directories = new Set(
|
|
4219
4197
|
settingList(settings("LIBRARY_SEARCH_PATHS")).flatMap(
|
|
4220
|
-
(raw) => expandSearchPath(
|
|
4198
|
+
(raw) => expandSearchPath(path5.resolve(projectDir, expand(raw, settings)), rules2)
|
|
4221
4199
|
)
|
|
4222
4200
|
);
|
|
4223
4201
|
const resolved = [];
|
|
@@ -4230,18 +4208,18 @@ function searchedLinkerFlags(projectDir, settings, libraryDirectories) {
|
|
|
4230
4208
|
}
|
|
4231
4209
|
let archive;
|
|
4232
4210
|
for (const directory of directories) {
|
|
4233
|
-
const file = (extension) =>
|
|
4211
|
+
const file = (extension) => path5.join(directory, `lib${name}.${extension}`);
|
|
4234
4212
|
const dylib = file("dylib");
|
|
4235
|
-
const parent =
|
|
4213
|
+
const parent = path5.dirname(dylib);
|
|
4236
4214
|
let present = libraryDirectories.get(parent);
|
|
4237
4215
|
if (present === void 0) {
|
|
4238
|
-
present =
|
|
4216
|
+
present = fs5.existsSync(parent);
|
|
4239
4217
|
libraryDirectories.set(parent, present);
|
|
4240
4218
|
}
|
|
4241
4219
|
if (!present) continue;
|
|
4242
|
-
if (
|
|
4220
|
+
if (fs5.existsSync(dylib) || fs5.existsSync(file("tbd"))) break;
|
|
4243
4221
|
const staticLibrary = file("a");
|
|
4244
|
-
if (!
|
|
4222
|
+
if (!fs5.existsSync(staticLibrary)) continue;
|
|
4245
4223
|
archive = staticLibrary;
|
|
4246
4224
|
break;
|
|
4247
4225
|
}
|
|
@@ -4339,7 +4317,7 @@ function shellAssetCatalogs(script, settings, projectDir) {
|
|
|
4339
4317
|
for (const token of tokens) {
|
|
4340
4318
|
if (token.startsWith("-")) break;
|
|
4341
4319
|
const file = resolve(token);
|
|
4342
|
-
if (file?.endsWith(".xcassets")) catalogs.push(
|
|
4320
|
+
if (file?.endsWith(".xcassets")) catalogs.push(path5.resolve(projectDir, file));
|
|
4343
4321
|
}
|
|
4344
4322
|
}
|
|
4345
4323
|
return catalogs;
|
|
@@ -4384,14 +4362,14 @@ function shellCopies(script, settings, projectDir) {
|
|
|
4384
4362
|
if (operands.length !== 2 || operands.some((operand) => operand.startsWith("-")))
|
|
4385
4363
|
return [];
|
|
4386
4364
|
copies.push({
|
|
4387
|
-
from:
|
|
4388
|
-
to:
|
|
4365
|
+
from: path5.resolve(projectDir, operands[0]),
|
|
4366
|
+
to: path5.resolve(projectDir, operands[1])
|
|
4389
4367
|
});
|
|
4390
4368
|
}
|
|
4391
4369
|
return copies;
|
|
4392
4370
|
}
|
|
4393
4371
|
function fileListEntries(file, absolute) {
|
|
4394
|
-
return
|
|
4372
|
+
return fs5.readFileSync(file, "utf8").split(/\r?\n/).map((line) => line.trim()).filter((line) => line !== "" && !line.startsWith("#")).map(absolute);
|
|
4395
4373
|
}
|
|
4396
4374
|
function targetMembers(ref, settings, options2, settingKeys, projectInputs) {
|
|
4397
4375
|
const { project, target, id: targetId } = ref;
|
|
@@ -4405,7 +4383,7 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs) {
|
|
|
4405
4383
|
const copiedFiles = [];
|
|
4406
4384
|
let generatedInfoPlist = false;
|
|
4407
4385
|
const declaredInfoPlist = settings("INFOPLIST_FILE");
|
|
4408
|
-
const infoPlistOutput = declaredInfoPlist ?
|
|
4386
|
+
const infoPlistOutput = declaredInfoPlist ? path5.resolve(project.projectDir, declaredInfoPlist) : null;
|
|
4409
4387
|
const isPreparedOutput = (file) => file === infoPlistOutput || options2.requireSources !== false && file.endsWith(".swift");
|
|
4410
4388
|
for (const phaseId of list(target.buildPhases)) {
|
|
4411
4389
|
const phase = project.object(phaseId);
|
|
@@ -4420,7 +4398,7 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs) {
|
|
|
4420
4398
|
copiedFiles.push(
|
|
4421
4399
|
...shellCopies(str(phase.shellScript) ?? "", settings, project.projectDir)
|
|
4422
4400
|
);
|
|
4423
|
-
const absolute = (raw) =>
|
|
4401
|
+
const absolute = (raw) => path5.resolve(project.projectDir, expand(raw, settings));
|
|
4424
4402
|
const inputs = list(phase.inputPaths).map(absolute);
|
|
4425
4403
|
const outputs = list(phase.outputPaths).map(absolute);
|
|
4426
4404
|
const fileLists = /* @__PURE__ */ new Map();
|
|
@@ -4429,7 +4407,7 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs) {
|
|
|
4429
4407
|
kind === "INPUT" ? phase.inputFileListPaths : phase.outputFileListPaths
|
|
4430
4408
|
).map((raw) => {
|
|
4431
4409
|
const file = absolute(raw);
|
|
4432
|
-
if (!
|
|
4410
|
+
if (!fs5.existsSync(file)) {
|
|
4433
4411
|
return { file, entries: [] };
|
|
4434
4412
|
}
|
|
4435
4413
|
return { file, entries: fileListEntries(file, absolute) };
|
|
@@ -4450,13 +4428,13 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs) {
|
|
|
4450
4428
|
...fileLists.get("OUTPUT").map((item) => item.file)
|
|
4451
4429
|
];
|
|
4452
4430
|
if (allOutputs.some((file) => file.endsWith(".swift") || file === infoPlistOutput)) {
|
|
4453
|
-
for (const file of inputFiles) if (
|
|
4431
|
+
for (const file of inputFiles) if (fs5.existsSync(file)) projectInputs.add(file);
|
|
4454
4432
|
}
|
|
4455
4433
|
if (options2.prepareGeneratedSources === true && allOutputs.some(isPreparedOutput)) {
|
|
4456
|
-
const phaseDir =
|
|
4434
|
+
const phaseDir = path5.join(settings("TARGET_TEMP_DIR"), `Script-${phaseId}`);
|
|
4457
4435
|
for (const lists of fileLists.values())
|
|
4458
4436
|
for (const { file } of lists)
|
|
4459
|
-
if (!
|
|
4437
|
+
if (!fs5.existsSync(file))
|
|
4460
4438
|
throw new Error(
|
|
4461
4439
|
`${targetName}: Run Script "${script}" missing file list ${file}`
|
|
4462
4440
|
);
|
|
@@ -4475,33 +4453,33 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs) {
|
|
|
4475
4453
|
const lists = fileLists.get(kind);
|
|
4476
4454
|
env[`SCRIPT_${kind}_FILE_LIST_COUNT`] = String(lists.length);
|
|
4477
4455
|
lists.forEach((_item, index) => {
|
|
4478
|
-
env[`SCRIPT_${kind}_FILE_LIST_${index}`] =
|
|
4456
|
+
env[`SCRIPT_${kind}_FILE_LIST_${index}`] = path5.join(
|
|
4479
4457
|
phaseDir,
|
|
4480
4458
|
`${kind}-${index}.xcfilelist`
|
|
4481
4459
|
);
|
|
4482
4460
|
});
|
|
4483
4461
|
}
|
|
4484
|
-
const signature =
|
|
4462
|
+
const signature = createHash7("sha256").update(
|
|
4485
4463
|
JSON.stringify([phase, [...settingKeys].map((key2) => [key2, settings(key2)])])
|
|
4486
4464
|
);
|
|
4487
4465
|
for (const file of inputFiles) {
|
|
4488
4466
|
signature.update(file);
|
|
4489
|
-
if (
|
|
4490
|
-
const stat =
|
|
4467
|
+
if (fs5.existsSync(file)) {
|
|
4468
|
+
const stat = fs5.statSync(file);
|
|
4491
4469
|
signature.update(`${stat.mtimeMs}:${stat.ctimeMs}:${stat.size}`);
|
|
4492
4470
|
} else signature.update("missing");
|
|
4493
4471
|
}
|
|
4494
4472
|
const stamp = signature.digest("hex");
|
|
4495
4473
|
const key = `${project.projectFile}:${targetId}:${phaseId}:${settings("CONFIGURATION")}`;
|
|
4496
|
-
if (preparedSourcePhases.get(key) === stamp && allOutputs.every((file) =>
|
|
4474
|
+
if (preparedSourcePhases.get(key) === stamp && allOutputs.every((file) => fs5.existsSync(file)))
|
|
4497
4475
|
continue;
|
|
4498
|
-
|
|
4476
|
+
fs5.mkdirSync(phaseDir, { recursive: true });
|
|
4499
4477
|
if (process.platform === "linux") {
|
|
4500
4478
|
const bin = swiftToolchainBin(
|
|
4501
4479
|
privateSwiftRelease() ?? swiftNativePin().distribution.release
|
|
4502
4480
|
);
|
|
4503
|
-
const startup =
|
|
4504
|
-
|
|
4481
|
+
const startup = path5.join(phaseDir, "peach-tools.sh");
|
|
4482
|
+
fs5.writeFileSync(
|
|
4505
4483
|
startup,
|
|
4506
4484
|
'if [[ -n "$PEACH_PHASE_BASH_ENV" ]]; then source "$PEACH_PHASE_BASH_ENV"; fi\nexport PATH="$PEACH_PHASE_TOOLCHAIN:$PATH"\n'
|
|
4507
4485
|
);
|
|
@@ -4510,15 +4488,15 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs) {
|
|
|
4510
4488
|
env.PEACH_PHASE_TOOLCHAIN = bin;
|
|
4511
4489
|
env.PEACH_PHASE_BASH_ENV = env.BASH_ENV;
|
|
4512
4490
|
env.BASH_ENV = startup;
|
|
4513
|
-
env.PATH = [bin, env.PATH].filter(Boolean).join(
|
|
4491
|
+
env.PATH = [bin, env.PATH].filter(Boolean).join(path5.delimiter);
|
|
4514
4492
|
}
|
|
4515
|
-
|
|
4516
|
-
|
|
4493
|
+
fs5.mkdirSync(settings("BUILT_PRODUCTS_DIR"), { recursive: true });
|
|
4494
|
+
fs5.mkdirSync(settings("DERIVED_FILE_DIR"), { recursive: true });
|
|
4517
4495
|
for (const output of allOutputs)
|
|
4518
|
-
|
|
4496
|
+
fs5.mkdirSync(path5.dirname(output), { recursive: true });
|
|
4519
4497
|
for (const [kind, lists] of fileLists)
|
|
4520
4498
|
lists.forEach((item, index) => {
|
|
4521
|
-
|
|
4499
|
+
fs5.writeFileSync(
|
|
4522
4500
|
env[`SCRIPT_${kind}_FILE_LIST_${index}`],
|
|
4523
4501
|
`${item.entries.join("\n")}
|
|
4524
4502
|
`
|
|
@@ -4526,9 +4504,9 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs) {
|
|
|
4526
4504
|
});
|
|
4527
4505
|
const rawScript = str(phase.shellScript) ?? "";
|
|
4528
4506
|
if (rawScript.includes("generate-modules-provider")) {
|
|
4529
|
-
const preloadPath =
|
|
4530
|
-
|
|
4531
|
-
|
|
4507
|
+
const preloadPath = path5.join(phaseDir, "expo-scan-timeout.cjs");
|
|
4508
|
+
fs5.mkdirSync(phaseDir, { recursive: true });
|
|
4509
|
+
fs5.writeFileSync(
|
|
4532
4510
|
preloadPath,
|
|
4533
4511
|
[
|
|
4534
4512
|
"const cp = require('node:child_process');",
|
|
@@ -4550,7 +4528,7 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs) {
|
|
|
4550
4528
|
str(phase.shellPath) ?? "/bin/sh",
|
|
4551
4529
|
rawScript
|
|
4552
4530
|
);
|
|
4553
|
-
|
|
4531
|
+
execFileSync2(shell, args, {
|
|
4554
4532
|
cwd: project.projectDir,
|
|
4555
4533
|
env,
|
|
4556
4534
|
stdio: ["ignore", "pipe", "pipe"],
|
|
@@ -4566,7 +4544,7 @@ ${output}`
|
|
|
4566
4544
|
);
|
|
4567
4545
|
}
|
|
4568
4546
|
const missing = allOutputs.filter(
|
|
4569
|
-
(file) => file === infoPlistOutput && !
|
|
4547
|
+
(file) => file === infoPlistOutput && !fs5.existsSync(file)
|
|
4570
4548
|
);
|
|
4571
4549
|
if (missing.length > 0)
|
|
4572
4550
|
throw new Error(
|
|
@@ -4577,9 +4555,9 @@ ${output}`
|
|
|
4577
4555
|
}
|
|
4578
4556
|
project.visitMembers(
|
|
4579
4557
|
targetId,
|
|
4580
|
-
xcodePathResolver(project.objects, project.projectDir,
|
|
4581
|
-
(file) => isDirectory(file) ? walkFiles(file) :
|
|
4582
|
-
|
|
4558
|
+
xcodePathResolver(project.objects, project.projectDir, path5.join, settings),
|
|
4559
|
+
(file) => isDirectory(file) ? walkFiles(file) : fs5.existsSync(file) ? [file] : [],
|
|
4560
|
+
path5.join,
|
|
4583
4561
|
(file, kind, bundleName) => {
|
|
4584
4562
|
if (kind === "header") {
|
|
4585
4563
|
headers.add(file);
|
|
@@ -4590,9 +4568,9 @@ ${output}`
|
|
|
4590
4568
|
if (bundleName) resourceNames[file] = bundleName;
|
|
4591
4569
|
return;
|
|
4592
4570
|
}
|
|
4593
|
-
if (!
|
|
4571
|
+
if (!fs5.existsSync(file)) {
|
|
4594
4572
|
if (options2.requireSources === false) return;
|
|
4595
|
-
const script = scriptForOutput.get(
|
|
4573
|
+
const script = scriptForOutput.get(path5.normalize(file));
|
|
4596
4574
|
throw new Error(
|
|
4597
4575
|
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}`
|
|
4598
4576
|
);
|
|
@@ -4603,21 +4581,21 @@ ${output}`
|
|
|
4603
4581
|
);
|
|
4604
4582
|
if (options2.prepareGeneratedSources && options2.requireSources !== false) {
|
|
4605
4583
|
const interfaceFiles = [...resources].filter(
|
|
4606
|
-
(file) => /\.(storyboard|xib)$/.test(file) && !file.split(
|
|
4584
|
+
(file) => /\.(storyboard|xib)$/.test(file) && !file.split(path5.sep).some((part) => part.endsWith(".bundle"))
|
|
4607
4585
|
);
|
|
4608
4586
|
let launchName = settings("INFOPLIST_KEY_UILaunchStoryboardName");
|
|
4609
|
-
if (process.platform !== "darwin" && !launchName && infoPlistOutput &&
|
|
4610
|
-
const info = parsePlist(
|
|
4587
|
+
if (process.platform !== "darwin" && !launchName && infoPlistOutput && fs5.existsSync(infoPlistOutput)) {
|
|
4588
|
+
const info = parsePlist(fs5.readFileSync(infoPlistOutput, "utf8"));
|
|
4611
4589
|
const declared = isRecord(info) ? info.UILaunchStoryboardName : void 0;
|
|
4612
4590
|
if (typeof declared === "string") launchName = expand(declared, settings);
|
|
4613
4591
|
}
|
|
4614
4592
|
const interfaceOutputs = /* @__PURE__ */ new Set();
|
|
4615
4593
|
for (const file of interfaceFiles) {
|
|
4616
|
-
const localization = file.split(
|
|
4594
|
+
const localization = file.split(path5.sep).findLast((part) => part.endsWith(".lproj")) ?? "";
|
|
4617
4595
|
const isStoryboard = file.endsWith(".storyboard");
|
|
4618
4596
|
const extension = isStoryboard ? ".storyboardc" : ".nib";
|
|
4619
|
-
const name =
|
|
4620
|
-
const output =
|
|
4597
|
+
const name = path5.basename(file, path5.extname(file));
|
|
4598
|
+
const output = path5.join(
|
|
4621
4599
|
settings("DERIVED_FILE_DIR"),
|
|
4622
4600
|
"InterfaceBuilder",
|
|
4623
4601
|
localization,
|
|
@@ -4636,10 +4614,10 @@ ${output}`
|
|
|
4636
4614
|
const inputs = JSON.stringify([
|
|
4637
4615
|
1,
|
|
4638
4616
|
args,
|
|
4639
|
-
|
|
4617
|
+
createHash7("sha256").update(fs5.readFileSync(file)).digest("hex")
|
|
4640
4618
|
]);
|
|
4641
4619
|
const developer = settings("DEVELOPER_DIR");
|
|
4642
|
-
const cached =
|
|
4620
|
+
const cached = fs5.existsSync(output) && fs5.existsSync(stamp) ? fs5.readFileSync(stamp, "utf8").split("\n") : [];
|
|
4643
4621
|
projectInputs.add(file);
|
|
4644
4622
|
resources.delete(file);
|
|
4645
4623
|
if (cached[0] !== inputs || process.platform === "darwin" && cached[1] !== developer) {
|
|
@@ -4649,15 +4627,15 @@ ${output}`
|
|
|
4649
4627
|
`${targetName}: Interface Builder compilation requires macOS and Xcode`
|
|
4650
4628
|
);
|
|
4651
4629
|
}
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4630
|
+
fs5.rmSync(output, { recursive: true, force: true });
|
|
4631
|
+
fs5.rmSync(stamp, { force: true });
|
|
4632
|
+
fs5.mkdirSync(path5.dirname(output), { recursive: true });
|
|
4633
|
+
execFileSync2("xcrun", ["ibtool", "--compile", output, file, ...args], {
|
|
4656
4634
|
cwd: project.projectDir,
|
|
4657
4635
|
stdio: ["ignore", "pipe", "pipe"],
|
|
4658
4636
|
timeout: runScriptTimeoutMs
|
|
4659
4637
|
});
|
|
4660
|
-
|
|
4638
|
+
fs5.writeFileSync(stamp, `${inputs}
|
|
4661
4639
|
${developer}
|
|
4662
4640
|
`);
|
|
4663
4641
|
}
|
|
@@ -4699,34 +4677,34 @@ ${developer}
|
|
|
4699
4677
|
function commonAncestor(dirs) {
|
|
4700
4678
|
let common = dirs[0];
|
|
4701
4679
|
for (const dir of dirs) {
|
|
4702
|
-
while (common !==
|
|
4703
|
-
common =
|
|
4680
|
+
while (common !== path5.dirname(common) && path5.relative(common, dir).startsWith(".."))
|
|
4681
|
+
common = path5.dirname(common);
|
|
4704
4682
|
}
|
|
4705
4683
|
return common;
|
|
4706
4684
|
}
|
|
4707
|
-
var isPodsProject = (xcodeproj) =>
|
|
4685
|
+
var isPodsProject = (xcodeproj) => path5.basename(xcodeproj) === "Pods.xcodeproj" && path5.basename(path5.dirname(xcodeproj)) === "Pods";
|
|
4708
4686
|
function installedPodsSandbox(pods) {
|
|
4709
|
-
const podfileLock =
|
|
4710
|
-
const manifestLock =
|
|
4711
|
-
if (!
|
|
4687
|
+
const podfileLock = path5.join(path5.dirname(pods), "Podfile.lock");
|
|
4688
|
+
const manifestLock = path5.join(pods, "Manifest.lock");
|
|
4689
|
+
if (!fs5.existsSync(podfileLock))
|
|
4712
4690
|
throw new Error(
|
|
4713
|
-
`${pods} has no ${podfileLock}: run \`pod install\` in ${
|
|
4691
|
+
`${pods} has no ${podfileLock}: run \`pod install\` in ${path5.dirname(pods)}`
|
|
4714
4692
|
);
|
|
4715
|
-
if (!
|
|
4693
|
+
if (!fs5.existsSync(manifestLock) || !fs5.readFileSync(manifestLock).equals(fs5.readFileSync(podfileLock)))
|
|
4716
4694
|
throw new Error(
|
|
4717
|
-
`The sandbox is not in sync with the Podfile.lock: ${manifestLock} differs from ${podfileLock}. Run \`pod install\` in ${
|
|
4695
|
+
`The sandbox is not in sync with the Podfile.lock: ${manifestLock} differs from ${podfileLock}. Run \`pod install\` in ${path5.dirname(pods)}`
|
|
4718
4696
|
);
|
|
4719
4697
|
const specChecksums = {};
|
|
4720
|
-
const lines =
|
|
4698
|
+
const lines = fs5.readFileSync(manifestLock, "utf8").split("\n");
|
|
4721
4699
|
const start = lines.indexOf("SPEC CHECKSUMS:");
|
|
4722
4700
|
for (const line of start === -1 ? [] : lines.slice(start + 1)) {
|
|
4723
4701
|
const entry = /^ {2}"?([^":]+)"?: ([0-9a-f]+)$/.exec(line);
|
|
4724
4702
|
if (!entry) break;
|
|
4725
4703
|
specChecksums[entry[1]] = entry[2];
|
|
4726
4704
|
}
|
|
4727
|
-
const specs =
|
|
4728
|
-
const generated =
|
|
4729
|
-
if (
|
|
4705
|
+
const specs = path5.join(pods, "Local Podspecs");
|
|
4706
|
+
const generated = path5.join(pods, POD_GRAPH_SPECIFICATIONS);
|
|
4707
|
+
if (fs5.existsSync(generated))
|
|
4730
4708
|
return {
|
|
4731
4709
|
podfileLock,
|
|
4732
4710
|
manifestLock,
|
|
@@ -4734,15 +4712,15 @@ function installedPodsSandbox(pods) {
|
|
|
4734
4712
|
localPodspecs: readPodGraphSpecifications(generated),
|
|
4735
4713
|
specificationFiles: [generated]
|
|
4736
4714
|
};
|
|
4737
|
-
const specificationFiles = isDirectory(specs) ?
|
|
4715
|
+
const specificationFiles = isDirectory(specs) ? fs5.readdirSync(specs).filter((name) => name.endsWith(".podspec.json")).sort().map((name) => path5.join(specs, name)) : [];
|
|
4738
4716
|
return {
|
|
4739
4717
|
podfileLock,
|
|
4740
4718
|
manifestLock,
|
|
4741
4719
|
specChecksums,
|
|
4742
4720
|
localPodspecs: new Map(
|
|
4743
4721
|
specificationFiles.map((file) => [
|
|
4744
|
-
|
|
4745
|
-
|
|
4722
|
+
path5.basename(file, ".podspec.json"),
|
|
4723
|
+
fs5.readFileSync(file, "utf8")
|
|
4746
4724
|
])
|
|
4747
4725
|
),
|
|
4748
4726
|
specificationFiles
|
|
@@ -4757,14 +4735,14 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
|
|
|
4757
4735
|
if (!xcodeProjectFile(xcodeproj)) {
|
|
4758
4736
|
if (installedPods && isPodsProject(xcodeproj))
|
|
4759
4737
|
throw new Error(
|
|
4760
|
-
`${
|
|
4738
|
+
`${path5.basename(xcodeprojOrWorkspace)} builds ${xcodeproj}, which is not installed: run \`pod install\` in ${path5.dirname(path5.dirname(xcodeproj))}`
|
|
4761
4739
|
);
|
|
4762
4740
|
return;
|
|
4763
4741
|
}
|
|
4764
|
-
const key =
|
|
4765
|
-
if (projectAt.has(key) || !installedPods && key.split(
|
|
4742
|
+
const key = fs5.realpathSync.native(xcodeproj);
|
|
4743
|
+
if (projectAt.has(key) || !installedPods && key.split(path5.sep).includes("Pods"))
|
|
4766
4744
|
return;
|
|
4767
|
-
if (isPodsProject(key)) cocoapods = installedPodsSandbox(
|
|
4745
|
+
if (isPodsProject(key)) cocoapods = installedPodsSandbox(path5.dirname(key));
|
|
4768
4746
|
const project = loadProject(key);
|
|
4769
4747
|
projectAt.set(key, project);
|
|
4770
4748
|
projects.push(project);
|
|
@@ -4780,12 +4758,12 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
|
|
|
4780
4758
|
for (const reference of listed)
|
|
4781
4759
|
if (reference.endsWith(".xcodeproj")) addProject(reference);
|
|
4782
4760
|
if (projects.length === 0) {
|
|
4783
|
-
throw new Error(`${
|
|
4761
|
+
throw new Error(`${path5.basename(xcodeprojOrWorkspace)} lists no Xcode project`);
|
|
4784
4762
|
}
|
|
4785
|
-
const podfile =
|
|
4786
|
-
if (installedPods && !cocoapods &&
|
|
4763
|
+
const podfile = path5.join(path5.dirname(xcodeprojOrWorkspace), "Podfile");
|
|
4764
|
+
if (installedPods && !cocoapods && fs5.existsSync(podfile))
|
|
4787
4765
|
throw new Error(
|
|
4788
|
-
`${podfile} is not installed into ${
|
|
4766
|
+
`${podfile} is not installed into ${path5.basename(xcodeprojOrWorkspace)}: run \`pod install\` in ${path5.dirname(podfile)} and open the workspace it writes`
|
|
4789
4767
|
);
|
|
4790
4768
|
return { listed, projects, projectAt, cocoapods };
|
|
4791
4769
|
}
|
|
@@ -4823,7 +4801,7 @@ function listXcodeAppTargets(xcodeprojOrWorkspace, options2 = {}) {
|
|
|
4823
4801
|
return workspaceProjects(xcodeprojOrWorkspace).projects.flatMap(projectTargets).filter((ref) => isIosAppTarget(ref, options2)).map((ref) => str(ref.target.name) ?? ref.id);
|
|
4824
4802
|
}
|
|
4825
4803
|
function defaultXcodeAppTarget(xcodeproj) {
|
|
4826
|
-
const project = loadProject(
|
|
4804
|
+
const project = loadProject(fs5.realpathSync.native(xcodeproj));
|
|
4827
4805
|
for (const [id, target] of Object.entries(project.objects)) {
|
|
4828
4806
|
if (!isDict(target) || target.isa !== "PBXNativeTarget") continue;
|
|
4829
4807
|
if (isIosAppTarget({ project, id, target }, { requireSources: false }))
|
|
@@ -4831,30 +4809,30 @@ function defaultXcodeAppTarget(xcodeproj) {
|
|
|
4831
4809
|
}
|
|
4832
4810
|
}
|
|
4833
4811
|
function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
4834
|
-
const container =
|
|
4812
|
+
const container = fs5.realpathSync.native(xcodeprojOrWorkspace);
|
|
4835
4813
|
const { projects } = workspaceProjects(container);
|
|
4836
4814
|
const containers = [
|
|
4837
4815
|
.../* @__PURE__ */ new Set([container, ...projects.map((project2) => project2.xcodeproj)])
|
|
4838
4816
|
];
|
|
4839
4817
|
const found = containers.flatMap(
|
|
4840
4818
|
(dir) => [
|
|
4841
|
-
|
|
4842
|
-
...isDirectory(
|
|
4819
|
+
path5.join(dir, "xcshareddata"),
|
|
4820
|
+
...isDirectory(path5.join(dir, "xcuserdata")) ? fs5.readdirSync(path5.join(dir, "xcuserdata")).sort().map((user) => path5.join(dir, "xcuserdata", user)) : []
|
|
4843
4821
|
].map((data) => ({
|
|
4844
4822
|
dir,
|
|
4845
|
-
file:
|
|
4823
|
+
file: path5.join(data, "xcschemes", `${scheme}.xcscheme`)
|
|
4846
4824
|
}))
|
|
4847
|
-
).find((candidate) =>
|
|
4825
|
+
).find((candidate) => fs5.existsSync(candidate.file));
|
|
4848
4826
|
if (!found) {
|
|
4849
4827
|
const known = containers.flatMap(
|
|
4850
|
-
(dir) =>
|
|
4828
|
+
(dir) => fs5.existsSync(path5.join(dir, "xcshareddata", "xcschemes")) ? fs5.readdirSync(path5.join(dir, "xcshareddata", "xcschemes")).filter((name2) => name2.endsWith(".xcscheme")).map((name2) => name2.slice(0, -".xcscheme".length)).sort() : []
|
|
4851
4829
|
);
|
|
4852
4830
|
throw new Error(
|
|
4853
|
-
`${
|
|
4831
|
+
`${path5.basename(container)} has no scheme ${scheme}; it shares ${known.join(", ") || "none"}`
|
|
4854
4832
|
);
|
|
4855
4833
|
}
|
|
4856
4834
|
const launch = /<LaunchAction\b([^>]*)>([\s\S]*?)<\/LaunchAction>/.exec(
|
|
4857
|
-
|
|
4835
|
+
fs5.readFileSync(found.file, "utf8")
|
|
4858
4836
|
);
|
|
4859
4837
|
const attribute = (text2, name2) => {
|
|
4860
4838
|
const value = new RegExp(`\\b${name2}\\s*=\\s*"([^"]*)"`).exec(text2)?.[1];
|
|
@@ -4867,12 +4845,12 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
|
4867
4845
|
if (!configuration || !blueprint || !referenced?.startsWith("container:")) {
|
|
4868
4846
|
throw new Error(`scheme ${scheme} runs no application target`);
|
|
4869
4847
|
}
|
|
4870
|
-
const projectPath =
|
|
4871
|
-
|
|
4848
|
+
const projectPath = path5.resolve(
|
|
4849
|
+
path5.dirname(found.dir),
|
|
4872
4850
|
referenced.slice("container:".length)
|
|
4873
4851
|
);
|
|
4874
4852
|
const project = projects.find(
|
|
4875
|
-
(candidate) =>
|
|
4853
|
+
(candidate) => fs5.existsSync(projectPath) && candidate.xcodeproj === fs5.realpathSync.native(projectPath)
|
|
4876
4854
|
);
|
|
4877
4855
|
const target = project && projectTargets(project).find((ref) => ref.id === blueprint);
|
|
4878
4856
|
const name = target && str(target.target.name);
|
|
@@ -4892,26 +4870,26 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
|
4892
4870
|
var NativeAppTargetSelectionError = class extends Error {
|
|
4893
4871
|
};
|
|
4894
4872
|
function selectIosAppTarget(projectRoot, iosTarget) {
|
|
4895
|
-
const nested =
|
|
4896
|
-
const iosRoot =
|
|
4897
|
-
const entries =
|
|
4873
|
+
const nested = path5.join(projectRoot, "ios");
|
|
4874
|
+
const iosRoot = fs5.existsSync(nested) ? nested : projectRoot;
|
|
4875
|
+
const entries = fs5.readdirSync(iosRoot, { withFileTypes: true });
|
|
4898
4876
|
const projects = (entries.some((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj")) ? entries.filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj")).map((entry) => ({
|
|
4899
|
-
xcodeproj:
|
|
4877
|
+
xcodeproj: path5.join(iosRoot, entry.name),
|
|
4900
4878
|
workspace: null
|
|
4901
4879
|
})) : entries.filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcworkspace")).flatMap((entry) => {
|
|
4902
|
-
const workspace =
|
|
4880
|
+
const workspace = path5.join(iosRoot, entry.name);
|
|
4903
4881
|
return workspaceReferences(workspace).map((xcodeproj2) => ({
|
|
4904
4882
|
xcodeproj: xcodeproj2,
|
|
4905
4883
|
workspace
|
|
4906
4884
|
}));
|
|
4907
4885
|
}).filter(
|
|
4908
|
-
({ xcodeproj: xcodeproj2 }) => xcodeproj2.endsWith(".xcodeproj") && !xcodeproj2.split(
|
|
4886
|
+
({ xcodeproj: xcodeproj2 }) => xcodeproj2.endsWith(".xcodeproj") && !xcodeproj2.split(path5.sep).includes("Pods") && fs5.existsSync(xcodeproj2)
|
|
4909
4887
|
).filter(
|
|
4910
4888
|
({ xcodeproj: xcodeproj2 }) => listXcodeAppTargets(xcodeproj2, { requireSources: false }).length > 0
|
|
4911
4889
|
)).map(({ xcodeproj: xcodeproj2, workspace }) => ({
|
|
4912
4890
|
xcodeproj: xcodeproj2,
|
|
4913
4891
|
workspace,
|
|
4914
|
-
name:
|
|
4892
|
+
name: path5.basename(xcodeproj2)
|
|
4915
4893
|
}));
|
|
4916
4894
|
if (projects.length === 0) return null;
|
|
4917
4895
|
if (projects.length > 1 && !iosTarget) {
|
|
@@ -4950,13 +4928,13 @@ function selectIosAppTarget(projectRoot, iosTarget) {
|
|
|
4950
4928
|
if (!target) throw new Error("native app identity has no iOS application target");
|
|
4951
4929
|
if (!iosTarget) {
|
|
4952
4930
|
const workspace = xcodeproj.replace(/\.xcodeproj$/, ".xcworkspace");
|
|
4953
|
-
const container =
|
|
4931
|
+
const container = fs5.existsSync(workspace) ? workspace : xcodeproj;
|
|
4954
4932
|
const hasScheme = [container, xcodeproj].some((dir) => {
|
|
4955
|
-
if (
|
|
4933
|
+
if (fs5.existsSync(path5.join(dir, "xcshareddata", "xcschemes", `${target}.xcscheme`)))
|
|
4956
4934
|
return true;
|
|
4957
|
-
const users =
|
|
4958
|
-
return
|
|
4959
|
-
(user) =>
|
|
4935
|
+
const users = path5.join(dir, "xcuserdata");
|
|
4936
|
+
return fs5.existsSync(users) && fs5.readdirSync(users).some(
|
|
4937
|
+
(user) => fs5.existsSync(path5.join(users, user, "xcschemes", `${target}.xcscheme`))
|
|
4960
4938
|
);
|
|
4961
4939
|
});
|
|
4962
4940
|
if (hasScheme) target = readXcodeScheme(container, target).target;
|
|
@@ -4967,8 +4945,8 @@ function selectIosAppTarget(projectRoot, iosTarget) {
|
|
|
4967
4945
|
);
|
|
4968
4946
|
return { xcodeproj, target, workspace: project.workspace };
|
|
4969
4947
|
}
|
|
4970
|
-
var workspaceResolvedFile = (xcodeprojOrWorkspace) =>
|
|
4971
|
-
xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace :
|
|
4948
|
+
var workspaceResolvedFile = (xcodeprojOrWorkspace) => path5.join(
|
|
4949
|
+
xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : path5.join(xcodeprojOrWorkspace, "project.xcworkspace"),
|
|
4972
4950
|
"xcshareddata",
|
|
4973
4951
|
"swiftpm",
|
|
4974
4952
|
"Package.resolved"
|
|
@@ -4985,7 +4963,7 @@ var SwiftPackageResolutionRequired = class extends Error {
|
|
|
4985
4963
|
function readXcodeAppTarget(input, targetName, configurationName, options2 = {}) {
|
|
4986
4964
|
if (isBazelPackage(input))
|
|
4987
4965
|
return readBazelAppTarget(input, targetName, configurationName, options2);
|
|
4988
|
-
const xcodeprojOrWorkspace =
|
|
4966
|
+
const xcodeprojOrWorkspace = fs5.realpathSync.native(input);
|
|
4989
4967
|
const workspace = xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : null;
|
|
4990
4968
|
const { listed, projects, projectAt, cocoapods } = workspaceProjects(
|
|
4991
4969
|
xcodeprojOrWorkspace,
|
|
@@ -4996,7 +4974,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
4996
4974
|
(ref) => options2.frameworkMachOType ? ref.target.name === targetName && FRAMEWORK_PRODUCTS.has(str(ref.target.productType) ?? "") : isIosAppTarget(ref, options2) || targetName !== void 0 && ref.target.name === targetName && ref.target.productType === APP_EXTENSION
|
|
4997
4975
|
);
|
|
4998
4976
|
const appTargetNames = appTargets.map((ref) => str(ref.target.name) ?? ref.id);
|
|
4999
|
-
const container =
|
|
4977
|
+
const container = path5.basename(xcodeprojOrWorkspace);
|
|
5000
4978
|
const named = targetName ? appTargets.filter((ref) => ref.target.name === targetName) : appTargets;
|
|
5001
4979
|
if (named.length !== 1) {
|
|
5002
4980
|
if (options2.frameworkMachOType)
|
|
@@ -5021,15 +4999,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5021
4999
|
for (const ref of allTargets) {
|
|
5022
5000
|
const product = ref.project.object(str(ref.target.productReference));
|
|
5023
5001
|
const file = str(product?.path);
|
|
5024
|
-
if (file && !byProduct.has(
|
|
5025
|
-
byProduct.set(
|
|
5002
|
+
if (file && !byProduct.has(path5.basename(file)))
|
|
5003
|
+
byProduct.set(path5.basename(file), ref);
|
|
5026
5004
|
}
|
|
5027
5005
|
const proxied = (project, proxyId) => {
|
|
5028
5006
|
const proxy = project.object(proxyId);
|
|
5029
5007
|
if (proxy?.isa !== "PBXContainerItemProxy") return void 0;
|
|
5030
5008
|
const portal = str(proxy.containerPortal);
|
|
5031
5009
|
const portalPath = project.resolvePath(portal ?? "");
|
|
5032
|
-
const owner = project.object(portal)?.isa === "PBXProject" ? project : portalPath &&
|
|
5010
|
+
const owner = project.object(portal)?.isa === "PBXProject" ? project : portalPath && fs5.existsSync(portalPath) ? projectAt.get(fs5.realpathSync.native(portalPath)) : void 0;
|
|
5033
5011
|
const remote = str(proxy.remoteGlobalIDString);
|
|
5034
5012
|
if (!owner || !remote) return void 0;
|
|
5035
5013
|
return projectTargets(owner).find(
|
|
@@ -5046,7 +5024,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5046
5024
|
const buildFile = project.object(buildFileId);
|
|
5047
5025
|
if (!buildFile || !xcodeBuildFileBuildsForIos(buildFile)) continue;
|
|
5048
5026
|
const file = project.object(str(buildFile.fileRef));
|
|
5049
|
-
const resolved = file?.isa === "PBXReferenceProxy" ? proxied(project, str(file.remoteRef)) : file && str(file.sourceTree) === "BUILT_PRODUCTS_DIR" ? byProduct.get(
|
|
5027
|
+
const resolved = file?.isa === "PBXReferenceProxy" ? proxied(project, str(file.remoteRef)) : file && str(file.sourceTree) === "BUILT_PRODUCTS_DIR" ? byProduct.get(path5.basename(str(file.path) ?? "")) : void 0;
|
|
5050
5028
|
if (resolved)
|
|
5051
5029
|
found.push({
|
|
5052
5030
|
target: resolved,
|
|
@@ -5127,7 +5105,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5127
5105
|
const otherProduct = productName(other);
|
|
5128
5106
|
for (const { file, visibility } of headerPhase(other)) {
|
|
5129
5107
|
if (visibility === "Project") continue;
|
|
5130
|
-
const key = `${otherProduct}/${
|
|
5108
|
+
const key = `${otherProduct}/${path5.basename(file)}`;
|
|
5131
5109
|
if (!headers.has(key)) headers.set(key, file);
|
|
5132
5110
|
}
|
|
5133
5111
|
}
|
|
@@ -5157,8 +5135,8 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5157
5135
|
ref.project.visitMembers(
|
|
5158
5136
|
ref.id,
|
|
5159
5137
|
ref.project.resolvePath,
|
|
5160
|
-
(file) => isDirectory(file) ? walkFiles(file) :
|
|
5161
|
-
|
|
5138
|
+
(file) => isDirectory(file) ? walkFiles(file) : fs5.existsSync(file) ? [file] : [],
|
|
5139
|
+
path5.join,
|
|
5162
5140
|
(file, kind) => {
|
|
5163
5141
|
if (kind === "header") found.push(file);
|
|
5164
5142
|
}
|
|
@@ -5174,12 +5152,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5174
5152
|
for (const ref of projectTargets(project)) {
|
|
5175
5153
|
const product = productName(ref);
|
|
5176
5154
|
for (const { file, visibility } of headerPhase(ref)) {
|
|
5177
|
-
const name =
|
|
5155
|
+
const name = path5.basename(file);
|
|
5178
5156
|
if (!entries.has(name))
|
|
5179
5157
|
entries.set(name, visibility !== "Project" ? `${product}/${name}` : file);
|
|
5180
5158
|
}
|
|
5181
5159
|
for (const file of synchronizedHeaders(ref)) {
|
|
5182
|
-
const name =
|
|
5160
|
+
const name = path5.basename(file);
|
|
5183
5161
|
if (!entries.has(name)) entries.set(name, file);
|
|
5184
5162
|
}
|
|
5185
5163
|
}
|
|
@@ -5189,7 +5167,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5189
5167
|
if (folder === null) continue;
|
|
5190
5168
|
for (const file of walkFiles(folder)) {
|
|
5191
5169
|
if (!HEADER_FILE.test(file)) continue;
|
|
5192
|
-
const name =
|
|
5170
|
+
const name = path5.basename(file);
|
|
5193
5171
|
if (!entries.has(name)) entries.set(name, file);
|
|
5194
5172
|
}
|
|
5195
5173
|
}
|
|
@@ -5197,18 +5175,18 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5197
5175
|
for (const id of Object.keys(project.objects)) {
|
|
5198
5176
|
if (project.object(id)?.isa !== "PBXFileReference") continue;
|
|
5199
5177
|
const file = project.resolvePath(id);
|
|
5200
|
-
if (file && HEADER_FILE.test(file) && !entries.has(
|
|
5201
|
-
entries.set(
|
|
5178
|
+
if (file && HEADER_FILE.test(file) && !entries.has(path5.basename(file)))
|
|
5179
|
+
entries.set(path5.basename(file), file);
|
|
5202
5180
|
}
|
|
5203
5181
|
const map = [...entries];
|
|
5204
5182
|
projectHeaderMaps.set(project, map);
|
|
5205
5183
|
return map;
|
|
5206
5184
|
};
|
|
5207
5185
|
const xcconfigs = /* @__PURE__ */ new Set();
|
|
5208
|
-
const buildDir = (project) =>
|
|
5186
|
+
const buildDir = (project) => path5.join(project.projectDir, ".build/peach-xcode/Build");
|
|
5209
5187
|
const workspaceBuild = {
|
|
5210
|
-
SYMROOT:
|
|
5211
|
-
OBJROOT:
|
|
5188
|
+
SYMROOT: path5.join(buildDir(app.project), "Products"),
|
|
5189
|
+
OBJROOT: path5.join(buildDir(app.project), "Intermediates.noindex")
|
|
5212
5190
|
};
|
|
5213
5191
|
const moduleTarget = (ref) => {
|
|
5214
5192
|
const name = str(ref.target.name) ?? ref.id;
|
|
@@ -5224,16 +5202,16 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5224
5202
|
TARGET_NAME: name,
|
|
5225
5203
|
TARGETNAME: "$(TARGET_NAME)",
|
|
5226
5204
|
PROJECT: "$(PROJECT_NAME)",
|
|
5227
|
-
PROJECT_NAME:
|
|
5205
|
+
PROJECT_NAME: path5.basename(ref.project.xcodeproj, ".xcodeproj"),
|
|
5228
5206
|
PROJECT_CLASS_PREFIX: isDict(ref.project.project.attributes) ? str(ref.project.project.attributes.CLASSPREFIX) ?? "" : "",
|
|
5229
5207
|
PROJECT_FILE_PATH: ref.project.xcodeproj,
|
|
5230
5208
|
SRCROOT: ref.project.projectDir,
|
|
5231
5209
|
SOURCE_ROOT: ref.project.projectDir,
|
|
5232
5210
|
PROJECT_DIR: ref.project.projectDir,
|
|
5233
|
-
SYMROOT:
|
|
5211
|
+
SYMROOT: path5.join(buildDir(ref.project), "Products"),
|
|
5234
5212
|
BUILD_DIR: "$(SYMROOT)",
|
|
5235
5213
|
BUILD_ROOT: "$(SYMROOT)",
|
|
5236
|
-
OBJROOT:
|
|
5214
|
+
OBJROOT: path5.join(buildDir(ref.project), "Intermediates.noindex"),
|
|
5237
5215
|
CONFIGURATION_BUILD_DIR: "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)",
|
|
5238
5216
|
BUILT_PRODUCTS_DIR: "$(CONFIGURATION_BUILD_DIR)",
|
|
5239
5217
|
TARGET_BUILD_DIR: "$(CONFIGURATION_BUILD_DIR)",
|
|
@@ -5282,7 +5260,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5282
5260
|
xcconfigs
|
|
5283
5261
|
);
|
|
5284
5262
|
const searchRules = recursiveSearchRules(settings2);
|
|
5285
|
-
const absolute = (file) =>
|
|
5263
|
+
const absolute = (file) => path5.resolve(ref.project.projectDir, file);
|
|
5286
5264
|
const framework = FRAMEWORK_PRODUCTS.has(str(ref.target.productType) ?? "");
|
|
5287
5265
|
const product = settings2("PRODUCT_NAME");
|
|
5288
5266
|
const moduleName = applyOperator(settings2("PRODUCT_MODULE_NAME"), "c99extidentifier");
|
|
@@ -5313,7 +5291,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5313
5291
|
`${name}: Swift compatibility header phase has no Swift producer sources`
|
|
5314
5292
|
);
|
|
5315
5293
|
const building = options2.prepareGeneratedSources && options2.requireSources !== false;
|
|
5316
|
-
const versioning = building && allSources.length > 0 && settings2("VERSIONING_SYSTEM") === "apple-generic" ?
|
|
5294
|
+
const versioning = building && allSources.length > 0 && settings2("VERSIONING_SYSTEM") === "apple-generic" ? path5.join(settings2("DERIVED_FILE_DIR"), `${product}_vers.c`) : null;
|
|
5317
5295
|
if (versioning) {
|
|
5318
5296
|
const version = settings2("CURRENT_PROJECT_VERSION");
|
|
5319
5297
|
const custom = [
|
|
@@ -5326,7 +5304,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5326
5304
|
].filter((key) => settings2(key));
|
|
5327
5305
|
if (custom.length)
|
|
5328
5306
|
throw new Error(
|
|
5329
|
-
`${name}: Xcode generates ${
|
|
5307
|
+
`${name}: Xcode generates ${path5.basename(versioning)} with ${custom.join(", ")}; peach does not model VERSION_INFO_* overrides`
|
|
5330
5308
|
);
|
|
5331
5309
|
const symbol = product.replace(/^[^A-Za-z_]/, "_").replace(/[^A-Za-z0-9_]/g, "_");
|
|
5332
5310
|
const [major, minor] = version.split(".");
|
|
@@ -5339,9 +5317,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5339
5317
|
` const double ${symbol}VersionNumber __attribute__ ((used)) = (double)${number};`,
|
|
5340
5318
|
""
|
|
5341
5319
|
].join("\n");
|
|
5342
|
-
if (!
|
|
5343
|
-
|
|
5344
|
-
|
|
5320
|
+
if (!fs5.existsSync(versioning) || fs5.readFileSync(versioning, "utf8") !== unit) {
|
|
5321
|
+
fs5.mkdirSync(path5.dirname(versioning), { recursive: true });
|
|
5322
|
+
fs5.writeFileSync(versioning, unit);
|
|
5345
5323
|
}
|
|
5346
5324
|
allSources.push(versioning);
|
|
5347
5325
|
}
|
|
@@ -5360,7 +5338,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5360
5338
|
const headerFiles = headerPhase(ref);
|
|
5361
5339
|
const ownHeaders = /* @__PURE__ */ new Map();
|
|
5362
5340
|
for (const { file, visibility } of headerFiles) {
|
|
5363
|
-
const name2 =
|
|
5341
|
+
const name2 = path5.basename(file);
|
|
5364
5342
|
const published = visibility !== "Project";
|
|
5365
5343
|
if (!ownHeaders.has(name2))
|
|
5366
5344
|
ownHeaders.set(name2, published ? `${product}/${name2}` : file);
|
|
@@ -5368,35 +5346,35 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5368
5346
|
ownHeaders.set(`${product}/${name2}`, file);
|
|
5369
5347
|
}
|
|
5370
5348
|
for (const file of synchronizedHeaders(ref)) {
|
|
5371
|
-
const name2 =
|
|
5349
|
+
const name2 = path5.basename(file);
|
|
5372
5350
|
if (ownHeaders.has(name2)) continue;
|
|
5373
5351
|
ownHeaders.set(name2, file);
|
|
5374
5352
|
const qualified = `${product}/${name2}`;
|
|
5375
5353
|
if (!ownHeaders.has(qualified)) ownHeaders.set(qualified, file);
|
|
5376
5354
|
}
|
|
5377
5355
|
const nonFrameworkHeaders = nonFrameworkHeadersOf(ref.project);
|
|
5378
|
-
const wrapper =
|
|
5379
|
-
const publicHeaders =
|
|
5356
|
+
const wrapper = path5.join(settings2("BUILT_PRODUCTS_DIR"), `${product}.framework`);
|
|
5357
|
+
const publicHeaders = path5.resolve(
|
|
5380
5358
|
settings2("BUILT_PRODUCTS_DIR"),
|
|
5381
|
-
settings2("PUBLIC_HEADERS_FOLDER_PATH") ||
|
|
5359
|
+
settings2("PUBLIC_HEADERS_FOLDER_PATH") || path5.join(wrapper, "Headers")
|
|
5382
5360
|
);
|
|
5383
|
-
const privateHeaders =
|
|
5361
|
+
const privateHeaders = path5.resolve(
|
|
5384
5362
|
settings2("BUILT_PRODUCTS_DIR"),
|
|
5385
|
-
settings2("PRIVATE_HEADERS_FOLDER_PATH") ||
|
|
5363
|
+
settings2("PRIVATE_HEADERS_FOLDER_PATH") || path5.join(wrapper, "PrivateHeaders")
|
|
5386
5364
|
);
|
|
5387
5365
|
const moduleMap = (settings2("DEFINES_MODULE") === "YES" || !framework) && settings2("MODULEMAP_FILE") ? absolute(settings2("MODULEMAP_FILE")) : null;
|
|
5388
|
-
const frameworkUmbrella = !compatibility && framework && members.sources.length > 0 && moduleMap ?
|
|
5389
|
-
const frameworkCompatibility = frameworkUmbrella && moduleMap &&
|
|
5366
|
+
const frameworkUmbrella = !compatibility && framework && members.sources.length > 0 && moduleMap ? path5.join(path5.dirname(moduleMap), `${moduleName}-umbrella.h`) : null;
|
|
5367
|
+
const frameworkCompatibility = frameworkUmbrella && moduleMap && fs5.existsSync(moduleMap) && fs5.existsSync(frameworkUmbrella) ? {
|
|
5390
5368
|
framework: true,
|
|
5391
5369
|
moduleMap,
|
|
5392
5370
|
umbrella: frameworkUmbrella,
|
|
5393
|
-
outputModuleMap:
|
|
5394
|
-
outputUmbrella:
|
|
5371
|
+
outputModuleMap: path5.join(wrapper, "Modules", "module.modulemap"),
|
|
5372
|
+
outputUmbrella: path5.join(
|
|
5395
5373
|
wrapper,
|
|
5396
5374
|
"Headers",
|
|
5397
|
-
|
|
5375
|
+
path5.basename(frameworkUmbrella)
|
|
5398
5376
|
),
|
|
5399
|
-
outputHeader:
|
|
5377
|
+
outputHeader: path5.join(
|
|
5400
5378
|
wrapper,
|
|
5401
5379
|
"Headers",
|
|
5402
5380
|
settings2("SWIFT_OBJC_INTERFACE_HEADER_NAME") || `${moduleName}-Swift.h`
|
|
@@ -5410,10 +5388,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5410
5388
|
outputUmbrella: compatibility.outputUmbrella,
|
|
5411
5389
|
outputHeader: compatibility.outputHeader
|
|
5412
5390
|
} : frameworkCompatibility;
|
|
5413
|
-
const podHeaders = !framework && isPodsProject(ref.project.xcodeproj) && moduleMap &&
|
|
5391
|
+
const podHeaders = !framework && isPodsProject(ref.project.xcodeproj) && moduleMap && path5.relative(path5.join(ref.project.projectDir, "Headers", "Public"), moduleMap).split(path5.sep)[0] !== ".." && fs5.existsSync(moduleMap) ? fs5.readdirSync(path5.dirname(moduleMap)).flatMap((entry) => {
|
|
5414
5392
|
if (!/\.(h|hh|hpp|hxx|modulemap)$/.test(entry)) return [];
|
|
5415
|
-
const file =
|
|
5416
|
-
return
|
|
5393
|
+
const file = path5.join(path5.dirname(moduleMap), entry);
|
|
5394
|
+
return fs5.existsSync(file) ? [file] : [];
|
|
5417
5395
|
}) : [];
|
|
5418
5396
|
const fileFlags = {};
|
|
5419
5397
|
for (const phaseId of list(ref.target.buildPhases)) {
|
|
@@ -5499,15 +5477,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5499
5477
|
// xcode searches its products' include directory before
|
|
5500
5478
|
// HEADER_SEARCH_PATHS and the target's derived sources after.
|
|
5501
5479
|
headerSearchPaths: [
|
|
5502
|
-
|
|
5480
|
+
path5.join(settings2("BUILT_PRODUCTS_DIR"), "include"),
|
|
5503
5481
|
...settingList(settings2("HEADER_SEARCH_PATHS")).flatMap(
|
|
5504
5482
|
(raw) => expandSearchPath(absolute(raw), searchRules)
|
|
5505
5483
|
),
|
|
5506
|
-
|
|
5484
|
+
path5.join(
|
|
5507
5485
|
`${settings2("DERIVED_FILE_DIR")}-normal`,
|
|
5508
5486
|
settings2("CURRENT_ARCH")
|
|
5509
5487
|
),
|
|
5510
|
-
|
|
5488
|
+
path5.join(settings2("DERIVED_FILE_DIR"), settings2("CURRENT_ARCH")),
|
|
5511
5489
|
settings2("DERIVED_FILE_DIR")
|
|
5512
5490
|
],
|
|
5513
5491
|
userHeaderSearchPaths: settingList(
|
|
@@ -5557,9 +5535,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5557
5535
|
...headerFiles.flatMap(
|
|
5558
5536
|
({ file, visibility }) => visibility === "Project" ? [] : [
|
|
5559
5537
|
[
|
|
5560
|
-
|
|
5538
|
+
path5.join(
|
|
5561
5539
|
visibility === "Public" ? publicHeaders : privateHeaders,
|
|
5562
|
-
|
|
5540
|
+
path5.basename(file)
|
|
5563
5541
|
),
|
|
5564
5542
|
file
|
|
5565
5543
|
]
|
|
@@ -5581,17 +5559,17 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5581
5559
|
);
|
|
5582
5560
|
return file && HEADER_FILE.test(file) ? [
|
|
5583
5561
|
[
|
|
5584
|
-
|
|
5562
|
+
path5.resolve(
|
|
5585
5563
|
settings2("BUILT_PRODUCTS_DIR"),
|
|
5586
5564
|
destination,
|
|
5587
|
-
|
|
5565
|
+
path5.basename(file)
|
|
5588
5566
|
),
|
|
5589
5567
|
file
|
|
5590
5568
|
]
|
|
5591
5569
|
] : [];
|
|
5592
5570
|
});
|
|
5593
5571
|
}),
|
|
5594
|
-
...moduleMap ? [[
|
|
5572
|
+
...moduleMap ? [[path5.join(wrapper, "Modules", "module.modulemap"), moduleMap]] : []
|
|
5595
5573
|
]) : Object.fromEntries([
|
|
5596
5574
|
...podHeaders.map((file) => [file, file]),
|
|
5597
5575
|
...moduleMap ? [[moduleMap, moduleMap]] : []
|
|
@@ -5630,7 +5608,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5630
5608
|
const generate = settings2("GENERATE_INFOPLIST_FILE") === "YES";
|
|
5631
5609
|
if (!FRAMEWORK_PRODUCTS.has(str(ref.target.productType) ?? "") || !plistSetting && !generate || module2.generatedInfoPlist && !options2.prepareGeneratedSources)
|
|
5632
5610
|
return { ref, framework: module2 };
|
|
5633
|
-
const file = plistSetting ?
|
|
5611
|
+
const file = plistSetting ? path5.resolve(ref.project.projectDir, plistSetting) : null;
|
|
5634
5612
|
if (file) xcconfigs.add(file);
|
|
5635
5613
|
const info2 = processedInfoPlist(module2.name, file, productSettings2, keys);
|
|
5636
5614
|
if (generate) {
|
|
@@ -5646,7 +5624,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5646
5624
|
});
|
|
5647
5625
|
const frameworks = frameworkTargets.map(({ framework }) => framework);
|
|
5648
5626
|
const podSourceDirs = builtTargets.slice(0, -1).flatMap(
|
|
5649
|
-
({ ref, module: module2 }) => isPodsProject(ref.project.xcodeproj) ? [...module2.allSources, ...module2.objc?.headers ?? []].map((file) =>
|
|
5627
|
+
({ ref, module: module2 }) => isPodsProject(ref.project.xcodeproj) ? [...module2.allSources, ...module2.objc?.headers ?? []].map((file) => path5.dirname(file)).filter((dir) => fs5.existsSync(dir)) : []
|
|
5650
5628
|
);
|
|
5651
5629
|
const resourceProducts = [];
|
|
5652
5630
|
const bundleTargets = builtTargets.filter(
|
|
@@ -5657,7 +5635,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5657
5635
|
const phase = owner.ref.project.object(phaseId);
|
|
5658
5636
|
if (phase?.isa !== "PBXShellScriptBuildPhase" || str(phase.name) !== "[CP] Copy Pods Resources")
|
|
5659
5637
|
continue;
|
|
5660
|
-
const absolute = (raw) =>
|
|
5638
|
+
const absolute = (raw) => path5.resolve(owner.ref.project.projectDir, expand(raw, owner.settings));
|
|
5661
5639
|
const entries = (paths) => paths.flatMap((raw) => {
|
|
5662
5640
|
const file = absolute(raw);
|
|
5663
5641
|
xcconfigs.add(file);
|
|
@@ -5673,7 +5651,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5673
5651
|
].filter((file) => file.endsWith(".bundle"));
|
|
5674
5652
|
if (inputs.length !== outputs.length)
|
|
5675
5653
|
throw new Error(`${owner.module.name}: resource bundle copy lists differ`);
|
|
5676
|
-
const destinationRoot =
|
|
5654
|
+
const destinationRoot = path5.join(
|
|
5677
5655
|
owner.settings("TARGET_BUILD_DIR"),
|
|
5678
5656
|
owner.settings("UNLOCALIZED_RESOURCES_FOLDER_PATH")
|
|
5679
5657
|
);
|
|
@@ -5682,24 +5660,24 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5682
5660
|
const file = str(
|
|
5683
5661
|
target.ref.project.object(str(target.ref.target.productReference))?.path
|
|
5684
5662
|
);
|
|
5685
|
-
return file &&
|
|
5663
|
+
return file && path5.join(target.settings("TARGET_BUILD_DIR"), file) === input2;
|
|
5686
5664
|
});
|
|
5687
5665
|
if (!product && !isDirectory(input2))
|
|
5688
5666
|
throw new Error(
|
|
5689
5667
|
`${owner.module.name}: resource bundle input has no selected producer: ${input2}`
|
|
5690
5668
|
);
|
|
5691
|
-
const destination =
|
|
5692
|
-
if (destination === ".." || destination.startsWith(`..${
|
|
5669
|
+
const destination = path5.relative(destinationRoot, outputs[index]);
|
|
5670
|
+
if (destination === ".." || destination.startsWith(`..${path5.sep}`) || path5.isAbsolute(destination) || path5.basename(input2) !== path5.basename(destination))
|
|
5693
5671
|
throw new Error(
|
|
5694
5672
|
`${owner.module.name}: invalid resource bundle copy destination`
|
|
5695
5673
|
);
|
|
5696
|
-
const infoFile = product ?
|
|
5674
|
+
const infoFile = product ? path5.resolve(
|
|
5697
5675
|
product.ref.project.projectDir,
|
|
5698
5676
|
product.settings("INFOPLIST_FILE")
|
|
5699
5677
|
) : null;
|
|
5700
5678
|
if (infoFile) xcconfigs.add(infoFile);
|
|
5701
5679
|
const prefix = owner.ref === app ? "" : `Frameworks/${owner.module.moduleName}.framework/`;
|
|
5702
|
-
const bundlePath = prefix + destination.split(
|
|
5680
|
+
const bundlePath = prefix + destination.split(path5.sep).join("/");
|
|
5703
5681
|
if (resourceProducts.some((resource) => resource.path === bundlePath))
|
|
5704
5682
|
throw new Error(
|
|
5705
5683
|
`${owner.module.name}: duplicate resource bundle destination ${bundlePath}`
|
|
@@ -5710,20 +5688,20 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5710
5688
|
resources: product.module.resources,
|
|
5711
5689
|
infoPlist: buildPlist(
|
|
5712
5690
|
expandValue(
|
|
5713
|
-
parsePlist(
|
|
5691
|
+
parsePlist(fs5.readFileSync(infoFile, "utf8")),
|
|
5714
5692
|
product.productSettings
|
|
5715
5693
|
)
|
|
5716
5694
|
)
|
|
5717
5695
|
} : {
|
|
5718
|
-
resources:
|
|
5696
|
+
resources: fs5.readdirSync(input2, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => path5.join(entry.parentPath, entry.name)).sort(),
|
|
5719
5697
|
sourceRoot: input2
|
|
5720
5698
|
}
|
|
5721
5699
|
});
|
|
5722
5700
|
}
|
|
5723
5701
|
}
|
|
5724
5702
|
}
|
|
5725
|
-
const infoPlistFile = settings("INFOPLIST_FILE") ?
|
|
5726
|
-
const entitlementsFile = settings("CODE_SIGN_ENTITLEMENTS") ?
|
|
5703
|
+
const infoPlistFile = settings("INFOPLIST_FILE") ? path5.resolve(app.project.projectDir, settings("INFOPLIST_FILE")) : null;
|
|
5704
|
+
const entitlementsFile = settings("CODE_SIGN_ENTITLEMENTS") ? path5.resolve(app.project.projectDir, settings("CODE_SIGN_ENTITLEMENTS")) : null;
|
|
5727
5705
|
const infoPlistPending = module.generatedInfoPlist && !options2.prepareGeneratedSources;
|
|
5728
5706
|
const info = processedInfoPlist(
|
|
5729
5707
|
module.name,
|
|
@@ -5732,7 +5710,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5732
5710
|
settingKeys
|
|
5733
5711
|
);
|
|
5734
5712
|
const bundleIdentifier = productSettings("PRODUCT_BUNDLE_IDENTIFIER") || (typeof info.CFBundleIdentifier === "string" ? info.CFBundleIdentifier : "");
|
|
5735
|
-
const entitlements = entitlementsFile ? parsePlist(
|
|
5713
|
+
const entitlements = entitlementsFile ? parsePlist(fs5.readFileSync(entitlementsFile, "utf8")) : void 0;
|
|
5736
5714
|
const keychainAccessGroups = entitlementsFile ? readKeychainAccessGroups(
|
|
5737
5715
|
entitlements,
|
|
5738
5716
|
(value) => expand(value, (key) => {
|
|
@@ -5770,7 +5748,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5770
5748
|
};
|
|
5771
5749
|
}
|
|
5772
5750
|
const localPackageDirs = [
|
|
5773
|
-
...listed.filter((reference) =>
|
|
5751
|
+
...listed.filter((reference) => fs5.existsSync(path5.join(reference, "Package.swift"))),
|
|
5774
5752
|
...projects.flatMap(
|
|
5775
5753
|
(project) => Object.entries(project.objects).flatMap(([id, entry]) => {
|
|
5776
5754
|
if (!isDict(entry)) return [];
|
|
@@ -5780,19 +5758,19 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5780
5758
|
const packages = [];
|
|
5781
5759
|
while (pending.length > 0) {
|
|
5782
5760
|
const dir = pending.pop();
|
|
5783
|
-
if (
|
|
5761
|
+
if (fs5.existsSync(path5.join(dir, "Package.swift"))) {
|
|
5784
5762
|
packages.push(dir);
|
|
5785
5763
|
continue;
|
|
5786
5764
|
}
|
|
5787
5765
|
if (!isDirectory(dir)) continue;
|
|
5788
|
-
for (const child of
|
|
5766
|
+
for (const child of fs5.readdirSync(dir, { withFileTypes: true }))
|
|
5789
5767
|
if (child.isDirectory() && !child.name.startsWith("."))
|
|
5790
|
-
pending.push(
|
|
5768
|
+
pending.push(path5.join(dir, child.name));
|
|
5791
5769
|
}
|
|
5792
5770
|
return packages;
|
|
5793
5771
|
}
|
|
5794
|
-
const candidate = entry.isa === "XCLocalSwiftPackageReference" ?
|
|
5795
|
-
return candidate &&
|
|
5772
|
+
const candidate = entry.isa === "XCLocalSwiftPackageReference" ? path5.resolve(project.projectDir, str(entry.relativePath) ?? "") : entry.isa === "PBXFileReference" ? project.resolvePath(id) : null;
|
|
5773
|
+
return candidate && fs5.existsSync(path5.join(candidate, "Package.swift")) ? [candidate] : [];
|
|
5796
5774
|
})
|
|
5797
5775
|
)
|
|
5798
5776
|
];
|
|
@@ -5822,7 +5800,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5822
5800
|
if ((flag === "-framework" || flag === "-weak_framework") && name)
|
|
5823
5801
|
sdkFrameworks.add(name);
|
|
5824
5802
|
});
|
|
5825
|
-
const absolute = (raw) =>
|
|
5803
|
+
const absolute = (raw) => path5.resolve(ref.project.projectDir, expand(raw, settings2));
|
|
5826
5804
|
const requested = options2.nativeModules;
|
|
5827
5805
|
const includeBinary = (name, dir) => {
|
|
5828
5806
|
if (!requested || nativeTargets.has(ref) || requested.includes(name) || dir.endsWith(".xcframework") && localSwiftBinaryModules(dir).some((module2) => requested.includes(module2)))
|
|
@@ -5834,14 +5812,14 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5834
5812
|
for (const directory of expandSearchPath(absolute(raw), searchRules)) {
|
|
5835
5813
|
if (frameworkSearchDirectories.has(directory)) continue;
|
|
5836
5814
|
frameworkSearchDirectories.add(directory);
|
|
5837
|
-
if (!
|
|
5815
|
+
if (!fs5.statSync(directory, { throwIfNoEntry: false })?.isDirectory() || /\.sdk\/(?:System|Developer)\/Library\/Frameworks\/?$/.test(directory))
|
|
5838
5816
|
continue;
|
|
5839
|
-
for (const entry of
|
|
5817
|
+
for (const entry of fs5.readdirSync(directory, { withFileTypes: true })) {
|
|
5840
5818
|
const name = /^(.+)\.framework$/.exec(entry.name)?.[1];
|
|
5841
5819
|
if (!name || byProduct.has(entry.name) || searchedFrameworks.has(name))
|
|
5842
5820
|
continue;
|
|
5843
|
-
const file =
|
|
5844
|
-
if (
|
|
5821
|
+
const file = path5.join(directory, entry.name);
|
|
5822
|
+
if (fs5.statSync(file, { throwIfNoEntry: false })?.isDirectory())
|
|
5845
5823
|
searchedFrameworks.set(name, file);
|
|
5846
5824
|
}
|
|
5847
5825
|
}
|
|
@@ -5849,9 +5827,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5849
5827
|
}
|
|
5850
5828
|
for (const raw of settingList(settings2("SWIFT_INCLUDE_PATHS"))) {
|
|
5851
5829
|
const dir = absolute(raw);
|
|
5852
|
-
const modulemap =
|
|
5853
|
-
if (!
|
|
5854
|
-
const name = moduleMapName(
|
|
5830
|
+
const modulemap = path5.join(dir, "module.modulemap");
|
|
5831
|
+
if (!fs5.existsSync(modulemap)) continue;
|
|
5832
|
+
const name = moduleMapName(fs5.readFileSync(modulemap, "utf8"));
|
|
5855
5833
|
if (name && !binaryFrameworks.has(name)) includeBinary(name, dir);
|
|
5856
5834
|
}
|
|
5857
5835
|
for (const phaseId of list(ref.target.buildPhases)) {
|
|
@@ -5860,7 +5838,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5860
5838
|
const inputs = list(phase.inputPaths).map(absolute);
|
|
5861
5839
|
for (const raw of list(phase.inputFileListPaths)) {
|
|
5862
5840
|
const file = absolute(raw);
|
|
5863
|
-
if (!
|
|
5841
|
+
if (!fs5.existsSync(file)) continue;
|
|
5864
5842
|
xcconfigs.add(file);
|
|
5865
5843
|
inputs.push(...fileListEntries(file, absolute));
|
|
5866
5844
|
}
|
|
@@ -5925,7 +5903,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5925
5903
|
...productAttributes.get(dependencyId)?.length ? { attributes: productAttributes.get(dependencyId) } : {},
|
|
5926
5904
|
source: reference?.isa === "XCRemoteSwiftPackageReference" ? { kind: "remote", url: str(reference.repositoryURL) ?? "" } : reference?.isa === "XCLocalSwiftPackageReference" ? {
|
|
5927
5905
|
kind: "local",
|
|
5928
|
-
dir:
|
|
5906
|
+
dir: path5.resolve(
|
|
5929
5907
|
project.projectDir,
|
|
5930
5908
|
str(reference.relativePath) ?? ""
|
|
5931
5909
|
)
|
|
@@ -5959,14 +5937,14 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5959
5937
|
continue;
|
|
5960
5938
|
}
|
|
5961
5939
|
if (tree === "BUILT_PRODUCTS_DIR" || tree === "DEVELOPER_DIR" || // a target in the workspace builds it, so it exists only after that build
|
|
5962
|
-
byProduct.has(
|
|
5940
|
+
byProduct.has(path5.basename(rawPath)))
|
|
5963
5941
|
continue;
|
|
5964
5942
|
const resolved = fileId ? project.resolvePath(fileId) : null;
|
|
5965
|
-
if (fileId && resolved !== null && !
|
|
5966
|
-
const parts = resolved.split(
|
|
5943
|
+
if (fileId && resolved !== null && !fs5.existsSync(resolved)) {
|
|
5944
|
+
const parts = resolved.split(path5.sep);
|
|
5967
5945
|
const pods = parts.lastIndexOf("Pods");
|
|
5968
|
-
const sandbox = parts.slice(0, pods + 1).join(
|
|
5969
|
-
if (!options2.installedPods && options2.requireSources === false && pods > 0 &&
|
|
5946
|
+
const sandbox = parts.slice(0, pods + 1).join(path5.sep);
|
|
5947
|
+
if (!options2.installedPods && options2.requireSources === false && pods > 0 && fs5.existsSync(path5.join(path5.dirname(sandbox), "Podfile")))
|
|
5970
5948
|
continue;
|
|
5971
5949
|
if (!ios_sdk_frameworks_default.frameworks.includes(name))
|
|
5972
5950
|
throw new Error(
|
|
@@ -5994,7 +5972,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5994
5972
|
({ product }) => !options2.nativeModules || nativeTargets.has(built.ref) || options2.nativeModules.includes(product)
|
|
5995
5973
|
);
|
|
5996
5974
|
const resolvedFile = workspaceResolvedFile(xcodeprojOrWorkspace);
|
|
5997
|
-
let packageResolved =
|
|
5975
|
+
let packageResolved = fs5.existsSync(resolvedFile) ? [fs5.realpathSync.native(resolvedFile)] : [...new Set(localPackageDirs.map((dir) => path5.join(dir, "Package.resolved")))].filter((file) => fs5.existsSync(file)).map((file) => fs5.realpathSync.native(file)).sort();
|
|
5998
5976
|
if (packageResolved.length === 0) {
|
|
5999
5977
|
const requirements = remotePackageRequirements(projects);
|
|
6000
5978
|
if (requirements.length > 0) {
|
|
@@ -6050,19 +6028,19 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
6050
6028
|
} : {},
|
|
6051
6029
|
rootDir: commonAncestor(
|
|
6052
6030
|
[
|
|
6053
|
-
workspace ?
|
|
6031
|
+
workspace ? path5.dirname(workspace) : app.project.projectDir,
|
|
6054
6032
|
...used.map((project) => project.projectDir),
|
|
6055
6033
|
...localPackageDirs,
|
|
6056
6034
|
...linkedProducts.flatMap(
|
|
6057
|
-
({ source }) => source.kind === "local" &&
|
|
6035
|
+
({ source }) => source.kind === "local" && fs5.existsSync(source.dir) ? [source.dir] : []
|
|
6058
6036
|
),
|
|
6059
6037
|
...new Set(podSourceDirs),
|
|
6060
6038
|
// a target's own files may sit beside the project, such as an asset
|
|
6061
6039
|
// catalog one folder up, and xcode builds them from there
|
|
6062
6040
|
...new Set(
|
|
6063
|
-
[...module.allSources, ...module.resources].filter((file) =>
|
|
6041
|
+
[...module.allSources, ...module.resources].filter((file) => fs5.existsSync(file)).map((file) => path5.dirname(file))
|
|
6064
6042
|
)
|
|
6065
|
-
].map((dir) =>
|
|
6043
|
+
].map((dir) => fs5.realpathSync.native(dir))
|
|
6066
6044
|
),
|
|
6067
6045
|
projectFiles: [
|
|
6068
6046
|
.../* @__PURE__ */ new Set([
|
|
@@ -6088,7 +6066,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
6088
6066
|
resourceProducts,
|
|
6089
6067
|
linkedProducts,
|
|
6090
6068
|
localPackageDirs: [
|
|
6091
|
-
...new Set(localPackageDirs.map((dir) =>
|
|
6069
|
+
...new Set(localPackageDirs.map((dir) => fs5.realpathSync.native(dir)))
|
|
6092
6070
|
].sort(),
|
|
6093
6071
|
binaryFrameworks: [...binaryFrameworks].map(([name, file]) => ({ name, path: file })).sort((left, right) => left.name.localeCompare(right.name)),
|
|
6094
6072
|
sdkFrameworks: [...sdkFrameworks].filter(
|
|
@@ -6193,7 +6171,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
6193
6171
|
const rtcAppGroupIdentifier = nonEmptyString(dictionary2.RTCAppGroupIdentifier);
|
|
6194
6172
|
const screenShareExtensionBundleId = typeof dictionary2.ScreenShareExtensionBundleId === "string" ? dictionary2.ScreenShareExtensionBundleId : void 0;
|
|
6195
6173
|
const rootModuleName = readRootModuleName(
|
|
6196
|
-
app.allSources.filter((file) => /Delegate\.(?:swift|mm|m)$/.test(file) &&
|
|
6174
|
+
app.allSources.filter((file) => /Delegate\.(?:swift|mm|m)$/.test(file) && fs6.existsSync(file)).map((file) => fs6.readFileSync(file, "utf8"))
|
|
6197
6175
|
);
|
|
6198
6176
|
const identity = {
|
|
6199
6177
|
...app.keychainAccessGroups === void 0 ? {} : { keychainAccessGroups: app.keychainAccessGroups },
|
|
@@ -6217,7 +6195,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
6217
6195
|
googleSignIn: readGoogleSignInConfiguration(
|
|
6218
6196
|
dictionary2,
|
|
6219
6197
|
Object.fromEntries(
|
|
6220
|
-
app.resources.filter((file) => file.endsWith(".plist")).map((file) => [file, parsePlistBytes(
|
|
6198
|
+
app.resources.filter((file) => file.endsWith(".plist")).map((file) => [file, parsePlistBytes(fs6.readFileSync(file), parseInfoPlist)])
|
|
6221
6199
|
)
|
|
6222
6200
|
),
|
|
6223
6201
|
supportedInterfaceOrientations,
|
|
@@ -6227,11 +6205,11 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
6227
6205
|
bundleIcons: resolveNativeBundleIcons(icons, catalogAlternateNames, (value) => value),
|
|
6228
6206
|
appIconArtwork: resolveNativeAppIconArtwork(
|
|
6229
6207
|
app.resources,
|
|
6230
|
-
(file) =>
|
|
6208
|
+
(file) => fs6.readFileSync(file, "utf8"),
|
|
6231
6209
|
(file) => {
|
|
6232
|
-
const extension =
|
|
6210
|
+
const extension = path6.extname(file).toLowerCase();
|
|
6233
6211
|
const contentType = extension === ".jpg" || extension === ".jpeg" ? "image/jpeg" : extension === ".webp" ? "image/webp" : "image/png";
|
|
6234
|
-
return `data:${contentType};base64,${
|
|
6212
|
+
return `data:${contentType};base64,${fs6.readFileSync(file).toString("base64")}`;
|
|
6235
6213
|
},
|
|
6236
6214
|
icons,
|
|
6237
6215
|
app.appIconName,
|
|
@@ -6268,11 +6246,11 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
|
|
|
6268
6246
|
const read = selectNativeAppIdentityReader(platform, {
|
|
6269
6247
|
android: () => null,
|
|
6270
6248
|
ios: () => {
|
|
6271
|
-
const nested =
|
|
6272
|
-
const iosRoot =
|
|
6249
|
+
const nested = path6.join(projectRoot, "ios");
|
|
6250
|
+
const iosRoot = fs6.existsSync(nested) ? nested : projectRoot;
|
|
6273
6251
|
const prefix = iosRoot === nested ? "ios/" : "";
|
|
6274
6252
|
const files = {};
|
|
6275
|
-
for (const entry of
|
|
6253
|
+
for (const entry of fs6.readdirSync(iosRoot, { withFileTypes: true })) {
|
|
6276
6254
|
if (entry.name === "Pods") continue;
|
|
6277
6255
|
if (entry.isDirectory()) {
|
|
6278
6256
|
const names = entry.name.endsWith(".xcodeproj") ? ["project.pbxproj"] : [
|
|
@@ -6280,17 +6258,17 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
|
|
|
6280
6258
|
"AppDelegate.swift",
|
|
6281
6259
|
"AppDelegate.mm",
|
|
6282
6260
|
"AppDelegate.m",
|
|
6283
|
-
...
|
|
6261
|
+
...fs6.readdirSync(path6.join(iosRoot, entry.name)).filter((name) => name.endsWith(".entitlements"))
|
|
6284
6262
|
];
|
|
6285
6263
|
for (const name of names) {
|
|
6286
6264
|
const relative2 = `${prefix}${entry.name}/${name}`;
|
|
6287
|
-
const file =
|
|
6288
|
-
if (
|
|
6265
|
+
const file = path6.join(projectRoot, relative2);
|
|
6266
|
+
if (fs6.existsSync(file)) files[relative2] = fs6.readFileSync(file, "utf8");
|
|
6289
6267
|
}
|
|
6290
6268
|
} else if (/AppDelegate\.(?:swift|mm|m)$|\.entitlements$/.test(entry.name)) {
|
|
6291
6269
|
const relative2 = `${prefix}${entry.name}`;
|
|
6292
|
-
const file =
|
|
6293
|
-
if (
|
|
6270
|
+
const file = path6.join(projectRoot, relative2);
|
|
6271
|
+
if (fs6.existsSync(file)) files[relative2] = fs6.readFileSync(file, "utf8");
|
|
6294
6272
|
}
|
|
6295
6273
|
}
|
|
6296
6274
|
const identity = extractNativeAppIdentityFromFiles(
|
|
@@ -6307,41 +6285,41 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
|
|
|
6307
6285
|
function readAndroidNativeAppIdentity(projectRoot, androidMergedManifest) {
|
|
6308
6286
|
const files = {};
|
|
6309
6287
|
if (androidMergedManifest) {
|
|
6310
|
-
const file =
|
|
6311
|
-
if (!
|
|
6312
|
-
files[androidMergedManifest] =
|
|
6288
|
+
const file = path6.resolve(projectRoot, androidMergedManifest);
|
|
6289
|
+
if (!fs6.existsSync(file)) return null;
|
|
6290
|
+
files[androidMergedManifest] = fs6.readFileSync(file, "utf8");
|
|
6313
6291
|
} else {
|
|
6314
|
-
const androidRoot =
|
|
6315
|
-
if (!
|
|
6292
|
+
const androidRoot = path6.join(projectRoot, "android");
|
|
6293
|
+
if (!fs6.existsSync(androidRoot)) return null;
|
|
6316
6294
|
const collect = (directory) => {
|
|
6317
|
-
for (const entry of
|
|
6318
|
-
const file =
|
|
6295
|
+
for (const entry of fs6.readdirSync(directory, { withFileTypes: true })) {
|
|
6296
|
+
const file = path6.join(directory, entry.name);
|
|
6319
6297
|
if (entry.isDirectory()) collect(file);
|
|
6320
6298
|
else if (entry.isFile() && entry.name === "AndroidManifest.xml")
|
|
6321
|
-
files[
|
|
6299
|
+
files[path6.relative(projectRoot, file).split(path6.sep).join("/")] = fs6.readFileSync(file, "utf8");
|
|
6322
6300
|
}
|
|
6323
6301
|
};
|
|
6324
|
-
for (const module of
|
|
6302
|
+
for (const module of fs6.readdirSync(androidRoot, { withFileTypes: true })) {
|
|
6325
6303
|
if (!module.isDirectory()) continue;
|
|
6326
|
-
const outputs =
|
|
6304
|
+
const outputs = path6.join(
|
|
6327
6305
|
androidRoot,
|
|
6328
6306
|
module.name,
|
|
6329
6307
|
"build/intermediates/merged_manifests"
|
|
6330
6308
|
);
|
|
6331
|
-
if (
|
|
6309
|
+
if (fs6.existsSync(outputs)) collect(outputs);
|
|
6332
6310
|
}
|
|
6333
6311
|
}
|
|
6334
6312
|
for (const manifest of Object.keys(files)) {
|
|
6335
6313
|
const resourceDirectory = androidMergedResourceValuesDirectory(manifest);
|
|
6336
6314
|
if (!resourceDirectory) continue;
|
|
6337
|
-
const absolute =
|
|
6338
|
-
if (!
|
|
6339
|
-
for (const entry of
|
|
6315
|
+
const absolute = path6.resolve(projectRoot, resourceDirectory);
|
|
6316
|
+
if (!fs6.existsSync(absolute)) continue;
|
|
6317
|
+
for (const entry of fs6.readdirSync(absolute, { withFileTypes: true })) {
|
|
6340
6318
|
if (!entry.isDirectory() || !/^values(?:-|$)/.test(entry.name)) continue;
|
|
6341
|
-
for (const resource of
|
|
6319
|
+
for (const resource of fs6.readdirSync(path6.join(absolute, entry.name))) {
|
|
6342
6320
|
if (!resource.endsWith(".xml")) continue;
|
|
6343
6321
|
const file = `${resourceDirectory}/${entry.name}/${resource}`;
|
|
6344
|
-
files[file] =
|
|
6322
|
+
files[file] = fs6.readFileSync(path6.resolve(projectRoot, file), "utf8");
|
|
6345
6323
|
}
|
|
6346
6324
|
}
|
|
6347
6325
|
}
|
|
@@ -6362,7 +6340,7 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget, enviro
|
|
|
6362
6340
|
parseInfoPlist,
|
|
6363
6341
|
buildSdkVersion
|
|
6364
6342
|
);
|
|
6365
|
-
const projectManifestPath =
|
|
6343
|
+
const projectManifestPath = path6.join(projectRoot, "package.json");
|
|
6366
6344
|
const projectRequire = createRequire2(projectManifestPath);
|
|
6367
6345
|
let reanimatedManifestPath;
|
|
6368
6346
|
try {
|
|
@@ -6376,22 +6354,22 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget, enviro
|
|
|
6376
6354
|
throw error;
|
|
6377
6355
|
}
|
|
6378
6356
|
const installedManifest = JSON.parse(
|
|
6379
|
-
|
|
6357
|
+
fs6.readFileSync(reanimatedManifestPath, "utf8")
|
|
6380
6358
|
);
|
|
6381
6359
|
const installedVersion = isRecord(installedManifest) ? nonEmptyString(installedManifest.version) : void 0;
|
|
6382
6360
|
if (!installedVersion) throw new Error("Reanimated package version is malformed");
|
|
6383
6361
|
if (Number.parseInt(installedVersion, 10) < 4) return identity;
|
|
6384
6362
|
const defaults = JSON.parse(
|
|
6385
|
-
|
|
6386
|
-
|
|
6387
|
-
|
|
6363
|
+
fs6.readFileSync(
|
|
6364
|
+
path6.join(
|
|
6365
|
+
path6.dirname(reanimatedManifestPath),
|
|
6388
6366
|
"src/featureFlags/staticFlags.json"
|
|
6389
6367
|
),
|
|
6390
6368
|
"utf8"
|
|
6391
6369
|
)
|
|
6392
6370
|
);
|
|
6393
6371
|
if (!isRecord(defaults)) throw new Error("Reanimated static flags are malformed");
|
|
6394
|
-
const manifest = JSON.parse(
|
|
6372
|
+
const manifest = JSON.parse(fs6.readFileSync(projectManifestPath, "utf8"));
|
|
6395
6373
|
const reanimated = isRecord(manifest) ? manifest.reanimated : void 0;
|
|
6396
6374
|
const overrides = isRecord(reanimated) ? reanimated.staticFeatureFlags : void 0;
|
|
6397
6375
|
if (overrides !== void 0 && !isRecord(overrides)) {
|