peachsim 0.1.2680 → 0.1.2682
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/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 +905 -828
- 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 +2 -2
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/esm-chunks/{acorn-KFRNGPIS.mjs → acorn-V7B4X5PR.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-SAKCEYPB.mjs → chunk-3UQZATB5.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-2DSJ4Y2B.mjs → chunk-3VAFU4BM.mjs} +4 -4
- package/dist-lib/esm-chunks/{chunk-6FMJ3RGV.mjs → chunk-5SWSDDXC.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-YOSTYBQ5.mjs → chunk-64UA6DQO.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-63IRSGUP.mjs → chunk-6PSNFREM.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-BRJ7ARFB.mjs → chunk-AXBK3CA4.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-MA526IJY.mjs → chunk-BJHQOPWO.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-BZZUMB6S.mjs → chunk-DU3VOY6S.mjs} +6 -6
- package/dist-lib/esm-chunks/{chunk-UASVIFF4.mjs → chunk-EC5RY4HR.mjs} +2 -2
- package/dist-lib/esm-chunks/{chunk-SZLZ7MYO.mjs → chunk-EK36QRGX.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-AKMQQCL4.mjs → chunk-GNZDVDDX.mjs} +6 -6
- package/dist-lib/esm-chunks/{chunk-D7K24QPS.mjs → chunk-IOLISFIO.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-UTPHWDOY.mjs → chunk-KYIRROKJ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-5ZUDE2OE.mjs → chunk-LV55WJFQ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-54DXR7XC.mjs → chunk-PE7HDZNI.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-HTM32XYI.mjs → chunk-R2WPUKVT.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-NDNSEMKC.mjs → chunk-SZ5UPZE4.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-RXNQMOOQ.mjs → chunk-UTI6VCYT.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-ISLJJHL6.mjs → chunk-VTJTOL53.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-I567ROA6.mjs → chunk-X37OP27I.mjs} +14 -14
- package/dist-lib/esm-chunks/{chunk-YIBGV5BP.mjs → chunk-Y6WPXDCC.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-TTFIUXYS.mjs → chunk-YKGS4NSG.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-X6TNJRLY.mjs → chunk-Z6R2HZIH.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-S2R5CB3W.mjs → chunk-ZYD227CX.mjs} +1 -1
- package/dist-lib/esm-chunks/{metro-layout-parser-6ETCKA7E.mjs → metro-layout-parser-5RTSOQCS.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-GTSH3CYC.mjs → swift-package-prebuilt-EH5JIX6L.mjs} +12 -12
- package/dist-lib/esm-chunks/{swift-sdk-app-module-PUPJSKNY.mjs → swift-sdk-app-module-VHAOCBXW.mjs} +16 -16
- package/dist-lib/esm-chunks/{swift-sdk-image-YPS6TJTZ.mjs → swift-sdk-image-3NCWCGQZ.mjs} +16 -16
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-5NMRH53W.mjs → swift-sdk-image-producer-5S4IKSJ2.mjs} +5 -5
- package/dist-lib/expo-swift-bundle.cjs +736 -659
- 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 +741 -664
- package/dist-lib/host/fetch-proxy-handler.cjs +84 -81
- 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 +410 -304
- package/dist-lib/native-app-identity-project.mjs +418 -312
- 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 +87 -85
- package/dist-lib/public-origins-lib.json +73 -71
- 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 +781 -704
- package/dist-lib/swift-compile.cjs +1 -1
- package/dist-lib/swift-compile.mjs +12 -12
- 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/engine/native-image-pipeline.d.ts +5 -0
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +3 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/src/expo-swift-host.ts +73 -31
- package/src/swift-xcframework.ts +13 -7
- package/src/turbo-codegen-intake.ts +4 -1
- package/src/xcode-project.ts +57 -0
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2682 | (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-YKGS4NSG.mjs";
|
|
5
|
+
import "./esm-chunks/chunk-UTI6VCYT.mjs";
|
|
6
|
+
import "./esm-chunks/chunk-LV55WJFQ.mjs";
|
|
7
7
|
import {
|
|
8
8
|
NATIVE_GRAPH_SDK_VERSION,
|
|
9
9
|
cacheDir
|
|
10
|
-
} from "./esm-chunks/chunk-
|
|
10
|
+
} from "./esm-chunks/chunk-DU3VOY6S.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-R2WPUKVT.mjs";
|
|
16
|
+
import "./esm-chunks/chunk-5SWSDDXC.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-6PSNFREM.mjs";
|
|
22
22
|
import {
|
|
23
23
|
androidMergedResourceValuesDirectory,
|
|
24
24
|
extractNativeAppIdentityFromFiles,
|
|
@@ -36,27 +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-3VAFU4BM.mjs";
|
|
40
|
+
import "./esm-chunks/chunk-EK36QRGX.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-
|
|
46
|
+
} from "./esm-chunks/chunk-BJHQOPWO.mjs";
|
|
47
|
+
import "./esm-chunks/chunk-PE7HDZNI.mjs";
|
|
48
|
+
import "./esm-chunks/chunk-3UQZATB5.mjs";
|
|
49
49
|
import {
|
|
50
50
|
isRecord
|
|
51
|
-
} from "./esm-chunks/chunk-
|
|
51
|
+
} from "./esm-chunks/chunk-IOLISFIO.mjs";
|
|
52
52
|
import {
|
|
53
53
|
__publicField
|
|
54
|
-
} from "./esm-chunks/chunk-
|
|
54
|
+
} from "./esm-chunks/chunk-ZYD227CX.mjs";
|
|
55
55
|
|
|
56
56
|
// src/native-app-identity-project.ts
|
|
57
|
-
import
|
|
57
|
+
import fs8 from "node:fs";
|
|
58
58
|
import { createRequire as createRequire2 } from "node:module";
|
|
59
|
-
import
|
|
59
|
+
import path8 from "node:path";
|
|
60
60
|
|
|
61
61
|
// src/plist-bytes.ts
|
|
62
62
|
import assert from "node:assert/strict";
|
|
@@ -192,9 +192,9 @@ function parsePlistBytes(source, parseXml = parsePlistSource) {
|
|
|
192
192
|
// src/xcode-project.ts
|
|
193
193
|
import { execFileSync as execFileSync2, spawnSync } from "node:child_process";
|
|
194
194
|
import { createHash as createHash7 } from "node:crypto";
|
|
195
|
-
import
|
|
195
|
+
import fs7 from "node:fs";
|
|
196
196
|
import { createRequire } from "node:module";
|
|
197
|
-
import
|
|
197
|
+
import path7 from "node:path";
|
|
198
198
|
|
|
199
199
|
// src/bazel-project.ts
|
|
200
200
|
import { execFileSync } from "node:child_process";
|
|
@@ -1546,7 +1546,7 @@ import { join as join3, relative, sep } from "node:path";
|
|
|
1546
1546
|
import { createHash as createHash3 } from "node:crypto";
|
|
1547
1547
|
import { readFileSync } from "node:fs";
|
|
1548
1548
|
import { join } from "node:path";
|
|
1549
|
-
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":"692791414734a0fe5949c1d2638941d5de882b8737675deae2e3a49512f2a126","home-paths.ts":"d1606390f0e8e50f0ff72544eadb3d49dfabf08e004c1218f2998c36fb8995dd","xcode-header-search.ts":"c72b724fc497e4cf603c355f86eb3c07c929ad299758cffbc6ff88ed241654c6","xcode-project.ts":"
|
|
1549
|
+
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":"692791414734a0fe5949c1d2638941d5de882b8737675deae2e3a49512f2a126","home-paths.ts":"d1606390f0e8e50f0ff72544eadb3d49dfabf08e004c1218f2998c36fb8995dd","xcode-header-search.ts":"c72b724fc497e4cf603c355f86eb3c07c929ad299758cffbc6ff88ed241654c6","xcode-project.ts":"d140088a94d032e28788e18bf11499965e0c626255fd904538764ededcf1d751","xcode-target-members.ts":"2379e6d411c5d63fa65ddc24c4e4fc8bfcd001b5be109b694c848fe62908db86","xcode-json-project.ts":"df6d6db28e0c8cfdf1f480e1e32d35f12c9cf1936642d5dda923889fb18a8fd6","openstep-plist.ts":"da11f86885ef1e25979ad989f332195c113c4b7a43f108e8d36646973430b81b"}') : swiftCoverageSourceDigests(join(import.meta.dirname, ".."));
|
|
1550
1550
|
|
|
1551
1551
|
// src/swift-coverage/xcode-asset-symbols.ts
|
|
1552
1552
|
import { existsSync, readdirSync, readFileSync as readFileSync2 } from "node:fs";
|
|
@@ -1731,10 +1731,73 @@ var assetSymbolSettingKeys = [
|
|
|
1731
1731
|
"ASSETCATALOG_OTHER_FLAGS"
|
|
1732
1732
|
];
|
|
1733
1733
|
|
|
1734
|
-
// src/
|
|
1735
|
-
import { createHash as createHash6 } from "node:crypto";
|
|
1734
|
+
// src/swift-source-file.ts
|
|
1736
1735
|
import fs4 from "node:fs";
|
|
1737
1736
|
import path3 from "node:path";
|
|
1737
|
+
function relativeInside(root, file) {
|
|
1738
|
+
const relative2 = path3.relative(root, file);
|
|
1739
|
+
return relative2 === ".." || relative2.startsWith(`..${path3.sep}`) || path3.isAbsolute(relative2) ? null : relative2;
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
// src/swift-xcframework.ts
|
|
1743
|
+
import fs5 from "node:fs";
|
|
1744
|
+
import path4 from "node:path";
|
|
1745
|
+
function simulatorNativeLibrary(dir) {
|
|
1746
|
+
if (dir.endsWith(".framework")) {
|
|
1747
|
+
const name = path4.basename(dir, ".framework");
|
|
1748
|
+
return {
|
|
1749
|
+
name,
|
|
1750
|
+
file: path4.join(dir, name),
|
|
1751
|
+
slice: path4.dirname(dir),
|
|
1752
|
+
kind: "framework"
|
|
1753
|
+
};
|
|
1754
|
+
}
|
|
1755
|
+
if (!dir.endsWith(".xcframework")) return null;
|
|
1756
|
+
const info = parsePlistBytes(fs5.readFileSync(path4.join(dir, "Info.plist")));
|
|
1757
|
+
if (!isRecord(info) || !Array.isArray(info.AvailableLibraries))
|
|
1758
|
+
throw new Error(`${dir}: invalid XCFramework library declarations`);
|
|
1759
|
+
const matches = [];
|
|
1760
|
+
for (const entry of info.AvailableLibraries) {
|
|
1761
|
+
if (!isRecord(entry)) throw new Error(`${dir}: invalid XCFramework library entry`);
|
|
1762
|
+
if (entry.SupportedPlatform !== "ios" || entry.SupportedPlatformVariant !== "simulator")
|
|
1763
|
+
continue;
|
|
1764
|
+
if (typeof entry.LibraryPath !== "string" || typeof entry.LibraryIdentifier !== "string")
|
|
1765
|
+
throw new Error(`${dir}: invalid simulator library paths`);
|
|
1766
|
+
const archive = /\.a$/.test(entry.LibraryPath);
|
|
1767
|
+
const framework = /\.framework$/.test(entry.LibraryPath);
|
|
1768
|
+
if (!archive && !framework) continue;
|
|
1769
|
+
const slice = path4.resolve(dir, entry.LibraryIdentifier);
|
|
1770
|
+
const bundle = path4.resolve(dir, entry.LibraryIdentifier, entry.LibraryPath);
|
|
1771
|
+
const bundleRelative = path4.relative(dir, bundle);
|
|
1772
|
+
if (bundleRelative.startsWith("..") || path4.isAbsolute(bundleRelative))
|
|
1773
|
+
throw new Error(`${dir}: library escapes its XCFramework`);
|
|
1774
|
+
let name = entry.LibraryPath;
|
|
1775
|
+
let file = bundle;
|
|
1776
|
+
if (framework) {
|
|
1777
|
+
name = path4.basename(bundle, ".framework");
|
|
1778
|
+
file = path4.join(bundle, name);
|
|
1779
|
+
}
|
|
1780
|
+
const relative2 = path4.relative(dir, file);
|
|
1781
|
+
if (relative2.startsWith("..") || path4.isAbsolute(relative2))
|
|
1782
|
+
throw new Error(`${dir}: library escapes its XCFramework`);
|
|
1783
|
+
if (framework) {
|
|
1784
|
+
matches.push({ name, file, slice, kind: "framework" });
|
|
1785
|
+
continue;
|
|
1786
|
+
}
|
|
1787
|
+
const headers = typeof entry.HeadersPath === "string" ? path4.resolve(slice, entry.HeadersPath) : void 0;
|
|
1788
|
+
if (headers && relativeInside(slice, headers) === null)
|
|
1789
|
+
throw new Error(`${dir}: headers escape their XCFramework slice`);
|
|
1790
|
+
matches.push({ name, file, slice, kind: "archive", headers });
|
|
1791
|
+
}
|
|
1792
|
+
if (matches.length === 0) return null;
|
|
1793
|
+
if (matches.length !== 1) throw new Error(`${dir}: ambiguous simulator library`);
|
|
1794
|
+
return matches[0];
|
|
1795
|
+
}
|
|
1796
|
+
|
|
1797
|
+
// src/xcode-intents.ts
|
|
1798
|
+
import { createHash as createHash6 } from "node:crypto";
|
|
1799
|
+
import fs6 from "node:fs";
|
|
1800
|
+
import path5 from "node:path";
|
|
1738
1801
|
|
|
1739
1802
|
// src/intent-definition/fields.ts
|
|
1740
1803
|
import assert2 from "node:assert/strict";
|
|
@@ -3276,17 +3339,17 @@ function preparePortableIntent(definition, derivedDirectory, prefix, language, m
|
|
|
3276
3339
|
throw new Error(`${definition}: invalid intent code generation language ${language}`);
|
|
3277
3340
|
if (prefix) identifier(prefix);
|
|
3278
3341
|
if (module) identifier(module);
|
|
3279
|
-
const source =
|
|
3342
|
+
const source = fs6.readFileSync(definition);
|
|
3280
3343
|
const key = createHash6("sha256").update(
|
|
3281
3344
|
JSON.stringify([intentCompilerRevision, definition, prefix, language, module])
|
|
3282
3345
|
).update("\0").update(source).digest("hex");
|
|
3283
|
-
const cache =
|
|
3284
|
-
const output =
|
|
3285
|
-
const localization = definition.split(
|
|
3286
|
-
const compiledRelative =
|
|
3287
|
-
const compiled =
|
|
3288
|
-
const generated =
|
|
3289
|
-
if (
|
|
3346
|
+
const cache = path5.join(derivedDirectory, "IntentDefinitions");
|
|
3347
|
+
const output = path5.join(cache, key);
|
|
3348
|
+
const localization = definition.split(path5.sep).findLast((part) => part.endsWith(".lproj")) ?? "";
|
|
3349
|
+
const compiledRelative = path5.join("Resources", localization, path5.basename(definition));
|
|
3350
|
+
const compiled = path5.join(output, compiledRelative);
|
|
3351
|
+
const generated = path5.join(output, "Sources");
|
|
3352
|
+
if (fs6.existsSync(compiled) && fs6.existsSync(generated)) return { compiled, generated };
|
|
3290
3353
|
let metadata;
|
|
3291
3354
|
let sources;
|
|
3292
3355
|
try {
|
|
@@ -3296,30 +3359,30 @@ function preparePortableIntent(definition, derivedDirectory, prefix, language, m
|
|
|
3296
3359
|
} catch (cause) {
|
|
3297
3360
|
throw new Error(`could not compile intent definition ${definition}`, { cause });
|
|
3298
3361
|
}
|
|
3299
|
-
|
|
3300
|
-
const stage =
|
|
3362
|
+
fs6.mkdirSync(cache, { recursive: true });
|
|
3363
|
+
const stage = fs6.mkdtempSync(path5.join(cache, ".compile-"));
|
|
3301
3364
|
try {
|
|
3302
|
-
const sourceDirectory =
|
|
3303
|
-
const resource =
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3365
|
+
const sourceDirectory = path5.join(stage, "Sources");
|
|
3366
|
+
const resource = path5.join(stage, compiledRelative);
|
|
3367
|
+
fs6.mkdirSync(sourceDirectory);
|
|
3368
|
+
fs6.mkdirSync(path5.dirname(resource), { recursive: true });
|
|
3369
|
+
fs6.writeFileSync(resource, metadata);
|
|
3307
3370
|
for (const [file, contents] of sources)
|
|
3308
|
-
|
|
3371
|
+
fs6.writeFileSync(path5.join(sourceDirectory, file), contents);
|
|
3309
3372
|
try {
|
|
3310
|
-
|
|
3373
|
+
fs6.renameSync(stage, output);
|
|
3311
3374
|
} catch (error) {
|
|
3312
|
-
if (!isRecord(error) || error.code !== "EEXIST" && error.code !== "ENOTEMPTY" || !
|
|
3375
|
+
if (!isRecord(error) || error.code !== "EEXIST" && error.code !== "ENOTEMPTY" || !fs6.existsSync(compiled) || !fs6.existsSync(generated))
|
|
3313
3376
|
throw error;
|
|
3314
3377
|
}
|
|
3315
3378
|
return { compiled, generated };
|
|
3316
3379
|
} finally {
|
|
3317
|
-
|
|
3380
|
+
fs6.rmSync(stage, { recursive: true, force: true });
|
|
3318
3381
|
}
|
|
3319
3382
|
}
|
|
3320
3383
|
|
|
3321
3384
|
// src/xcode-json-project.ts
|
|
3322
|
-
import
|
|
3385
|
+
import path6 from "node:path";
|
|
3323
3386
|
var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3324
3387
|
var text = (value) => typeof value === "string" ? value : void 0;
|
|
3325
3388
|
var items = (value) => Array.isArray(value) ? value : [];
|
|
@@ -3376,7 +3439,7 @@ var PHASE_ISA = {
|
|
|
3376
3439
|
function readXcodeJsonProject(xcodeproj, source) {
|
|
3377
3440
|
const json = Bun.JSON5.parse(source);
|
|
3378
3441
|
if (!isJsonObject(json)) throw new Error(`${xcodeproj}/project.xcproj is not an object`);
|
|
3379
|
-
const projectDir =
|
|
3442
|
+
const projectDir = path6.dirname(xcodeproj);
|
|
3380
3443
|
const objects = {};
|
|
3381
3444
|
let next = 0;
|
|
3382
3445
|
const add = (entry, id) => {
|
|
@@ -3389,7 +3452,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
3389
3452
|
const base = /^<([A-Z]+)>\/(.*)$/.exec(raw);
|
|
3390
3453
|
if (base) {
|
|
3391
3454
|
if (base[1] === "PROJECT")
|
|
3392
|
-
return { sourceTree: "<absolute>", path:
|
|
3455
|
+
return { sourceTree: "<absolute>", path: path6.join(projectDir, base[2]) };
|
|
3393
3456
|
if (base[1] === "PRODUCTS")
|
|
3394
3457
|
return { sourceTree: "BUILT_PRODUCTS_DIR", path: base[2] };
|
|
3395
3458
|
return null;
|
|
@@ -3397,7 +3460,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
3397
3460
|
const unescaped = raw.replaceAll("\\<", "<");
|
|
3398
3461
|
if (unescaped.startsWith("/")) return { sourceTree: "<absolute>", path: unescaped };
|
|
3399
3462
|
if (unescaped.startsWith("~")) return null;
|
|
3400
|
-
return groupDir === null ? null : { sourceTree: "<absolute>", path:
|
|
3463
|
+
return groupDir === null ? null : { sourceTree: "<absolute>", path: path6.join(groupDir, unescaped) };
|
|
3401
3464
|
};
|
|
3402
3465
|
const memberships = [];
|
|
3403
3466
|
const folders = [];
|
|
@@ -3408,7 +3471,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
3408
3471
|
const kind = text(entry.kind) ?? "file-reference";
|
|
3409
3472
|
const raw = text(entry.path) ?? "";
|
|
3410
3473
|
const located = raw === "" ? null : locate(raw, parent.dir);
|
|
3411
|
-
const name = text(entry.name) ??
|
|
3474
|
+
const name = text(entry.name) ?? path6.basename(raw);
|
|
3412
3475
|
const node = { id: "", name, dir: null, parent, children: [] };
|
|
3413
3476
|
if (kind === "group" || kind === "variant-group" || kind === "version-group") {
|
|
3414
3477
|
node.dir = raw === "" ? parent.dir : located?.sourceTree === "<absolute>" ? located.path : null;
|
|
@@ -3529,7 +3592,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
3529
3592
|
if (!isObject(entry)) continue;
|
|
3530
3593
|
const repository = text(entry.repository);
|
|
3531
3594
|
const local = text(entry.path);
|
|
3532
|
-
const name = local !== void 0 ?
|
|
3595
|
+
const name = local !== void 0 ? path6.basename(path6.resolve(path6.dirname(xcodeproj), local)) : path6.basename(repository ?? "").replace(/\.git$/, "");
|
|
3533
3596
|
const id = text(entry.kind) === "local" && local !== void 0 ? add({ isa: "XCLocalSwiftPackageReference", relativePath: local }) : add({
|
|
3534
3597
|
isa: "XCRemoteSwiftPackageReference",
|
|
3535
3598
|
repositoryURL: repository ?? "",
|
|
@@ -3809,28 +3872,28 @@ var CONDITIONS = {
|
|
|
3809
3872
|
variant: "normal"
|
|
3810
3873
|
};
|
|
3811
3874
|
function walkFiles(dir) {
|
|
3812
|
-
if (!
|
|
3875
|
+
if (!fs7.existsSync(dir)) return [];
|
|
3813
3876
|
const out = [];
|
|
3814
|
-
for (const entry of
|
|
3877
|
+
for (const entry of fs7.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name))) {
|
|
3815
3878
|
if (entry.name.startsWith(".")) continue;
|
|
3816
|
-
const full =
|
|
3879
|
+
const full = path7.join(dir, entry.name);
|
|
3817
3880
|
if (entry.isDirectory()) out.push(...walkFiles(full));
|
|
3818
3881
|
else if (entry.isFile()) out.push(full);
|
|
3819
3882
|
}
|
|
3820
3883
|
return out;
|
|
3821
3884
|
}
|
|
3822
|
-
var isDirectory = (dir) =>
|
|
3885
|
+
var isDirectory = (dir) => fs7.existsSync(dir) && fs7.statSync(dir).isDirectory();
|
|
3823
3886
|
function readXcconfig(file, read) {
|
|
3824
|
-
if (read.includes(file) || !
|
|
3887
|
+
if (read.includes(file) || !fs7.existsSync(file)) return {};
|
|
3825
3888
|
read.push(file);
|
|
3826
3889
|
const settings = {};
|
|
3827
|
-
for (const raw of
|
|
3890
|
+
for (const raw of fs7.readFileSync(file, "utf8").split("\n")) {
|
|
3828
3891
|
const line = raw.replace(/\/\/.*$/, "").trim();
|
|
3829
3892
|
const include = /^#include\??\s+"([^"]+)"/.exec(line);
|
|
3830
3893
|
if (include) {
|
|
3831
3894
|
Object.assign(
|
|
3832
3895
|
settings,
|
|
3833
|
-
readXcconfig(
|
|
3896
|
+
readXcconfig(path7.resolve(path7.dirname(file), include[1]), read)
|
|
3834
3897
|
);
|
|
3835
3898
|
continue;
|
|
3836
3899
|
}
|
|
@@ -3875,8 +3938,8 @@ function applyOperator(value, operator) {
|
|
|
3875
3938
|
return value.replace(/[^A-Za-z0-9_]/g, "_").replace(/^[0-9]/, "_");
|
|
3876
3939
|
case "standardizepath":
|
|
3877
3940
|
if (value === ".") return value;
|
|
3878
|
-
if (
|
|
3879
|
-
return
|
|
3941
|
+
if (path7.posix.isAbsolute(value))
|
|
3942
|
+
return path7.posix.normalize(value).replace(/(?<=.)\/$/, "");
|
|
3880
3943
|
return value.split("/").filter((component) => component !== "" && component !== ".").join("/");
|
|
3881
3944
|
}
|
|
3882
3945
|
throw new Error(`unsupported build setting operator :${operator}`);
|
|
@@ -3885,22 +3948,22 @@ function decodeXml(text2) {
|
|
|
3885
3948
|
return text2.replaceAll(""", '"').replaceAll("'", "'").replaceAll("<", "<").replaceAll(">", ">").replaceAll("&", "&");
|
|
3886
3949
|
}
|
|
3887
3950
|
function workspaceReferences(workspace) {
|
|
3888
|
-
const data =
|
|
3889
|
-
if (!
|
|
3951
|
+
const data = path7.join(workspace, "contents.xcworkspacedata");
|
|
3952
|
+
if (!fs7.existsSync(data))
|
|
3890
3953
|
throw new Error(`${workspace} has no contents.xcworkspacedata`);
|
|
3891
|
-
const container =
|
|
3954
|
+
const container = path7.dirname(workspace);
|
|
3892
3955
|
const locate = (location, base) => {
|
|
3893
3956
|
const colon = location.indexOf(":");
|
|
3894
3957
|
const kind = location.slice(0, colon);
|
|
3895
3958
|
const rest = location.slice(colon + 1);
|
|
3896
|
-
if (kind === "group") return
|
|
3897
|
-
if (kind === "container" || kind === "self") return
|
|
3898
|
-
if (kind === "absolute") return
|
|
3899
|
-
throw new Error(`${
|
|
3959
|
+
if (kind === "group") return path7.resolve(base, rest);
|
|
3960
|
+
if (kind === "container" || kind === "self") return path7.resolve(container, rest);
|
|
3961
|
+
if (kind === "absolute") return path7.resolve(rest);
|
|
3962
|
+
throw new Error(`${path7.basename(workspace)} has an unsupported location ${location}`);
|
|
3900
3963
|
};
|
|
3901
3964
|
const groups = [container];
|
|
3902
3965
|
const references = [];
|
|
3903
|
-
for (const [, closing, tag, attributes, selfClosing] of
|
|
3966
|
+
for (const [, closing, tag, attributes, selfClosing] of fs7.readFileSync(data, "utf8").matchAll(/<(\/?)(Group|FileRef)\b([^>]*?)(\/?)>/g)) {
|
|
3904
3967
|
if (closing) {
|
|
3905
3968
|
if (tag === "Group") groups.pop();
|
|
3906
3969
|
continue;
|
|
@@ -3951,8 +4014,8 @@ function remotePackageRequirements(projects) {
|
|
|
3951
4014
|
var loaded = /* @__PURE__ */ new Map();
|
|
3952
4015
|
function xcodeProjectFile(xcodeproj) {
|
|
3953
4016
|
for (const name of ["project.pbxproj", "project.xcproj"]) {
|
|
3954
|
-
const file =
|
|
3955
|
-
if (
|
|
4017
|
+
const file = path7.join(xcodeproj, name);
|
|
4018
|
+
if (fs7.existsSync(file)) return file;
|
|
3956
4019
|
}
|
|
3957
4020
|
return null;
|
|
3958
4021
|
}
|
|
@@ -3960,7 +4023,7 @@ function loadProject(xcodeproj) {
|
|
|
3960
4023
|
const projectFile = xcodeProjectFile(xcodeproj);
|
|
3961
4024
|
if (!projectFile)
|
|
3962
4025
|
throw new Error(`${xcodeproj} has no project.pbxproj or project.xcproj`);
|
|
3963
|
-
const source =
|
|
4026
|
+
const source = fs7.readFileSync(projectFile, "utf8");
|
|
3964
4027
|
const digest = createHash7("sha256").update(source).digest("hex");
|
|
3965
4028
|
const cached = loaded.get(projectFile);
|
|
3966
4029
|
if (cached?.digest === digest) return cached.project;
|
|
@@ -3977,10 +4040,10 @@ function loadProject(xcodeproj) {
|
|
|
3977
4040
|
if (!project || project.isa !== "PBXProject") {
|
|
3978
4041
|
throw new Error(`${projectFile} has no PBXProject root`);
|
|
3979
4042
|
}
|
|
3980
|
-
const projectDir =
|
|
3981
|
-
|
|
4043
|
+
const projectDir = fs7.realpathSync.native(
|
|
4044
|
+
path7.resolve(path7.dirname(xcodeproj), str(project.projectDirPath) ?? "")
|
|
3982
4045
|
);
|
|
3983
|
-
const resolvePath = xcodePathResolver(objects, projectDir,
|
|
4046
|
+
const resolvePath = xcodePathResolver(objects, projectDir, path7.join);
|
|
3984
4047
|
const result = {
|
|
3985
4048
|
xcodeproj,
|
|
3986
4049
|
projectFile,
|
|
@@ -4025,7 +4088,7 @@ function expandValue(value, settings) {
|
|
|
4025
4088
|
return value;
|
|
4026
4089
|
}
|
|
4027
4090
|
function processedInfoPlist(name, file, settings, settingKeys) {
|
|
4028
|
-
const source = file ? parsePlist(
|
|
4091
|
+
const source = file ? parsePlist(fs7.readFileSync(file, "utf8")) : {};
|
|
4029
4092
|
if (!source || typeof source !== "object" || Array.isArray(source) || source instanceof Date || Buffer.isBuffer(source))
|
|
4030
4093
|
throw new Error(`${name} Info.plist must contain a dictionary`);
|
|
4031
4094
|
const info = {};
|
|
@@ -4065,8 +4128,8 @@ function targetSettings(ref, configuration, builtins, options2 = {}, overrides =
|
|
|
4065
4128
|
const relative2 = str(config.baseConfigurationReferenceRelativePath);
|
|
4066
4129
|
const own = isDict(config.buildSettings) ? config.buildSettings : {};
|
|
4067
4130
|
const directory = anchor ? project.resolvePath(anchor) : null;
|
|
4068
|
-
const baseFile = base ? project.resolvePath(base) : directory && relative2 ?
|
|
4069
|
-
if ((options2.requireSources !== false || options2.installedPods) && (base || anchor || relative2) && (!baseFile || !
|
|
4131
|
+
const baseFile = base ? project.resolvePath(base) : directory && relative2 ? path7.resolve(directory, relative2) : null;
|
|
4132
|
+
if ((options2.requireSources !== false || options2.installedPods) && (base || anchor || relative2) && (!baseFile || !fs7.existsSync(baseFile)))
|
|
4070
4133
|
throw new Error(
|
|
4071
4134
|
`Unable to open base configuration reference file '${baseFile ?? base ?? relative2 ?? anchor}'`
|
|
4072
4135
|
);
|
|
@@ -4160,10 +4223,10 @@ function hostMacroPluginFlags(flags) {
|
|
|
4160
4223
|
if (flags[index - 1] !== "-load-plugin-executable") return flag;
|
|
4161
4224
|
const separator = flag.lastIndexOf("#");
|
|
4162
4225
|
if (separator < 0) return flag;
|
|
4163
|
-
const root =
|
|
4164
|
-
const manifest =
|
|
4165
|
-
if (!
|
|
4166
|
-
const pkg = JSON.parse(
|
|
4226
|
+
const root = path7.dirname(path7.dirname(flag.slice(0, separator)));
|
|
4227
|
+
const manifest = path7.join(root, "package.json");
|
|
4228
|
+
if (!fs7.existsSync(manifest)) return flag;
|
|
4229
|
+
const pkg = JSON.parse(fs7.readFileSync(manifest, "utf8"));
|
|
4167
4230
|
if (!isRecord(pkg) || pkg.name !== "expo-modules-macros") return flag;
|
|
4168
4231
|
const macros = createRequire(manifest)(root);
|
|
4169
4232
|
if (!isRecord(macros) || typeof macros.getScannerBinaryPath !== "function")
|
|
@@ -4181,26 +4244,26 @@ function scriptCommand(shell, script) {
|
|
|
4181
4244
|
return [executable, ...args, "-c", script];
|
|
4182
4245
|
}
|
|
4183
4246
|
function expandSearchPath(directory, rules2) {
|
|
4184
|
-
if (
|
|
4247
|
+
if (path7.basename(directory) !== "**") return [directory];
|
|
4185
4248
|
const expanded = [];
|
|
4186
4249
|
const seen = /* @__PURE__ */ new Set();
|
|
4187
|
-
const queue = [
|
|
4250
|
+
const queue = [path7.dirname(directory)];
|
|
4188
4251
|
for (let at = 0; at < queue.length; at++) {
|
|
4189
4252
|
const current = queue[at];
|
|
4190
4253
|
let real;
|
|
4191
4254
|
try {
|
|
4192
|
-
real =
|
|
4255
|
+
real = fs7.realpathSync.native(current);
|
|
4193
4256
|
} catch {
|
|
4194
4257
|
continue;
|
|
4195
4258
|
}
|
|
4196
|
-
if (!
|
|
4259
|
+
if (!fs7.statSync(real).isDirectory() || seen.has(real)) continue;
|
|
4197
4260
|
seen.add(real);
|
|
4198
4261
|
expanded.push(current);
|
|
4199
|
-
for (const entry of
|
|
4262
|
+
for (const entry of fs7.readdirSync(real, { withFileTypes: true }).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
|
|
4200
4263
|
if (entry.isSymbolicLink() ? !rules2.followLinks : !entry.isDirectory()) continue;
|
|
4201
4264
|
if (rules2.excluded.some((pattern) => pattern.test(entry.name)) && !rules2.included.some((pattern) => pattern.test(entry.name)))
|
|
4202
4265
|
continue;
|
|
4203
|
-
queue.push(
|
|
4266
|
+
queue.push(path7.join(current, entry.name));
|
|
4204
4267
|
}
|
|
4205
4268
|
}
|
|
4206
4269
|
return expanded;
|
|
@@ -4211,7 +4274,7 @@ function searchedLinkerFlags(projectDir, settings, libraryDirectories) {
|
|
|
4211
4274
|
const rules2 = recursiveSearchRules(settings);
|
|
4212
4275
|
const directories = new Set(
|
|
4213
4276
|
settingList(settings("LIBRARY_SEARCH_PATHS")).flatMap(
|
|
4214
|
-
(raw) => expandSearchPath(
|
|
4277
|
+
(raw) => expandSearchPath(path7.resolve(projectDir, expand(raw, settings)), rules2)
|
|
4215
4278
|
)
|
|
4216
4279
|
);
|
|
4217
4280
|
const resolved = [];
|
|
@@ -4224,18 +4287,18 @@ function searchedLinkerFlags(projectDir, settings, libraryDirectories) {
|
|
|
4224
4287
|
}
|
|
4225
4288
|
let archive;
|
|
4226
4289
|
for (const directory of directories) {
|
|
4227
|
-
const file = (extension) =>
|
|
4290
|
+
const file = (extension) => path7.join(directory, `lib${name}.${extension}`);
|
|
4228
4291
|
const dylib = file("dylib");
|
|
4229
|
-
const parent =
|
|
4292
|
+
const parent = path7.dirname(dylib);
|
|
4230
4293
|
let present = libraryDirectories.get(parent);
|
|
4231
4294
|
if (present === void 0) {
|
|
4232
|
-
present =
|
|
4295
|
+
present = fs7.existsSync(parent);
|
|
4233
4296
|
libraryDirectories.set(parent, present);
|
|
4234
4297
|
}
|
|
4235
4298
|
if (!present) continue;
|
|
4236
|
-
if (
|
|
4299
|
+
if (fs7.existsSync(dylib) || fs7.existsSync(file("tbd"))) break;
|
|
4237
4300
|
const staticLibrary = file("a");
|
|
4238
|
-
if (!
|
|
4301
|
+
if (!fs7.existsSync(staticLibrary)) continue;
|
|
4239
4302
|
archive = staticLibrary;
|
|
4240
4303
|
break;
|
|
4241
4304
|
}
|
|
@@ -4333,7 +4396,7 @@ function shellAssetCatalogs(script, settings, projectDir) {
|
|
|
4333
4396
|
for (const token of tokens) {
|
|
4334
4397
|
if (token.startsWith("-")) break;
|
|
4335
4398
|
const file = resolve(token);
|
|
4336
|
-
if (file?.endsWith(".xcassets")) catalogs.push(
|
|
4399
|
+
if (file?.endsWith(".xcassets")) catalogs.push(path7.resolve(projectDir, file));
|
|
4337
4400
|
}
|
|
4338
4401
|
}
|
|
4339
4402
|
return catalogs;
|
|
@@ -4378,14 +4441,14 @@ function shellCopies(script, settings, projectDir) {
|
|
|
4378
4441
|
if (operands.length !== 2 || operands.some((operand) => operand.startsWith("-")))
|
|
4379
4442
|
return [];
|
|
4380
4443
|
copies.push({
|
|
4381
|
-
from:
|
|
4382
|
-
to:
|
|
4444
|
+
from: path7.resolve(projectDir, operands[0]),
|
|
4445
|
+
to: path7.resolve(projectDir, operands[1])
|
|
4383
4446
|
});
|
|
4384
4447
|
}
|
|
4385
4448
|
return copies;
|
|
4386
4449
|
}
|
|
4387
4450
|
function fileListEntries(file, absolute) {
|
|
4388
|
-
return
|
|
4451
|
+
return fs7.readFileSync(file, "utf8").split(/\r?\n/).map((line) => line.trim()).filter((line) => line !== "" && !line.startsWith("#")).map(absolute);
|
|
4389
4452
|
}
|
|
4390
4453
|
function targetMembers(ref, settings, options2, settingKeys, projectInputs) {
|
|
4391
4454
|
const { project, target, id: targetId } = ref;
|
|
@@ -4399,17 +4462,17 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs) {
|
|
|
4399
4462
|
const copiedFiles = [];
|
|
4400
4463
|
let generatedInfoPlist = false;
|
|
4401
4464
|
const declaredInfoPlist = settings("INFOPLIST_FILE");
|
|
4402
|
-
const infoPlistOutput = declaredInfoPlist ?
|
|
4465
|
+
const infoPlistOutput = declaredInfoPlist ? path7.resolve(project.projectDir, declaredInfoPlist) : null;
|
|
4403
4466
|
const isPreparedOutput = (file) => file === infoPlistOutput || options2.requireSources !== false && file.endsWith(".swift");
|
|
4404
4467
|
let absentSources = false;
|
|
4405
4468
|
if (options2.prepareGeneratedSources === true && options2.requireSources !== false)
|
|
4406
4469
|
project.visitMembers(
|
|
4407
4470
|
targetId,
|
|
4408
|
-
xcodePathResolver(project.objects, project.projectDir,
|
|
4409
|
-
(file) => isDirectory(file) ? walkFiles(file) :
|
|
4410
|
-
|
|
4471
|
+
xcodePathResolver(project.objects, project.projectDir, path7.join, settings),
|
|
4472
|
+
(file) => isDirectory(file) ? walkFiles(file) : fs7.existsSync(file) ? [file] : [],
|
|
4473
|
+
path7.join,
|
|
4411
4474
|
(file, kind) => {
|
|
4412
|
-
if (kind !== "header" && kind !== "resource" && !
|
|
4475
|
+
if (kind !== "header" && kind !== "resource" && !fs7.existsSync(file))
|
|
4413
4476
|
absentSources = true;
|
|
4414
4477
|
}
|
|
4415
4478
|
);
|
|
@@ -4428,7 +4491,7 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs) {
|
|
|
4428
4491
|
copiedFiles.push(
|
|
4429
4492
|
...shellCopies(str(phase.shellScript) ?? "", settings, project.projectDir)
|
|
4430
4493
|
);
|
|
4431
|
-
const absolute = (raw) =>
|
|
4494
|
+
const absolute = (raw) => path7.resolve(project.projectDir, expand(raw, settings));
|
|
4432
4495
|
const inputs = list(phase.inputPaths).map(absolute);
|
|
4433
4496
|
const outputs = list(phase.outputPaths).map(absolute);
|
|
4434
4497
|
const fileLists = /* @__PURE__ */ new Map();
|
|
@@ -4437,7 +4500,7 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs) {
|
|
|
4437
4500
|
kind === "INPUT" ? phase.inputFileListPaths : phase.outputFileListPaths
|
|
4438
4501
|
).map((raw) => {
|
|
4439
4502
|
const file = absolute(raw);
|
|
4440
|
-
if (!
|
|
4503
|
+
if (!fs7.existsSync(file)) {
|
|
4441
4504
|
return { file, entries: [] };
|
|
4442
4505
|
}
|
|
4443
4506
|
return { file, entries: fileListEntries(file, absolute) };
|
|
@@ -4458,14 +4521,14 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs) {
|
|
|
4458
4521
|
...fileLists.get("OUTPUT").map((item) => item.file)
|
|
4459
4522
|
];
|
|
4460
4523
|
if (allOutputs.some((file) => file.endsWith(".swift") || file === infoPlistOutput)) {
|
|
4461
|
-
for (const file of inputFiles) if (
|
|
4524
|
+
for (const file of inputFiles) if (fs7.existsSync(file)) projectInputs.add(file);
|
|
4462
4525
|
}
|
|
4463
4526
|
const undeclaredGenerator = absentSources && beforeSources && allOutputs.length === 0 && str(phase.runOnlyForDeploymentPostprocessing) !== "1";
|
|
4464
4527
|
if (options2.prepareGeneratedSources === true && (allOutputs.some(isPreparedOutput) || undeclaredGenerator)) {
|
|
4465
|
-
const phaseDir =
|
|
4528
|
+
const phaseDir = path7.join(settings("TARGET_TEMP_DIR"), `Script-${phaseId}`);
|
|
4466
4529
|
for (const lists of fileLists.values())
|
|
4467
4530
|
for (const { file } of lists)
|
|
4468
|
-
if (!
|
|
4531
|
+
if (!fs7.existsSync(file))
|
|
4469
4532
|
throw new Error(
|
|
4470
4533
|
`${targetName}: Run Script "${script}" missing file list ${file}`
|
|
4471
4534
|
);
|
|
@@ -4484,7 +4547,7 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs) {
|
|
|
4484
4547
|
const lists = fileLists.get(kind);
|
|
4485
4548
|
env[`SCRIPT_${kind}_FILE_LIST_COUNT`] = String(lists.length);
|
|
4486
4549
|
lists.forEach((_item, index) => {
|
|
4487
|
-
env[`SCRIPT_${kind}_FILE_LIST_${index}`] =
|
|
4550
|
+
env[`SCRIPT_${kind}_FILE_LIST_${index}`] = path7.join(
|
|
4488
4551
|
phaseDir,
|
|
4489
4552
|
`${kind}-${index}.xcfilelist`
|
|
4490
4553
|
);
|
|
@@ -4495,22 +4558,22 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs) {
|
|
|
4495
4558
|
);
|
|
4496
4559
|
for (const file of inputFiles) {
|
|
4497
4560
|
signature.update(file);
|
|
4498
|
-
if (
|
|
4499
|
-
const stat =
|
|
4561
|
+
if (fs7.existsSync(file)) {
|
|
4562
|
+
const stat = fs7.statSync(file);
|
|
4500
4563
|
signature.update(`${stat.mtimeMs}:${stat.ctimeMs}:${stat.size}`);
|
|
4501
4564
|
} else signature.update("missing");
|
|
4502
4565
|
}
|
|
4503
4566
|
const stamp = signature.digest("hex");
|
|
4504
4567
|
const key = `${project.projectFile}:${targetId}:${phaseId}:${settings("CONFIGURATION")}`;
|
|
4505
|
-
if (preparedSourcePhases.get(key) === stamp && allOutputs.every((file) =>
|
|
4568
|
+
if (preparedSourcePhases.get(key) === stamp && allOutputs.every((file) => fs7.existsSync(file)))
|
|
4506
4569
|
continue;
|
|
4507
|
-
|
|
4570
|
+
fs7.mkdirSync(phaseDir, { recursive: true });
|
|
4508
4571
|
if (process.platform === "linux") {
|
|
4509
4572
|
const bin = swiftToolchainBin(
|
|
4510
4573
|
privateSwiftRelease() ?? swiftNativePin().distribution.release
|
|
4511
4574
|
);
|
|
4512
|
-
const startup =
|
|
4513
|
-
|
|
4575
|
+
const startup = path7.join(phaseDir, "peach-tools.sh");
|
|
4576
|
+
fs7.writeFileSync(
|
|
4514
4577
|
startup,
|
|
4515
4578
|
'if [[ -n "$PEACH_PHASE_BASH_ENV" ]]; then source "$PEACH_PHASE_BASH_ENV"; fi\nexport PATH="$PEACH_PHASE_TOOLCHAIN:$PATH"\n'
|
|
4516
4579
|
);
|
|
@@ -4519,15 +4582,15 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs) {
|
|
|
4519
4582
|
env.PEACH_PHASE_TOOLCHAIN = bin;
|
|
4520
4583
|
env.PEACH_PHASE_BASH_ENV = env.BASH_ENV;
|
|
4521
4584
|
env.BASH_ENV = startup;
|
|
4522
|
-
env.PATH = [bin, env.PATH].filter(Boolean).join(
|
|
4585
|
+
env.PATH = [bin, env.PATH].filter(Boolean).join(path7.delimiter);
|
|
4523
4586
|
}
|
|
4524
|
-
|
|
4525
|
-
|
|
4587
|
+
fs7.mkdirSync(settings("BUILT_PRODUCTS_DIR"), { recursive: true });
|
|
4588
|
+
fs7.mkdirSync(settings("DERIVED_FILE_DIR"), { recursive: true });
|
|
4526
4589
|
for (const output of allOutputs)
|
|
4527
|
-
|
|
4590
|
+
fs7.mkdirSync(path7.dirname(output), { recursive: true });
|
|
4528
4591
|
for (const [kind, lists] of fileLists)
|
|
4529
4592
|
lists.forEach((item, index) => {
|
|
4530
|
-
|
|
4593
|
+
fs7.writeFileSync(
|
|
4531
4594
|
env[`SCRIPT_${kind}_FILE_LIST_${index}`],
|
|
4532
4595
|
`${item.entries.join("\n")}
|
|
4533
4596
|
`
|
|
@@ -4535,9 +4598,9 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs) {
|
|
|
4535
4598
|
});
|
|
4536
4599
|
const rawScript = str(phase.shellScript) ?? "";
|
|
4537
4600
|
if (rawScript.includes("generate-modules-provider")) {
|
|
4538
|
-
const preloadPath =
|
|
4539
|
-
|
|
4540
|
-
|
|
4601
|
+
const preloadPath = path7.join(phaseDir, "expo-scan-timeout.cjs");
|
|
4602
|
+
fs7.mkdirSync(phaseDir, { recursive: true });
|
|
4603
|
+
fs7.writeFileSync(
|
|
4541
4604
|
preloadPath,
|
|
4542
4605
|
[
|
|
4543
4606
|
"const cp = require('node:child_process');",
|
|
@@ -4575,7 +4638,7 @@ ${output}`
|
|
|
4575
4638
|
);
|
|
4576
4639
|
}
|
|
4577
4640
|
const missing = allOutputs.filter(
|
|
4578
|
-
(file) => file === infoPlistOutput && !
|
|
4641
|
+
(file) => file === infoPlistOutput && !fs7.existsSync(file)
|
|
4579
4642
|
);
|
|
4580
4643
|
if (missing.length > 0)
|
|
4581
4644
|
throw new Error(
|
|
@@ -4586,9 +4649,9 @@ ${output}`
|
|
|
4586
4649
|
}
|
|
4587
4650
|
project.visitMembers(
|
|
4588
4651
|
targetId,
|
|
4589
|
-
xcodePathResolver(project.objects, project.projectDir,
|
|
4590
|
-
(file) => isDirectory(file) ? walkFiles(file) :
|
|
4591
|
-
|
|
4652
|
+
xcodePathResolver(project.objects, project.projectDir, path7.join, settings),
|
|
4653
|
+
(file) => isDirectory(file) ? walkFiles(file) : fs7.existsSync(file) ? [file] : [],
|
|
4654
|
+
path7.join,
|
|
4592
4655
|
(file, kind, bundleName) => {
|
|
4593
4656
|
if (kind === "header") {
|
|
4594
4657
|
headers.add(file);
|
|
@@ -4599,9 +4662,9 @@ ${output}`
|
|
|
4599
4662
|
if (bundleName) resourceNames[file] = bundleName;
|
|
4600
4663
|
return;
|
|
4601
4664
|
}
|
|
4602
|
-
if (!
|
|
4665
|
+
if (!fs7.existsSync(file)) {
|
|
4603
4666
|
if (options2.requireSources === false) return;
|
|
4604
|
-
const script = scriptForOutput.get(
|
|
4667
|
+
const script = scriptForOutput.get(path7.normalize(file));
|
|
4605
4668
|
throw new Error(
|
|
4606
4669
|
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}`
|
|
4607
4670
|
);
|
|
@@ -4612,21 +4675,21 @@ ${output}`
|
|
|
4612
4675
|
);
|
|
4613
4676
|
if (options2.prepareGeneratedSources && options2.requireSources !== false) {
|
|
4614
4677
|
const interfaceFiles = [...resources].filter(
|
|
4615
|
-
(file) => /\.(storyboard|xib)$/.test(file) && !file.split(
|
|
4678
|
+
(file) => /\.(storyboard|xib)$/.test(file) && !file.split(path7.sep).some((part) => part.endsWith(".bundle"))
|
|
4616
4679
|
);
|
|
4617
4680
|
let launchName = settings("INFOPLIST_KEY_UILaunchStoryboardName");
|
|
4618
|
-
if (process.platform !== "darwin" && !launchName && infoPlistOutput &&
|
|
4619
|
-
const info = parsePlist(
|
|
4681
|
+
if (process.platform !== "darwin" && !launchName && infoPlistOutput && fs7.existsSync(infoPlistOutput)) {
|
|
4682
|
+
const info = parsePlist(fs7.readFileSync(infoPlistOutput, "utf8"));
|
|
4620
4683
|
const declared = isRecord(info) ? info.UILaunchStoryboardName : void 0;
|
|
4621
4684
|
if (typeof declared === "string") launchName = expand(declared, settings);
|
|
4622
4685
|
}
|
|
4623
4686
|
const interfaceOutputs = /* @__PURE__ */ new Set();
|
|
4624
4687
|
for (const file of interfaceFiles) {
|
|
4625
|
-
const localization = file.split(
|
|
4688
|
+
const localization = file.split(path7.sep).findLast((part) => part.endsWith(".lproj")) ?? "";
|
|
4626
4689
|
const isStoryboard = file.endsWith(".storyboard");
|
|
4627
4690
|
const extension = isStoryboard ? ".storyboardc" : ".nib";
|
|
4628
|
-
const name =
|
|
4629
|
-
const output =
|
|
4691
|
+
const name = path7.basename(file, path7.extname(file));
|
|
4692
|
+
const output = path7.join(
|
|
4630
4693
|
settings("DERIVED_FILE_DIR"),
|
|
4631
4694
|
"InterfaceBuilder",
|
|
4632
4695
|
localization,
|
|
@@ -4645,10 +4708,10 @@ ${output}`
|
|
|
4645
4708
|
const inputs = JSON.stringify([
|
|
4646
4709
|
1,
|
|
4647
4710
|
args,
|
|
4648
|
-
createHash7("sha256").update(
|
|
4711
|
+
createHash7("sha256").update(fs7.readFileSync(file)).digest("hex")
|
|
4649
4712
|
]);
|
|
4650
4713
|
const developer = settings("DEVELOPER_DIR");
|
|
4651
|
-
const cached =
|
|
4714
|
+
const cached = fs7.existsSync(output) && fs7.existsSync(stamp) ? fs7.readFileSync(stamp, "utf8").split("\n") : [];
|
|
4652
4715
|
projectInputs.add(file);
|
|
4653
4716
|
resources.delete(file);
|
|
4654
4717
|
if (cached[0] !== inputs || process.platform === "darwin" && cached[1] !== developer) {
|
|
@@ -4658,15 +4721,15 @@ ${output}`
|
|
|
4658
4721
|
`${targetName}: Interface Builder compilation requires macOS and Xcode`
|
|
4659
4722
|
);
|
|
4660
4723
|
}
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4724
|
+
fs7.rmSync(output, { recursive: true, force: true });
|
|
4725
|
+
fs7.rmSync(stamp, { force: true });
|
|
4726
|
+
fs7.mkdirSync(path7.dirname(output), { recursive: true });
|
|
4664
4727
|
execFileSync2("xcrun", ["ibtool", "--compile", output, file, ...args], {
|
|
4665
4728
|
cwd: project.projectDir,
|
|
4666
4729
|
stdio: ["ignore", "pipe", "pipe"],
|
|
4667
4730
|
timeout: runScriptTimeoutMs
|
|
4668
4731
|
});
|
|
4669
|
-
|
|
4732
|
+
fs7.writeFileSync(stamp, `${inputs}
|
|
4670
4733
|
${developer}
|
|
4671
4734
|
`);
|
|
4672
4735
|
}
|
|
@@ -4708,34 +4771,34 @@ ${developer}
|
|
|
4708
4771
|
function commonAncestor(dirs) {
|
|
4709
4772
|
let common = dirs[0];
|
|
4710
4773
|
for (const dir of dirs) {
|
|
4711
|
-
while (common !==
|
|
4712
|
-
common =
|
|
4774
|
+
while (common !== path7.dirname(common) && path7.relative(common, dir).startsWith(".."))
|
|
4775
|
+
common = path7.dirname(common);
|
|
4713
4776
|
}
|
|
4714
4777
|
return common;
|
|
4715
4778
|
}
|
|
4716
|
-
var isPodsProject = (xcodeproj) =>
|
|
4779
|
+
var isPodsProject = (xcodeproj) => path7.basename(xcodeproj) === "Pods.xcodeproj" && path7.basename(path7.dirname(xcodeproj)) === "Pods";
|
|
4717
4780
|
function installedPodsSandbox(pods) {
|
|
4718
|
-
const podfileLock =
|
|
4719
|
-
const manifestLock =
|
|
4720
|
-
if (!
|
|
4781
|
+
const podfileLock = path7.join(path7.dirname(pods), "Podfile.lock");
|
|
4782
|
+
const manifestLock = path7.join(pods, "Manifest.lock");
|
|
4783
|
+
if (!fs7.existsSync(podfileLock))
|
|
4721
4784
|
throw new Error(
|
|
4722
|
-
`${pods} has no ${podfileLock}: run \`pod install\` in ${
|
|
4785
|
+
`${pods} has no ${podfileLock}: run \`pod install\` in ${path7.dirname(pods)}`
|
|
4723
4786
|
);
|
|
4724
|
-
if (!
|
|
4787
|
+
if (!fs7.existsSync(manifestLock) || !fs7.readFileSync(manifestLock).equals(fs7.readFileSync(podfileLock)))
|
|
4725
4788
|
throw new Error(
|
|
4726
|
-
`The sandbox is not in sync with the Podfile.lock: ${manifestLock} differs from ${podfileLock}. Run \`pod install\` in ${
|
|
4789
|
+
`The sandbox is not in sync with the Podfile.lock: ${manifestLock} differs from ${podfileLock}. Run \`pod install\` in ${path7.dirname(pods)}`
|
|
4727
4790
|
);
|
|
4728
4791
|
const specChecksums = {};
|
|
4729
|
-
const lines =
|
|
4792
|
+
const lines = fs7.readFileSync(manifestLock, "utf8").split("\n");
|
|
4730
4793
|
const start = lines.indexOf("SPEC CHECKSUMS:");
|
|
4731
4794
|
for (const line of start === -1 ? [] : lines.slice(start + 1)) {
|
|
4732
4795
|
const entry = /^ {2}"?([^":]+)"?: ([0-9a-f]+)$/.exec(line);
|
|
4733
4796
|
if (!entry) break;
|
|
4734
4797
|
specChecksums[entry[1]] = entry[2];
|
|
4735
4798
|
}
|
|
4736
|
-
const specs =
|
|
4737
|
-
const generated =
|
|
4738
|
-
if (
|
|
4799
|
+
const specs = path7.join(pods, "Local Podspecs");
|
|
4800
|
+
const generated = path7.join(pods, POD_GRAPH_SPECIFICATIONS);
|
|
4801
|
+
if (fs7.existsSync(generated))
|
|
4739
4802
|
return {
|
|
4740
4803
|
podfileLock,
|
|
4741
4804
|
manifestLock,
|
|
@@ -4743,15 +4806,15 @@ function installedPodsSandbox(pods) {
|
|
|
4743
4806
|
localPodspecs: readPodGraphSpecifications(generated),
|
|
4744
4807
|
specificationFiles: [generated]
|
|
4745
4808
|
};
|
|
4746
|
-
const specificationFiles = isDirectory(specs) ?
|
|
4809
|
+
const specificationFiles = isDirectory(specs) ? fs7.readdirSync(specs).filter((name) => name.endsWith(".podspec.json")).sort().map((name) => path7.join(specs, name)) : [];
|
|
4747
4810
|
return {
|
|
4748
4811
|
podfileLock,
|
|
4749
4812
|
manifestLock,
|
|
4750
4813
|
specChecksums,
|
|
4751
4814
|
localPodspecs: new Map(
|
|
4752
4815
|
specificationFiles.map((file) => [
|
|
4753
|
-
|
|
4754
|
-
|
|
4816
|
+
path7.basename(file, ".podspec.json"),
|
|
4817
|
+
fs7.readFileSync(file, "utf8")
|
|
4755
4818
|
])
|
|
4756
4819
|
),
|
|
4757
4820
|
specificationFiles
|
|
@@ -4766,14 +4829,14 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
|
|
|
4766
4829
|
if (!xcodeProjectFile(xcodeproj)) {
|
|
4767
4830
|
if (installedPods && isPodsProject(xcodeproj))
|
|
4768
4831
|
throw new Error(
|
|
4769
|
-
`${
|
|
4832
|
+
`${path7.basename(xcodeprojOrWorkspace)} builds ${xcodeproj}, which is not installed: run \`pod install\` in ${path7.dirname(path7.dirname(xcodeproj))}`
|
|
4770
4833
|
);
|
|
4771
4834
|
return;
|
|
4772
4835
|
}
|
|
4773
|
-
const key =
|
|
4774
|
-
if (projectAt.has(key) || !installedPods && key.split(
|
|
4836
|
+
const key = fs7.realpathSync.native(xcodeproj);
|
|
4837
|
+
if (projectAt.has(key) || !installedPods && key.split(path7.sep).includes("Pods"))
|
|
4775
4838
|
return;
|
|
4776
|
-
if (isPodsProject(key)) cocoapods = installedPodsSandbox(
|
|
4839
|
+
if (isPodsProject(key)) cocoapods = installedPodsSandbox(path7.dirname(key));
|
|
4777
4840
|
const project = loadProject(key);
|
|
4778
4841
|
projectAt.set(key, project);
|
|
4779
4842
|
projects.push(project);
|
|
@@ -4789,12 +4852,12 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
|
|
|
4789
4852
|
for (const reference of listed)
|
|
4790
4853
|
if (reference.endsWith(".xcodeproj")) addProject(reference);
|
|
4791
4854
|
if (projects.length === 0) {
|
|
4792
|
-
throw new Error(`${
|
|
4855
|
+
throw new Error(`${path7.basename(xcodeprojOrWorkspace)} lists no Xcode project`);
|
|
4793
4856
|
}
|
|
4794
|
-
const podfile =
|
|
4795
|
-
if (installedPods && !cocoapods &&
|
|
4857
|
+
const podfile = path7.join(path7.dirname(xcodeprojOrWorkspace), "Podfile");
|
|
4858
|
+
if (installedPods && !cocoapods && fs7.existsSync(podfile))
|
|
4796
4859
|
throw new Error(
|
|
4797
|
-
`${podfile} is not installed into ${
|
|
4860
|
+
`${podfile} is not installed into ${path7.basename(xcodeprojOrWorkspace)}: run \`pod install\` in ${path7.dirname(podfile)} and open the workspace it writes`
|
|
4798
4861
|
);
|
|
4799
4862
|
return { listed, projects, projectAt, cocoapods };
|
|
4800
4863
|
}
|
|
@@ -4832,7 +4895,7 @@ function listXcodeAppTargets(xcodeprojOrWorkspace, options2 = {}) {
|
|
|
4832
4895
|
return workspaceProjects(xcodeprojOrWorkspace).projects.flatMap(projectTargets).filter((ref) => isIosAppTarget(ref, options2)).map((ref) => str(ref.target.name) ?? ref.id);
|
|
4833
4896
|
}
|
|
4834
4897
|
function defaultXcodeAppTarget(xcodeproj) {
|
|
4835
|
-
const project = loadProject(
|
|
4898
|
+
const project = loadProject(fs7.realpathSync.native(xcodeproj));
|
|
4836
4899
|
for (const [id, target] of Object.entries(project.objects)) {
|
|
4837
4900
|
if (!isDict(target) || target.isa !== "PBXNativeTarget") continue;
|
|
4838
4901
|
if (isIosAppTarget({ project, id, target }, { requireSources: false }))
|
|
@@ -4840,30 +4903,30 @@ function defaultXcodeAppTarget(xcodeproj) {
|
|
|
4840
4903
|
}
|
|
4841
4904
|
}
|
|
4842
4905
|
function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
4843
|
-
const container =
|
|
4906
|
+
const container = fs7.realpathSync.native(xcodeprojOrWorkspace);
|
|
4844
4907
|
const { projects } = workspaceProjects(container);
|
|
4845
4908
|
const containers = [
|
|
4846
4909
|
.../* @__PURE__ */ new Set([container, ...projects.map((project2) => project2.xcodeproj)])
|
|
4847
4910
|
];
|
|
4848
4911
|
const found = containers.flatMap(
|
|
4849
4912
|
(dir) => [
|
|
4850
|
-
|
|
4851
|
-
...isDirectory(
|
|
4913
|
+
path7.join(dir, "xcshareddata"),
|
|
4914
|
+
...isDirectory(path7.join(dir, "xcuserdata")) ? fs7.readdirSync(path7.join(dir, "xcuserdata")).sort().map((user) => path7.join(dir, "xcuserdata", user)) : []
|
|
4852
4915
|
].map((data) => ({
|
|
4853
4916
|
dir,
|
|
4854
|
-
file:
|
|
4917
|
+
file: path7.join(data, "xcschemes", `${scheme}.xcscheme`)
|
|
4855
4918
|
}))
|
|
4856
|
-
).find((candidate) =>
|
|
4919
|
+
).find((candidate) => fs7.existsSync(candidate.file));
|
|
4857
4920
|
if (!found) {
|
|
4858
4921
|
const known = containers.flatMap(
|
|
4859
|
-
(dir) =>
|
|
4922
|
+
(dir) => fs7.existsSync(path7.join(dir, "xcshareddata", "xcschemes")) ? fs7.readdirSync(path7.join(dir, "xcshareddata", "xcschemes")).filter((name2) => name2.endsWith(".xcscheme")).map((name2) => name2.slice(0, -".xcscheme".length)).sort() : []
|
|
4860
4923
|
);
|
|
4861
4924
|
throw new Error(
|
|
4862
|
-
`${
|
|
4925
|
+
`${path7.basename(container)} has no scheme ${scheme}; it shares ${known.join(", ") || "none"}`
|
|
4863
4926
|
);
|
|
4864
4927
|
}
|
|
4865
4928
|
const launch = /<LaunchAction\b([^>]*)>([\s\S]*?)<\/LaunchAction>/.exec(
|
|
4866
|
-
|
|
4929
|
+
fs7.readFileSync(found.file, "utf8")
|
|
4867
4930
|
);
|
|
4868
4931
|
const attribute = (text2, name2) => {
|
|
4869
4932
|
const value = new RegExp(`\\b${name2}\\s*=\\s*"([^"]*)"`).exec(text2)?.[1];
|
|
@@ -4876,12 +4939,12 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
|
4876
4939
|
if (!configuration || !blueprint || !referenced?.startsWith("container:")) {
|
|
4877
4940
|
throw new Error(`scheme ${scheme} runs no application target`);
|
|
4878
4941
|
}
|
|
4879
|
-
const projectPath =
|
|
4880
|
-
|
|
4942
|
+
const projectPath = path7.resolve(
|
|
4943
|
+
path7.dirname(found.dir),
|
|
4881
4944
|
referenced.slice("container:".length)
|
|
4882
4945
|
);
|
|
4883
4946
|
const project = projects.find(
|
|
4884
|
-
(candidate) =>
|
|
4947
|
+
(candidate) => fs7.existsSync(projectPath) && candidate.xcodeproj === fs7.realpathSync.native(projectPath)
|
|
4885
4948
|
);
|
|
4886
4949
|
const target = project && projectTargets(project).find((ref) => ref.id === blueprint);
|
|
4887
4950
|
const name = target && str(target.target.name);
|
|
@@ -4901,26 +4964,26 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
|
4901
4964
|
var NativeAppTargetSelectionError = class extends Error {
|
|
4902
4965
|
};
|
|
4903
4966
|
function selectIosAppTarget(projectRoot, iosTarget) {
|
|
4904
|
-
const nested =
|
|
4905
|
-
const iosRoot =
|
|
4906
|
-
const entries =
|
|
4967
|
+
const nested = path7.join(projectRoot, "ios");
|
|
4968
|
+
const iosRoot = fs7.existsSync(nested) ? nested : projectRoot;
|
|
4969
|
+
const entries = fs7.readdirSync(iosRoot, { withFileTypes: true });
|
|
4907
4970
|
const projects = (entries.some((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj")) ? entries.filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj")).map((entry) => ({
|
|
4908
|
-
xcodeproj:
|
|
4971
|
+
xcodeproj: path7.join(iosRoot, entry.name),
|
|
4909
4972
|
workspace: null
|
|
4910
4973
|
})) : entries.filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcworkspace")).flatMap((entry) => {
|
|
4911
|
-
const workspace =
|
|
4974
|
+
const workspace = path7.join(iosRoot, entry.name);
|
|
4912
4975
|
return workspaceReferences(workspace).map((xcodeproj2) => ({
|
|
4913
4976
|
xcodeproj: xcodeproj2,
|
|
4914
4977
|
workspace
|
|
4915
4978
|
}));
|
|
4916
4979
|
}).filter(
|
|
4917
|
-
({ xcodeproj: xcodeproj2 }) => xcodeproj2.endsWith(".xcodeproj") && !xcodeproj2.split(
|
|
4980
|
+
({ xcodeproj: xcodeproj2 }) => xcodeproj2.endsWith(".xcodeproj") && !xcodeproj2.split(path7.sep).includes("Pods") && fs7.existsSync(xcodeproj2)
|
|
4918
4981
|
).filter(
|
|
4919
4982
|
({ xcodeproj: xcodeproj2 }) => listXcodeAppTargets(xcodeproj2, { requireSources: false }).length > 0
|
|
4920
4983
|
)).map(({ xcodeproj: xcodeproj2, workspace }) => ({
|
|
4921
4984
|
xcodeproj: xcodeproj2,
|
|
4922
4985
|
workspace,
|
|
4923
|
-
name:
|
|
4986
|
+
name: path7.basename(xcodeproj2)
|
|
4924
4987
|
}));
|
|
4925
4988
|
if (projects.length === 0) return null;
|
|
4926
4989
|
if (projects.length > 1 && !iosTarget) {
|
|
@@ -4959,13 +5022,13 @@ function selectIosAppTarget(projectRoot, iosTarget) {
|
|
|
4959
5022
|
if (!target) throw new Error("native app identity has no iOS application target");
|
|
4960
5023
|
if (!iosTarget) {
|
|
4961
5024
|
const workspace = xcodeproj.replace(/\.xcodeproj$/, ".xcworkspace");
|
|
4962
|
-
const container =
|
|
5025
|
+
const container = fs7.existsSync(workspace) ? workspace : xcodeproj;
|
|
4963
5026
|
const hasScheme = [container, xcodeproj].some((dir) => {
|
|
4964
|
-
if (
|
|
5027
|
+
if (fs7.existsSync(path7.join(dir, "xcshareddata", "xcschemes", `${target}.xcscheme`)))
|
|
4965
5028
|
return true;
|
|
4966
|
-
const users =
|
|
4967
|
-
return
|
|
4968
|
-
(user) =>
|
|
5029
|
+
const users = path7.join(dir, "xcuserdata");
|
|
5030
|
+
return fs7.existsSync(users) && fs7.readdirSync(users).some(
|
|
5031
|
+
(user) => fs7.existsSync(path7.join(users, user, "xcschemes", `${target}.xcscheme`))
|
|
4969
5032
|
);
|
|
4970
5033
|
});
|
|
4971
5034
|
if (hasScheme) target = readXcodeScheme(container, target).target;
|
|
@@ -4976,8 +5039,8 @@ function selectIosAppTarget(projectRoot, iosTarget) {
|
|
|
4976
5039
|
);
|
|
4977
5040
|
return { xcodeproj, target, workspace: project.workspace };
|
|
4978
5041
|
}
|
|
4979
|
-
var workspaceResolvedFile = (xcodeprojOrWorkspace) =>
|
|
4980
|
-
xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace :
|
|
5042
|
+
var workspaceResolvedFile = (xcodeprojOrWorkspace) => path7.join(
|
|
5043
|
+
xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : path7.join(xcodeprojOrWorkspace, "project.xcworkspace"),
|
|
4981
5044
|
"xcshareddata",
|
|
4982
5045
|
"swiftpm",
|
|
4983
5046
|
"Package.resolved"
|
|
@@ -4994,7 +5057,7 @@ var SwiftPackageResolutionRequired = class extends Error {
|
|
|
4994
5057
|
function readXcodeAppTarget(input, targetName, configurationName, options2 = {}) {
|
|
4995
5058
|
if (isBazelPackage(input))
|
|
4996
5059
|
return readBazelAppTarget(input, targetName, configurationName, options2);
|
|
4997
|
-
const xcodeprojOrWorkspace =
|
|
5060
|
+
const xcodeprojOrWorkspace = fs7.realpathSync.native(input);
|
|
4998
5061
|
const workspace = xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : null;
|
|
4999
5062
|
const { listed, projects, projectAt, cocoapods } = workspaceProjects(
|
|
5000
5063
|
xcodeprojOrWorkspace,
|
|
@@ -5005,7 +5068,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5005
5068
|
(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
|
|
5006
5069
|
);
|
|
5007
5070
|
const appTargetNames = appTargets.map((ref) => str(ref.target.name) ?? ref.id);
|
|
5008
|
-
const container =
|
|
5071
|
+
const container = path7.basename(xcodeprojOrWorkspace);
|
|
5009
5072
|
const named = targetName ? appTargets.filter((ref) => ref.target.name === targetName) : appTargets;
|
|
5010
5073
|
if (named.length !== 1) {
|
|
5011
5074
|
if (options2.frameworkMachOType)
|
|
@@ -5034,15 +5097,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5034
5097
|
for (const ref of allTargets) {
|
|
5035
5098
|
const product = ref.project.object(str(ref.target.productReference));
|
|
5036
5099
|
const file = str(product?.path);
|
|
5037
|
-
if (file && !byProduct.has(
|
|
5038
|
-
byProduct.set(
|
|
5100
|
+
if (file && !byProduct.has(path7.basename(file)))
|
|
5101
|
+
byProduct.set(path7.basename(file), ref);
|
|
5039
5102
|
}
|
|
5040
5103
|
const proxied = (project, proxyId) => {
|
|
5041
5104
|
const proxy = project.object(proxyId);
|
|
5042
5105
|
if (proxy?.isa !== "PBXContainerItemProxy") return void 0;
|
|
5043
5106
|
const portal = str(proxy.containerPortal);
|
|
5044
5107
|
const portalPath = project.resolvePath(portal ?? "");
|
|
5045
|
-
const owner = project.object(portal)?.isa === "PBXProject" ? project : portalPath &&
|
|
5108
|
+
const owner = project.object(portal)?.isa === "PBXProject" ? project : portalPath && fs7.existsSync(portalPath) ? projectAt.get(fs7.realpathSync.native(portalPath)) : void 0;
|
|
5046
5109
|
const remote = str(proxy.remoteGlobalIDString);
|
|
5047
5110
|
if (!owner || !remote) return void 0;
|
|
5048
5111
|
return projectTargets(owner).find(
|
|
@@ -5059,7 +5122,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5059
5122
|
const buildFile = project.object(buildFileId);
|
|
5060
5123
|
if (!buildFile || !xcodeBuildFileBuildsForIos(buildFile)) continue;
|
|
5061
5124
|
const file = project.object(str(buildFile.fileRef));
|
|
5062
|
-
const resolved = file?.isa === "PBXReferenceProxy" ? proxied(project, str(file.remoteRef)) : file && str(file.sourceTree) === "BUILT_PRODUCTS_DIR" ? byProduct.get(
|
|
5125
|
+
const resolved = file?.isa === "PBXReferenceProxy" ? proxied(project, str(file.remoteRef)) : file && str(file.sourceTree) === "BUILT_PRODUCTS_DIR" ? byProduct.get(path7.basename(str(file.path) ?? "")) : void 0;
|
|
5063
5126
|
if (resolved)
|
|
5064
5127
|
found.push({
|
|
5065
5128
|
target: resolved,
|
|
@@ -5140,7 +5203,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5140
5203
|
const otherProduct = productName(other);
|
|
5141
5204
|
for (const { file, visibility } of headerPhase(other)) {
|
|
5142
5205
|
if (visibility === "Project") continue;
|
|
5143
|
-
const key = `${otherProduct}/${
|
|
5206
|
+
const key = `${otherProduct}/${path7.basename(file)}`;
|
|
5144
5207
|
if (!headers.has(key)) headers.set(key, file);
|
|
5145
5208
|
}
|
|
5146
5209
|
}
|
|
@@ -5170,8 +5233,8 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5170
5233
|
ref.project.visitMembers(
|
|
5171
5234
|
ref.id,
|
|
5172
5235
|
ref.project.resolvePath,
|
|
5173
|
-
(file) => isDirectory(file) ? walkFiles(file) :
|
|
5174
|
-
|
|
5236
|
+
(file) => isDirectory(file) ? walkFiles(file) : fs7.existsSync(file) ? [file] : [],
|
|
5237
|
+
path7.join,
|
|
5175
5238
|
(file, kind) => {
|
|
5176
5239
|
if (kind === "header") found.push(file);
|
|
5177
5240
|
}
|
|
@@ -5187,12 +5250,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5187
5250
|
for (const ref of projectTargets(project)) {
|
|
5188
5251
|
const product = productName(ref);
|
|
5189
5252
|
for (const { file, visibility } of headerPhase(ref)) {
|
|
5190
|
-
const name =
|
|
5253
|
+
const name = path7.basename(file);
|
|
5191
5254
|
if (!entries.has(name))
|
|
5192
5255
|
entries.set(name, visibility !== "Project" ? `${product}/${name}` : file);
|
|
5193
5256
|
}
|
|
5194
5257
|
for (const file of synchronizedHeaders(ref)) {
|
|
5195
|
-
const name =
|
|
5258
|
+
const name = path7.basename(file);
|
|
5196
5259
|
if (!entries.has(name)) entries.set(name, file);
|
|
5197
5260
|
}
|
|
5198
5261
|
}
|
|
@@ -5202,7 +5265,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5202
5265
|
if (folder === null) continue;
|
|
5203
5266
|
for (const file of walkFiles(folder)) {
|
|
5204
5267
|
if (!HEADER_FILE.test(file)) continue;
|
|
5205
|
-
const name =
|
|
5268
|
+
const name = path7.basename(file);
|
|
5206
5269
|
if (!entries.has(name)) entries.set(name, file);
|
|
5207
5270
|
}
|
|
5208
5271
|
}
|
|
@@ -5210,18 +5273,18 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5210
5273
|
for (const id of Object.keys(project.objects)) {
|
|
5211
5274
|
if (project.object(id)?.isa !== "PBXFileReference") continue;
|
|
5212
5275
|
const file = project.resolvePath(id);
|
|
5213
|
-
if (file && HEADER_FILE.test(file) && !entries.has(
|
|
5214
|
-
entries.set(
|
|
5276
|
+
if (file && HEADER_FILE.test(file) && !entries.has(path7.basename(file)))
|
|
5277
|
+
entries.set(path7.basename(file), file);
|
|
5215
5278
|
}
|
|
5216
5279
|
const map = [...entries];
|
|
5217
5280
|
projectHeaderMaps.set(project, map);
|
|
5218
5281
|
return map;
|
|
5219
5282
|
};
|
|
5220
5283
|
const xcconfigs = /* @__PURE__ */ new Set();
|
|
5221
|
-
const buildDir = (project) =>
|
|
5284
|
+
const buildDir = (project) => path7.join(project.projectDir, ".build/peach-xcode/Build");
|
|
5222
5285
|
const workspaceBuild = {
|
|
5223
|
-
SYMROOT:
|
|
5224
|
-
OBJROOT:
|
|
5286
|
+
SYMROOT: path7.join(buildDir(app.project), "Products"),
|
|
5287
|
+
OBJROOT: path7.join(buildDir(app.project), "Intermediates.noindex")
|
|
5225
5288
|
};
|
|
5226
5289
|
const moduleTarget = (ref) => {
|
|
5227
5290
|
const name = str(ref.target.name) ?? ref.id;
|
|
@@ -5237,16 +5300,16 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5237
5300
|
TARGET_NAME: name,
|
|
5238
5301
|
TARGETNAME: "$(TARGET_NAME)",
|
|
5239
5302
|
PROJECT: "$(PROJECT_NAME)",
|
|
5240
|
-
PROJECT_NAME:
|
|
5303
|
+
PROJECT_NAME: path7.basename(ref.project.xcodeproj, ".xcodeproj"),
|
|
5241
5304
|
PROJECT_CLASS_PREFIX: isDict(ref.project.project.attributes) ? str(ref.project.project.attributes.CLASSPREFIX) ?? "" : "",
|
|
5242
5305
|
PROJECT_FILE_PATH: ref.project.xcodeproj,
|
|
5243
5306
|
SRCROOT: ref.project.projectDir,
|
|
5244
5307
|
SOURCE_ROOT: ref.project.projectDir,
|
|
5245
5308
|
PROJECT_DIR: ref.project.projectDir,
|
|
5246
|
-
SYMROOT:
|
|
5309
|
+
SYMROOT: path7.join(buildDir(ref.project), "Products"),
|
|
5247
5310
|
BUILD_DIR: "$(SYMROOT)",
|
|
5248
5311
|
BUILD_ROOT: "$(SYMROOT)",
|
|
5249
|
-
OBJROOT:
|
|
5312
|
+
OBJROOT: path7.join(buildDir(ref.project), "Intermediates.noindex"),
|
|
5250
5313
|
CONFIGURATION_BUILD_DIR: "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)",
|
|
5251
5314
|
BUILT_PRODUCTS_DIR: "$(CONFIGURATION_BUILD_DIR)",
|
|
5252
5315
|
TARGET_BUILD_DIR: "$(CONFIGURATION_BUILD_DIR)",
|
|
@@ -5295,7 +5358,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5295
5358
|
xcconfigs
|
|
5296
5359
|
);
|
|
5297
5360
|
const searchRules = recursiveSearchRules(settings2);
|
|
5298
|
-
const absolute = (file) =>
|
|
5361
|
+
const absolute = (file) => path7.resolve(ref.project.projectDir, file);
|
|
5299
5362
|
const framework = FRAMEWORK_PRODUCTS.has(str(ref.target.productType) ?? "");
|
|
5300
5363
|
const product = settings2("PRODUCT_NAME");
|
|
5301
5364
|
const moduleName = applyOperator(settings2("PRODUCT_MODULE_NAME"), "c99extidentifier");
|
|
@@ -5326,7 +5389,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5326
5389
|
`${name}: Swift compatibility header phase has no Swift producer sources`
|
|
5327
5390
|
);
|
|
5328
5391
|
const building = options2.prepareGeneratedSources && options2.requireSources !== false;
|
|
5329
|
-
const versioning = building && allSources.length > 0 && settings2("VERSIONING_SYSTEM") === "apple-generic" ?
|
|
5392
|
+
const versioning = building && allSources.length > 0 && settings2("VERSIONING_SYSTEM") === "apple-generic" ? path7.join(settings2("DERIVED_FILE_DIR"), `${product}_vers.c`) : null;
|
|
5330
5393
|
if (versioning) {
|
|
5331
5394
|
const version = settings2("CURRENT_PROJECT_VERSION");
|
|
5332
5395
|
const custom = [
|
|
@@ -5339,7 +5402,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5339
5402
|
].filter((key) => settings2(key));
|
|
5340
5403
|
if (custom.length)
|
|
5341
5404
|
throw new Error(
|
|
5342
|
-
`${name}: Xcode generates ${
|
|
5405
|
+
`${name}: Xcode generates ${path7.basename(versioning)} with ${custom.join(", ")}; peach does not model VERSION_INFO_* overrides`
|
|
5343
5406
|
);
|
|
5344
5407
|
const symbol = product.replace(/^[^A-Za-z_]/, "_").replace(/[^A-Za-z0-9_]/g, "_");
|
|
5345
5408
|
const [major, minor] = version.split(".");
|
|
@@ -5352,9 +5415,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5352
5415
|
` const double ${symbol}VersionNumber __attribute__ ((used)) = (double)${number};`,
|
|
5353
5416
|
""
|
|
5354
5417
|
].join("\n");
|
|
5355
|
-
if (!
|
|
5356
|
-
|
|
5357
|
-
|
|
5418
|
+
if (!fs7.existsSync(versioning) || fs7.readFileSync(versioning, "utf8") !== unit) {
|
|
5419
|
+
fs7.mkdirSync(path7.dirname(versioning), { recursive: true });
|
|
5420
|
+
fs7.writeFileSync(versioning, unit);
|
|
5358
5421
|
}
|
|
5359
5422
|
allSources.push(versioning);
|
|
5360
5423
|
}
|
|
@@ -5373,7 +5436,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5373
5436
|
const headerFiles = headerPhase(ref);
|
|
5374
5437
|
const ownHeaders = /* @__PURE__ */ new Map();
|
|
5375
5438
|
for (const { file, visibility } of headerFiles) {
|
|
5376
|
-
const name2 =
|
|
5439
|
+
const name2 = path7.basename(file);
|
|
5377
5440
|
const published = visibility !== "Project";
|
|
5378
5441
|
if (!ownHeaders.has(name2))
|
|
5379
5442
|
ownHeaders.set(name2, published ? `${product}/${name2}` : file);
|
|
@@ -5381,35 +5444,35 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5381
5444
|
ownHeaders.set(`${product}/${name2}`, file);
|
|
5382
5445
|
}
|
|
5383
5446
|
for (const file of synchronizedHeaders(ref)) {
|
|
5384
|
-
const name2 =
|
|
5447
|
+
const name2 = path7.basename(file);
|
|
5385
5448
|
if (ownHeaders.has(name2)) continue;
|
|
5386
5449
|
ownHeaders.set(name2, file);
|
|
5387
5450
|
const qualified = `${product}/${name2}`;
|
|
5388
5451
|
if (!ownHeaders.has(qualified)) ownHeaders.set(qualified, file);
|
|
5389
5452
|
}
|
|
5390
5453
|
const nonFrameworkHeaders = nonFrameworkHeadersOf(ref.project);
|
|
5391
|
-
const wrapper =
|
|
5392
|
-
const publicHeaders =
|
|
5454
|
+
const wrapper = path7.join(settings2("BUILT_PRODUCTS_DIR"), `${product}.framework`);
|
|
5455
|
+
const publicHeaders = path7.resolve(
|
|
5393
5456
|
settings2("BUILT_PRODUCTS_DIR"),
|
|
5394
|
-
settings2("PUBLIC_HEADERS_FOLDER_PATH") ||
|
|
5457
|
+
settings2("PUBLIC_HEADERS_FOLDER_PATH") || path7.join(wrapper, "Headers")
|
|
5395
5458
|
);
|
|
5396
|
-
const privateHeaders =
|
|
5459
|
+
const privateHeaders = path7.resolve(
|
|
5397
5460
|
settings2("BUILT_PRODUCTS_DIR"),
|
|
5398
|
-
settings2("PRIVATE_HEADERS_FOLDER_PATH") ||
|
|
5461
|
+
settings2("PRIVATE_HEADERS_FOLDER_PATH") || path7.join(wrapper, "PrivateHeaders")
|
|
5399
5462
|
);
|
|
5400
5463
|
const moduleMap = (settings2("DEFINES_MODULE") === "YES" || !framework) && settings2("MODULEMAP_FILE") ? absolute(settings2("MODULEMAP_FILE")) : null;
|
|
5401
|
-
const frameworkUmbrella = !compatibility && framework && members.sources.length > 0 && moduleMap ?
|
|
5402
|
-
const frameworkCompatibility = frameworkUmbrella && moduleMap &&
|
|
5464
|
+
const frameworkUmbrella = !compatibility && framework && members.sources.length > 0 && moduleMap ? path7.join(path7.dirname(moduleMap), `${moduleName}-umbrella.h`) : null;
|
|
5465
|
+
const frameworkCompatibility = frameworkUmbrella && moduleMap && fs7.existsSync(moduleMap) && fs7.existsSync(frameworkUmbrella) ? {
|
|
5403
5466
|
framework: true,
|
|
5404
5467
|
moduleMap,
|
|
5405
5468
|
umbrella: frameworkUmbrella,
|
|
5406
|
-
outputModuleMap:
|
|
5407
|
-
outputUmbrella:
|
|
5469
|
+
outputModuleMap: path7.join(wrapper, "Modules", "module.modulemap"),
|
|
5470
|
+
outputUmbrella: path7.join(
|
|
5408
5471
|
wrapper,
|
|
5409
5472
|
"Headers",
|
|
5410
|
-
|
|
5473
|
+
path7.basename(frameworkUmbrella)
|
|
5411
5474
|
),
|
|
5412
|
-
outputHeader:
|
|
5475
|
+
outputHeader: path7.join(
|
|
5413
5476
|
wrapper,
|
|
5414
5477
|
"Headers",
|
|
5415
5478
|
settings2("SWIFT_OBJC_INTERFACE_HEADER_NAME") || `${moduleName}-Swift.h`
|
|
@@ -5423,10 +5486,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5423
5486
|
outputUmbrella: compatibility.outputUmbrella,
|
|
5424
5487
|
outputHeader: compatibility.outputHeader
|
|
5425
5488
|
} : frameworkCompatibility;
|
|
5426
|
-
const podHeaders = !framework && isPodsProject(ref.project.xcodeproj) && moduleMap &&
|
|
5489
|
+
const podHeaders = !framework && isPodsProject(ref.project.xcodeproj) && moduleMap && path7.relative(path7.join(ref.project.projectDir, "Headers", "Public"), moduleMap).split(path7.sep)[0] !== ".." && fs7.existsSync(moduleMap) ? fs7.readdirSync(path7.dirname(moduleMap)).flatMap((entry) => {
|
|
5427
5490
|
if (!/\.(h|hh|hpp|hxx|modulemap)$/.test(entry)) return [];
|
|
5428
|
-
const file =
|
|
5429
|
-
return
|
|
5491
|
+
const file = path7.join(path7.dirname(moduleMap), entry);
|
|
5492
|
+
return fs7.existsSync(file) ? [file] : [];
|
|
5430
5493
|
}) : [];
|
|
5431
5494
|
const fileFlags = {};
|
|
5432
5495
|
for (const phaseId of list(ref.target.buildPhases)) {
|
|
@@ -5512,15 +5575,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5512
5575
|
// xcode searches its products' include directory before
|
|
5513
5576
|
// HEADER_SEARCH_PATHS and the target's derived sources after.
|
|
5514
5577
|
headerSearchPaths: [
|
|
5515
|
-
|
|
5578
|
+
path7.join(settings2("BUILT_PRODUCTS_DIR"), "include"),
|
|
5516
5579
|
...settingList(settings2("HEADER_SEARCH_PATHS")).flatMap(
|
|
5517
5580
|
(raw) => expandSearchPath(absolute(raw), searchRules)
|
|
5518
5581
|
),
|
|
5519
|
-
|
|
5582
|
+
path7.join(
|
|
5520
5583
|
`${settings2("DERIVED_FILE_DIR")}-normal`,
|
|
5521
5584
|
settings2("CURRENT_ARCH")
|
|
5522
5585
|
),
|
|
5523
|
-
|
|
5586
|
+
path7.join(settings2("DERIVED_FILE_DIR"), settings2("CURRENT_ARCH")),
|
|
5524
5587
|
settings2("DERIVED_FILE_DIR")
|
|
5525
5588
|
],
|
|
5526
5589
|
userHeaderSearchPaths: settingList(
|
|
@@ -5570,9 +5633,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5570
5633
|
...headerFiles.flatMap(
|
|
5571
5634
|
({ file, visibility }) => visibility === "Project" ? [] : [
|
|
5572
5635
|
[
|
|
5573
|
-
|
|
5636
|
+
path7.join(
|
|
5574
5637
|
visibility === "Public" ? publicHeaders : privateHeaders,
|
|
5575
|
-
|
|
5638
|
+
path7.basename(file)
|
|
5576
5639
|
),
|
|
5577
5640
|
file
|
|
5578
5641
|
]
|
|
@@ -5594,17 +5657,17 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5594
5657
|
);
|
|
5595
5658
|
return file && HEADER_FILE.test(file) ? [
|
|
5596
5659
|
[
|
|
5597
|
-
|
|
5660
|
+
path7.resolve(
|
|
5598
5661
|
settings2("BUILT_PRODUCTS_DIR"),
|
|
5599
5662
|
destination,
|
|
5600
|
-
|
|
5663
|
+
path7.basename(file)
|
|
5601
5664
|
),
|
|
5602
5665
|
file
|
|
5603
5666
|
]
|
|
5604
5667
|
] : [];
|
|
5605
5668
|
});
|
|
5606
5669
|
}),
|
|
5607
|
-
...moduleMap ? [[
|
|
5670
|
+
...moduleMap ? [[path7.join(wrapper, "Modules", "module.modulemap"), moduleMap]] : []
|
|
5608
5671
|
]) : Object.fromEntries([
|
|
5609
5672
|
...podHeaders.map((file) => [file, file]),
|
|
5610
5673
|
...moduleMap ? [[moduleMap, moduleMap]] : []
|
|
@@ -5615,6 +5678,49 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5615
5678
|
};
|
|
5616
5679
|
};
|
|
5617
5680
|
const builtTargets = order.map((ref) => ({ ref, ...moduleTarget(ref) }));
|
|
5681
|
+
const xcframeworkCopies = builtTargets.flatMap(
|
|
5682
|
+
({ ref, settings: settings2 }) => list(ref.target.buildPhases).flatMap((phaseId) => {
|
|
5683
|
+
const phase = ref.project.object(phaseId);
|
|
5684
|
+
if (phase?.isa !== "PBXShellScriptBuildPhase" || str(phase.name) !== "[CP] Copy XCFrameworks")
|
|
5685
|
+
return [];
|
|
5686
|
+
const absolute = (raw) => path7.resolve(ref.project.projectDir, expand(raw, settings2));
|
|
5687
|
+
const files = (paths, lists) => [
|
|
5688
|
+
...list(paths).map(absolute),
|
|
5689
|
+
...list(lists).flatMap((raw) => {
|
|
5690
|
+
const file = absolute(raw);
|
|
5691
|
+
if (!fs7.existsSync(file)) return [];
|
|
5692
|
+
xcconfigs.add(file);
|
|
5693
|
+
return fileListEntries(file, absolute);
|
|
5694
|
+
})
|
|
5695
|
+
];
|
|
5696
|
+
const destinations = new Set(
|
|
5697
|
+
files(phase.outputPaths, phase.outputFileListPaths).map(
|
|
5698
|
+
(file) => path7.dirname(file)
|
|
5699
|
+
)
|
|
5700
|
+
);
|
|
5701
|
+
const slices = files(phase.inputPaths, phase.inputFileListPaths).flatMap(
|
|
5702
|
+
(file) => file.endsWith(".xcframework") && fs7.existsSync(file) ? [simulatorNativeLibrary(file)?.slice ?? []].flat() : []
|
|
5703
|
+
);
|
|
5704
|
+
return destinations.size === 1 && slices.length > 0 ? [{ destination: [...destinations][0], slices }] : [];
|
|
5705
|
+
})
|
|
5706
|
+
);
|
|
5707
|
+
const copiedSearchPath = (directory) => {
|
|
5708
|
+
for (const { destination, slices } of xcframeworkCopies) {
|
|
5709
|
+
const rest = relativeInside(destination, directory);
|
|
5710
|
+
if (rest === null) continue;
|
|
5711
|
+
const found = slices.map((slice) => path7.join(slice, rest)).filter((candidate) => isDirectory(candidate));
|
|
5712
|
+
if (found.length) return found;
|
|
5713
|
+
}
|
|
5714
|
+
return [directory];
|
|
5715
|
+
};
|
|
5716
|
+
if (xcframeworkCopies.length)
|
|
5717
|
+
for (const { module: module2 } of builtTargets) {
|
|
5718
|
+
const objc = module2.objc;
|
|
5719
|
+
if (!objc) continue;
|
|
5720
|
+
objc.headerSearchPaths = objc.headerSearchPaths.flatMap(copiedSearchPath);
|
|
5721
|
+
objc.userHeaderSearchPaths = objc.userHeaderSearchPaths.flatMap(copiedSearchPath);
|
|
5722
|
+
objc.frameworkSearchPaths = objc.frameworkSearchPaths.flatMap(copiedSearchPath);
|
|
5723
|
+
}
|
|
5618
5724
|
for (const { ref, module: module2, settings: settings2 } of builtTargets)
|
|
5619
5725
|
module2.targetDependencies = [
|
|
5620
5726
|
.../* @__PURE__ */ new Set([
|
|
@@ -5643,7 +5749,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5643
5749
|
const generate = settings2("GENERATE_INFOPLIST_FILE") === "YES";
|
|
5644
5750
|
if (!FRAMEWORK_PRODUCTS.has(str(ref.target.productType) ?? "") || !plistSetting && !generate || module2.generatedInfoPlist && !options2.prepareGeneratedSources)
|
|
5645
5751
|
return { ref, framework: module2 };
|
|
5646
|
-
const file = plistSetting ?
|
|
5752
|
+
const file = plistSetting ? path7.resolve(ref.project.projectDir, plistSetting) : null;
|
|
5647
5753
|
if (file) xcconfigs.add(file);
|
|
5648
5754
|
const info2 = processedInfoPlist(module2.name, file, productSettings2, keys);
|
|
5649
5755
|
if (generate) {
|
|
@@ -5659,7 +5765,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5659
5765
|
});
|
|
5660
5766
|
const frameworks = frameworkTargets.map(({ framework }) => framework);
|
|
5661
5767
|
const podSourceDirs = builtTargets.slice(0, -1).flatMap(
|
|
5662
|
-
({ ref, module: module2 }) => isPodsProject(ref.project.xcodeproj) ? [...module2.allSources, ...module2.objc?.headers ?? []].map((file) =>
|
|
5768
|
+
({ ref, module: module2 }) => isPodsProject(ref.project.xcodeproj) ? [...module2.allSources, ...module2.objc?.headers ?? []].map((file) => path7.dirname(file)).filter((dir) => fs7.existsSync(dir)) : []
|
|
5663
5769
|
);
|
|
5664
5770
|
const resourceProducts = [];
|
|
5665
5771
|
const bundleTargets = builtTargets.filter(
|
|
@@ -5670,7 +5776,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5670
5776
|
const phase = owner.ref.project.object(phaseId);
|
|
5671
5777
|
if (phase?.isa !== "PBXShellScriptBuildPhase" || str(phase.name) !== "[CP] Copy Pods Resources")
|
|
5672
5778
|
continue;
|
|
5673
|
-
const absolute = (raw) =>
|
|
5779
|
+
const absolute = (raw) => path7.resolve(owner.ref.project.projectDir, expand(raw, owner.settings));
|
|
5674
5780
|
const entries = (paths) => paths.flatMap((raw) => {
|
|
5675
5781
|
const file = absolute(raw);
|
|
5676
5782
|
xcconfigs.add(file);
|
|
@@ -5686,7 +5792,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5686
5792
|
].filter((file) => file.endsWith(".bundle"));
|
|
5687
5793
|
if (inputs.length !== outputs.length)
|
|
5688
5794
|
throw new Error(`${owner.module.name}: resource bundle copy lists differ`);
|
|
5689
|
-
const destinationRoot =
|
|
5795
|
+
const destinationRoot = path7.join(
|
|
5690
5796
|
owner.settings("TARGET_BUILD_DIR"),
|
|
5691
5797
|
owner.settings("UNLOCALIZED_RESOURCES_FOLDER_PATH")
|
|
5692
5798
|
);
|
|
@@ -5695,24 +5801,24 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5695
5801
|
const file = str(
|
|
5696
5802
|
target.ref.project.object(str(target.ref.target.productReference))?.path
|
|
5697
5803
|
);
|
|
5698
|
-
return file &&
|
|
5804
|
+
return file && path7.join(target.settings("TARGET_BUILD_DIR"), file) === input2;
|
|
5699
5805
|
});
|
|
5700
5806
|
if (!product && !isDirectory(input2))
|
|
5701
5807
|
throw new Error(
|
|
5702
5808
|
`${owner.module.name}: resource bundle input has no selected producer: ${input2}`
|
|
5703
5809
|
);
|
|
5704
|
-
const destination =
|
|
5705
|
-
if (destination === ".." || destination.startsWith(`..${
|
|
5810
|
+
const destination = path7.relative(destinationRoot, outputs[index]);
|
|
5811
|
+
if (destination === ".." || destination.startsWith(`..${path7.sep}`) || path7.isAbsolute(destination) || path7.basename(input2) !== path7.basename(destination))
|
|
5706
5812
|
throw new Error(
|
|
5707
5813
|
`${owner.module.name}: invalid resource bundle copy destination`
|
|
5708
5814
|
);
|
|
5709
|
-
const infoFile = product ?
|
|
5815
|
+
const infoFile = product ? path7.resolve(
|
|
5710
5816
|
product.ref.project.projectDir,
|
|
5711
5817
|
product.settings("INFOPLIST_FILE")
|
|
5712
5818
|
) : null;
|
|
5713
5819
|
if (infoFile) xcconfigs.add(infoFile);
|
|
5714
5820
|
const prefix = owner.ref === app ? "" : `Frameworks/${owner.module.moduleName}.framework/`;
|
|
5715
|
-
const bundlePath = prefix + destination.split(
|
|
5821
|
+
const bundlePath = prefix + destination.split(path7.sep).join("/");
|
|
5716
5822
|
if (resourceProducts.some((resource) => resource.path === bundlePath))
|
|
5717
5823
|
throw new Error(
|
|
5718
5824
|
`${owner.module.name}: duplicate resource bundle destination ${bundlePath}`
|
|
@@ -5723,20 +5829,20 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5723
5829
|
resources: product.module.resources,
|
|
5724
5830
|
infoPlist: buildPlist(
|
|
5725
5831
|
expandValue(
|
|
5726
|
-
parsePlist(
|
|
5832
|
+
parsePlist(fs7.readFileSync(infoFile, "utf8")),
|
|
5727
5833
|
product.productSettings
|
|
5728
5834
|
)
|
|
5729
5835
|
)
|
|
5730
5836
|
} : {
|
|
5731
|
-
resources:
|
|
5837
|
+
resources: fs7.readdirSync(input2, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => path7.join(entry.parentPath, entry.name)).sort(),
|
|
5732
5838
|
sourceRoot: input2
|
|
5733
5839
|
}
|
|
5734
5840
|
});
|
|
5735
5841
|
}
|
|
5736
5842
|
}
|
|
5737
5843
|
}
|
|
5738
|
-
const infoPlistFile = settings("INFOPLIST_FILE") ?
|
|
5739
|
-
const entitlementsFile = settings("CODE_SIGN_ENTITLEMENTS") ?
|
|
5844
|
+
const infoPlistFile = settings("INFOPLIST_FILE") ? path7.resolve(app.project.projectDir, settings("INFOPLIST_FILE")) : null;
|
|
5845
|
+
const entitlementsFile = settings("CODE_SIGN_ENTITLEMENTS") ? path7.resolve(app.project.projectDir, settings("CODE_SIGN_ENTITLEMENTS")) : null;
|
|
5740
5846
|
const infoPlistPending = module.generatedInfoPlist && !options2.prepareGeneratedSources;
|
|
5741
5847
|
const info = processedInfoPlist(
|
|
5742
5848
|
module.name,
|
|
@@ -5745,7 +5851,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5745
5851
|
settingKeys
|
|
5746
5852
|
);
|
|
5747
5853
|
const bundleIdentifier = productSettings("PRODUCT_BUNDLE_IDENTIFIER") || (typeof info.CFBundleIdentifier === "string" ? info.CFBundleIdentifier : "");
|
|
5748
|
-
const entitlements = entitlementsFile ? parsePlist(
|
|
5854
|
+
const entitlements = entitlementsFile ? parsePlist(fs7.readFileSync(entitlementsFile, "utf8")) : void 0;
|
|
5749
5855
|
const keychainAccessGroups = entitlementsFile ? readKeychainAccessGroups(
|
|
5750
5856
|
entitlements,
|
|
5751
5857
|
(value) => expand(value, (key) => {
|
|
@@ -5783,7 +5889,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5783
5889
|
};
|
|
5784
5890
|
}
|
|
5785
5891
|
const localPackageDirs = [
|
|
5786
|
-
...listed.filter((reference) =>
|
|
5892
|
+
...listed.filter((reference) => fs7.existsSync(path7.join(reference, "Package.swift"))),
|
|
5787
5893
|
...projects.flatMap(
|
|
5788
5894
|
(project) => Object.entries(project.objects).flatMap(([id, entry]) => {
|
|
5789
5895
|
if (!isDict(entry)) return [];
|
|
@@ -5793,19 +5899,19 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5793
5899
|
const packages = [];
|
|
5794
5900
|
while (pending.length > 0) {
|
|
5795
5901
|
const dir = pending.pop();
|
|
5796
|
-
if (
|
|
5902
|
+
if (fs7.existsSync(path7.join(dir, "Package.swift"))) {
|
|
5797
5903
|
packages.push(dir);
|
|
5798
5904
|
continue;
|
|
5799
5905
|
}
|
|
5800
5906
|
if (!isDirectory(dir)) continue;
|
|
5801
|
-
for (const child of
|
|
5907
|
+
for (const child of fs7.readdirSync(dir, { withFileTypes: true }))
|
|
5802
5908
|
if (child.isDirectory() && !child.name.startsWith("."))
|
|
5803
|
-
pending.push(
|
|
5909
|
+
pending.push(path7.join(dir, child.name));
|
|
5804
5910
|
}
|
|
5805
5911
|
return packages;
|
|
5806
5912
|
}
|
|
5807
|
-
const candidate = entry.isa === "XCLocalSwiftPackageReference" ?
|
|
5808
|
-
return candidate &&
|
|
5913
|
+
const candidate = entry.isa === "XCLocalSwiftPackageReference" ? path7.resolve(project.projectDir, str(entry.relativePath) ?? "") : entry.isa === "PBXFileReference" ? project.resolvePath(id) : null;
|
|
5914
|
+
return candidate && fs7.existsSync(path7.join(candidate, "Package.swift")) ? [candidate] : [];
|
|
5809
5915
|
})
|
|
5810
5916
|
)
|
|
5811
5917
|
];
|
|
@@ -5835,7 +5941,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5835
5941
|
if ((flag === "-framework" || flag === "-weak_framework") && name)
|
|
5836
5942
|
sdkFrameworks.add(name);
|
|
5837
5943
|
});
|
|
5838
|
-
const absolute = (raw) =>
|
|
5944
|
+
const absolute = (raw) => path7.resolve(ref.project.projectDir, expand(raw, settings2));
|
|
5839
5945
|
const requested = options2.nativeModules;
|
|
5840
5946
|
const includeBinary = (name, dir) => {
|
|
5841
5947
|
if (!requested || nativeTargets.has(ref) || requested.includes(name) || dir.endsWith(".xcframework") && localSwiftBinaryModules(dir).some((module2) => requested.includes(module2)))
|
|
@@ -5847,14 +5953,14 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5847
5953
|
for (const directory of expandSearchPath(absolute(raw), searchRules)) {
|
|
5848
5954
|
if (frameworkSearchDirectories.has(directory)) continue;
|
|
5849
5955
|
frameworkSearchDirectories.add(directory);
|
|
5850
|
-
if (!
|
|
5956
|
+
if (!fs7.statSync(directory, { throwIfNoEntry: false })?.isDirectory() || /\.sdk\/(?:System|Developer)\/Library\/Frameworks\/?$/.test(directory))
|
|
5851
5957
|
continue;
|
|
5852
|
-
for (const entry of
|
|
5958
|
+
for (const entry of fs7.readdirSync(directory, { withFileTypes: true })) {
|
|
5853
5959
|
const name = /^(.+)\.framework$/.exec(entry.name)?.[1];
|
|
5854
5960
|
if (!name || byProduct.has(entry.name) || searchedFrameworks.has(name))
|
|
5855
5961
|
continue;
|
|
5856
|
-
const file =
|
|
5857
|
-
if (
|
|
5962
|
+
const file = path7.join(directory, entry.name);
|
|
5963
|
+
if (fs7.statSync(file, { throwIfNoEntry: false })?.isDirectory())
|
|
5858
5964
|
searchedFrameworks.set(name, file);
|
|
5859
5965
|
}
|
|
5860
5966
|
}
|
|
@@ -5862,9 +5968,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5862
5968
|
}
|
|
5863
5969
|
for (const raw of settingList(settings2("SWIFT_INCLUDE_PATHS"))) {
|
|
5864
5970
|
const dir = absolute(raw);
|
|
5865
|
-
const modulemap =
|
|
5866
|
-
if (!
|
|
5867
|
-
const name = moduleMapName(
|
|
5971
|
+
const modulemap = path7.join(dir, "module.modulemap");
|
|
5972
|
+
if (!fs7.existsSync(modulemap)) continue;
|
|
5973
|
+
const name = moduleMapName(fs7.readFileSync(modulemap, "utf8"));
|
|
5868
5974
|
if (name && !binaryFrameworks.has(name)) includeBinary(name, dir);
|
|
5869
5975
|
}
|
|
5870
5976
|
for (const phaseId of list(ref.target.buildPhases)) {
|
|
@@ -5873,7 +5979,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5873
5979
|
const inputs = list(phase.inputPaths).map(absolute);
|
|
5874
5980
|
for (const raw of list(phase.inputFileListPaths)) {
|
|
5875
5981
|
const file = absolute(raw);
|
|
5876
|
-
if (!
|
|
5982
|
+
if (!fs7.existsSync(file)) continue;
|
|
5877
5983
|
xcconfigs.add(file);
|
|
5878
5984
|
inputs.push(...fileListEntries(file, absolute));
|
|
5879
5985
|
}
|
|
@@ -5938,7 +6044,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5938
6044
|
...productAttributes.get(dependencyId)?.length ? { attributes: productAttributes.get(dependencyId) } : {},
|
|
5939
6045
|
source: reference?.isa === "XCRemoteSwiftPackageReference" ? { kind: "remote", url: str(reference.repositoryURL) ?? "" } : reference?.isa === "XCLocalSwiftPackageReference" ? {
|
|
5940
6046
|
kind: "local",
|
|
5941
|
-
dir:
|
|
6047
|
+
dir: path7.resolve(
|
|
5942
6048
|
project.projectDir,
|
|
5943
6049
|
str(reference.relativePath) ?? ""
|
|
5944
6050
|
)
|
|
@@ -5972,14 +6078,14 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
5972
6078
|
continue;
|
|
5973
6079
|
}
|
|
5974
6080
|
if (tree === "BUILT_PRODUCTS_DIR" || tree === "DEVELOPER_DIR" || // a target in the workspace builds it, so it exists only after that build
|
|
5975
|
-
byProduct.has(
|
|
6081
|
+
byProduct.has(path7.basename(rawPath)))
|
|
5976
6082
|
continue;
|
|
5977
6083
|
const resolved = fileId ? project.resolvePath(fileId) : null;
|
|
5978
|
-
if (fileId && resolved !== null && !
|
|
5979
|
-
const parts = resolved.split(
|
|
6084
|
+
if (fileId && resolved !== null && !fs7.existsSync(resolved)) {
|
|
6085
|
+
const parts = resolved.split(path7.sep);
|
|
5980
6086
|
const pods = parts.lastIndexOf("Pods");
|
|
5981
|
-
const sandbox = parts.slice(0, pods + 1).join(
|
|
5982
|
-
if (!options2.installedPods && options2.requireSources === false && pods > 0 &&
|
|
6087
|
+
const sandbox = parts.slice(0, pods + 1).join(path7.sep);
|
|
6088
|
+
if (!options2.installedPods && options2.requireSources === false && pods > 0 && fs7.existsSync(path7.join(path7.dirname(sandbox), "Podfile")))
|
|
5983
6089
|
continue;
|
|
5984
6090
|
if (!ios_sdk_frameworks_default.frameworks.includes(name))
|
|
5985
6091
|
throw new Error(
|
|
@@ -6007,7 +6113,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
6007
6113
|
({ product }) => !options2.nativeModules || nativeTargets.has(built.ref) || options2.nativeModules.includes(product)
|
|
6008
6114
|
);
|
|
6009
6115
|
const resolvedFile = workspaceResolvedFile(xcodeprojOrWorkspace);
|
|
6010
|
-
let packageResolved =
|
|
6116
|
+
let packageResolved = fs7.existsSync(resolvedFile) ? [fs7.realpathSync.native(resolvedFile)] : [...new Set(localPackageDirs.map((dir) => path7.join(dir, "Package.resolved")))].filter((file) => fs7.existsSync(file)).map((file) => fs7.realpathSync.native(file)).sort();
|
|
6011
6117
|
if (packageResolved.length === 0) {
|
|
6012
6118
|
const requirements = remotePackageRequirements(projects);
|
|
6013
6119
|
if (requirements.length > 0) {
|
|
@@ -6063,19 +6169,19 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
6063
6169
|
} : {},
|
|
6064
6170
|
rootDir: commonAncestor(
|
|
6065
6171
|
[
|
|
6066
|
-
workspace ?
|
|
6172
|
+
workspace ? path7.dirname(workspace) : app.project.projectDir,
|
|
6067
6173
|
...used.map((project) => project.projectDir),
|
|
6068
6174
|
...localPackageDirs,
|
|
6069
6175
|
...linkedProducts.flatMap(
|
|
6070
|
-
({ source }) => source.kind === "local" &&
|
|
6176
|
+
({ source }) => source.kind === "local" && fs7.existsSync(source.dir) ? [source.dir] : []
|
|
6071
6177
|
),
|
|
6072
6178
|
...new Set(podSourceDirs),
|
|
6073
6179
|
// a target's own files may sit beside the project, such as an asset
|
|
6074
6180
|
// catalog one folder up, and xcode builds them from there
|
|
6075
6181
|
...new Set(
|
|
6076
|
-
[...module.allSources, ...module.resources].filter((file) =>
|
|
6182
|
+
[...module.allSources, ...module.resources].filter((file) => fs7.existsSync(file)).map((file) => path7.dirname(file))
|
|
6077
6183
|
)
|
|
6078
|
-
].map((dir) =>
|
|
6184
|
+
].map((dir) => fs7.realpathSync.native(dir))
|
|
6079
6185
|
),
|
|
6080
6186
|
projectFiles: [
|
|
6081
6187
|
.../* @__PURE__ */ new Set([
|
|
@@ -6101,7 +6207,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
6101
6207
|
resourceProducts,
|
|
6102
6208
|
linkedProducts,
|
|
6103
6209
|
localPackageDirs: [
|
|
6104
|
-
...new Set(localPackageDirs.map((dir) =>
|
|
6210
|
+
...new Set(localPackageDirs.map((dir) => fs7.realpathSync.native(dir)))
|
|
6105
6211
|
].sort(),
|
|
6106
6212
|
binaryFrameworks: [...binaryFrameworks].map(([name, file]) => ({ name, path: file })).sort((left, right) => left.name.localeCompare(right.name)),
|
|
6107
6213
|
sdkFrameworks: [...sdkFrameworks].filter(
|
|
@@ -6206,7 +6312,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
6206
6312
|
const rtcAppGroupIdentifier = nonEmptyString(dictionary2.RTCAppGroupIdentifier);
|
|
6207
6313
|
const screenShareExtensionBundleId = typeof dictionary2.ScreenShareExtensionBundleId === "string" ? dictionary2.ScreenShareExtensionBundleId : void 0;
|
|
6208
6314
|
const rootModuleName = readRootModuleName(
|
|
6209
|
-
app.allSources.filter((file) => /Delegate\.(?:swift|mm|m)$/.test(file) &&
|
|
6315
|
+
app.allSources.filter((file) => /Delegate\.(?:swift|mm|m)$/.test(file) && fs8.existsSync(file)).map((file) => fs8.readFileSync(file, "utf8"))
|
|
6210
6316
|
);
|
|
6211
6317
|
const identity = {
|
|
6212
6318
|
...app.keychainAccessGroups === void 0 ? {} : { keychainAccessGroups: app.keychainAccessGroups },
|
|
@@ -6230,7 +6336,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
6230
6336
|
googleSignIn: readGoogleSignInConfiguration(
|
|
6231
6337
|
dictionary2,
|
|
6232
6338
|
Object.fromEntries(
|
|
6233
|
-
app.resources.filter((file) => file.endsWith(".plist")).map((file) => [file, parsePlistBytes(
|
|
6339
|
+
app.resources.filter((file) => file.endsWith(".plist")).map((file) => [file, parsePlistBytes(fs8.readFileSync(file), parseInfoPlist)])
|
|
6234
6340
|
)
|
|
6235
6341
|
),
|
|
6236
6342
|
supportedInterfaceOrientations,
|
|
@@ -6240,11 +6346,11 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
6240
6346
|
bundleIcons: resolveNativeBundleIcons(icons, catalogAlternateNames, (value) => value),
|
|
6241
6347
|
appIconArtwork: resolveNativeAppIconArtwork(
|
|
6242
6348
|
app.resources,
|
|
6243
|
-
(file) =>
|
|
6349
|
+
(file) => fs8.readFileSync(file, "utf8"),
|
|
6244
6350
|
(file) => {
|
|
6245
|
-
const extension =
|
|
6351
|
+
const extension = path8.extname(file).toLowerCase();
|
|
6246
6352
|
const contentType = extension === ".jpg" || extension === ".jpeg" ? "image/jpeg" : extension === ".webp" ? "image/webp" : "image/png";
|
|
6247
|
-
return `data:${contentType};base64,${
|
|
6353
|
+
return `data:${contentType};base64,${fs8.readFileSync(file).toString("base64")}`;
|
|
6248
6354
|
},
|
|
6249
6355
|
icons,
|
|
6250
6356
|
app.appIconName,
|
|
@@ -6281,11 +6387,11 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
|
|
|
6281
6387
|
const read = selectNativeAppIdentityReader(platform, {
|
|
6282
6388
|
android: () => null,
|
|
6283
6389
|
ios: () => {
|
|
6284
|
-
const nested =
|
|
6285
|
-
const iosRoot =
|
|
6390
|
+
const nested = path8.join(projectRoot, "ios");
|
|
6391
|
+
const iosRoot = fs8.existsSync(nested) ? nested : projectRoot;
|
|
6286
6392
|
const prefix = iosRoot === nested ? "ios/" : "";
|
|
6287
6393
|
const files = {};
|
|
6288
|
-
for (const entry of
|
|
6394
|
+
for (const entry of fs8.readdirSync(iosRoot, { withFileTypes: true })) {
|
|
6289
6395
|
if (entry.name === "Pods") continue;
|
|
6290
6396
|
if (entry.isDirectory()) {
|
|
6291
6397
|
const names = entry.name.endsWith(".xcodeproj") ? ["project.pbxproj"] : [
|
|
@@ -6293,17 +6399,17 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
|
|
|
6293
6399
|
"AppDelegate.swift",
|
|
6294
6400
|
"AppDelegate.mm",
|
|
6295
6401
|
"AppDelegate.m",
|
|
6296
|
-
...
|
|
6402
|
+
...fs8.readdirSync(path8.join(iosRoot, entry.name)).filter((name) => name.endsWith(".entitlements"))
|
|
6297
6403
|
];
|
|
6298
6404
|
for (const name of names) {
|
|
6299
6405
|
const relative2 = `${prefix}${entry.name}/${name}`;
|
|
6300
|
-
const file =
|
|
6301
|
-
if (
|
|
6406
|
+
const file = path8.join(projectRoot, relative2);
|
|
6407
|
+
if (fs8.existsSync(file)) files[relative2] = fs8.readFileSync(file, "utf8");
|
|
6302
6408
|
}
|
|
6303
6409
|
} else if (/AppDelegate\.(?:swift|mm|m)$|\.entitlements$/.test(entry.name)) {
|
|
6304
6410
|
const relative2 = `${prefix}${entry.name}`;
|
|
6305
|
-
const file =
|
|
6306
|
-
if (
|
|
6411
|
+
const file = path8.join(projectRoot, relative2);
|
|
6412
|
+
if (fs8.existsSync(file)) files[relative2] = fs8.readFileSync(file, "utf8");
|
|
6307
6413
|
}
|
|
6308
6414
|
}
|
|
6309
6415
|
const identity = extractNativeAppIdentityFromFiles(
|
|
@@ -6320,41 +6426,41 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
|
|
|
6320
6426
|
function readAndroidNativeAppIdentity(projectRoot, androidMergedManifest) {
|
|
6321
6427
|
const files = {};
|
|
6322
6428
|
if (androidMergedManifest) {
|
|
6323
|
-
const file =
|
|
6324
|
-
if (!
|
|
6325
|
-
files[androidMergedManifest] =
|
|
6429
|
+
const file = path8.resolve(projectRoot, androidMergedManifest);
|
|
6430
|
+
if (!fs8.existsSync(file)) return null;
|
|
6431
|
+
files[androidMergedManifest] = fs8.readFileSync(file, "utf8");
|
|
6326
6432
|
} else {
|
|
6327
|
-
const androidRoot =
|
|
6328
|
-
if (!
|
|
6433
|
+
const androidRoot = path8.join(projectRoot, "android");
|
|
6434
|
+
if (!fs8.existsSync(androidRoot)) return null;
|
|
6329
6435
|
const collect = (directory) => {
|
|
6330
|
-
for (const entry of
|
|
6331
|
-
const file =
|
|
6436
|
+
for (const entry of fs8.readdirSync(directory, { withFileTypes: true })) {
|
|
6437
|
+
const file = path8.join(directory, entry.name);
|
|
6332
6438
|
if (entry.isDirectory()) collect(file);
|
|
6333
6439
|
else if (entry.isFile() && entry.name === "AndroidManifest.xml")
|
|
6334
|
-
files[
|
|
6440
|
+
files[path8.relative(projectRoot, file).split(path8.sep).join("/")] = fs8.readFileSync(file, "utf8");
|
|
6335
6441
|
}
|
|
6336
6442
|
};
|
|
6337
|
-
for (const module of
|
|
6443
|
+
for (const module of fs8.readdirSync(androidRoot, { withFileTypes: true })) {
|
|
6338
6444
|
if (!module.isDirectory()) continue;
|
|
6339
|
-
const outputs =
|
|
6445
|
+
const outputs = path8.join(
|
|
6340
6446
|
androidRoot,
|
|
6341
6447
|
module.name,
|
|
6342
6448
|
"build/intermediates/merged_manifests"
|
|
6343
6449
|
);
|
|
6344
|
-
if (
|
|
6450
|
+
if (fs8.existsSync(outputs)) collect(outputs);
|
|
6345
6451
|
}
|
|
6346
6452
|
}
|
|
6347
6453
|
for (const manifest of Object.keys(files)) {
|
|
6348
6454
|
const resourceDirectory = androidMergedResourceValuesDirectory(manifest);
|
|
6349
6455
|
if (!resourceDirectory) continue;
|
|
6350
|
-
const absolute =
|
|
6351
|
-
if (!
|
|
6352
|
-
for (const entry of
|
|
6456
|
+
const absolute = path8.resolve(projectRoot, resourceDirectory);
|
|
6457
|
+
if (!fs8.existsSync(absolute)) continue;
|
|
6458
|
+
for (const entry of fs8.readdirSync(absolute, { withFileTypes: true })) {
|
|
6353
6459
|
if (!entry.isDirectory() || !/^values(?:-|$)/.test(entry.name)) continue;
|
|
6354
|
-
for (const resource of
|
|
6460
|
+
for (const resource of fs8.readdirSync(path8.join(absolute, entry.name))) {
|
|
6355
6461
|
if (!resource.endsWith(".xml")) continue;
|
|
6356
6462
|
const file = `${resourceDirectory}/${entry.name}/${resource}`;
|
|
6357
|
-
files[file] =
|
|
6463
|
+
files[file] = fs8.readFileSync(path8.resolve(projectRoot, file), "utf8");
|
|
6358
6464
|
}
|
|
6359
6465
|
}
|
|
6360
6466
|
}
|
|
@@ -6375,7 +6481,7 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget, enviro
|
|
|
6375
6481
|
parseInfoPlist,
|
|
6376
6482
|
buildSdkVersion
|
|
6377
6483
|
);
|
|
6378
|
-
const projectManifestPath =
|
|
6484
|
+
const projectManifestPath = path8.join(projectRoot, "package.json");
|
|
6379
6485
|
const projectRequire = createRequire2(projectManifestPath);
|
|
6380
6486
|
let reanimatedManifestPath;
|
|
6381
6487
|
try {
|
|
@@ -6389,22 +6495,22 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget, enviro
|
|
|
6389
6495
|
throw error;
|
|
6390
6496
|
}
|
|
6391
6497
|
const installedManifest = JSON.parse(
|
|
6392
|
-
|
|
6498
|
+
fs8.readFileSync(reanimatedManifestPath, "utf8")
|
|
6393
6499
|
);
|
|
6394
6500
|
const installedVersion = isRecord(installedManifest) ? nonEmptyString(installedManifest.version) : void 0;
|
|
6395
6501
|
if (!installedVersion) throw new Error("Reanimated package version is malformed");
|
|
6396
6502
|
if (Number.parseInt(installedVersion, 10) < 4) return identity;
|
|
6397
6503
|
const defaults = JSON.parse(
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6504
|
+
fs8.readFileSync(
|
|
6505
|
+
path8.join(
|
|
6506
|
+
path8.dirname(reanimatedManifestPath),
|
|
6401
6507
|
"src/featureFlags/staticFlags.json"
|
|
6402
6508
|
),
|
|
6403
6509
|
"utf8"
|
|
6404
6510
|
)
|
|
6405
6511
|
);
|
|
6406
6512
|
if (!isRecord(defaults)) throw new Error("Reanimated static flags are malformed");
|
|
6407
|
-
const manifest = JSON.parse(
|
|
6513
|
+
const manifest = JSON.parse(fs8.readFileSync(projectManifestPath, "utf8"));
|
|
6408
6514
|
const reanimated = isRecord(manifest) ? manifest.reanimated : void 0;
|
|
6409
6515
|
const overrides = isRecord(reanimated) ? reanimated.staticFeatureFlags : void 0;
|
|
6410
6516
|
if (overrides !== void 0 && !isRecord(overrides)) {
|