peachsim 0.1.2439 → 0.1.2441
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 +8180 -8397
- 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-FGE4PYDJ.mjs → acorn-FRQNHKFC.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-HIDNO3RP.mjs → chunk-4BZ3Z3IQ.mjs} +18 -18
- package/dist-lib/esm-chunks/{chunk-5T4XBUJP.mjs → chunk-4HEUXQGM.mjs} +4 -4
- package/dist-lib/esm-chunks/{chunk-7HANEMO4.mjs → chunk-4ZRMJ5YO.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-4ZFNH7TU.mjs → chunk-6A6JEVIF.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-KVTIDLBK.mjs → chunk-ABMB3G7I.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-C3WBGYP6.mjs → chunk-BAYRN7ZL.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-KSQ5KM5Y.mjs → chunk-DJMWTW2B.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-DADGQELM.mjs → chunk-IRMC5BCX.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-YB27R6JG.mjs → chunk-NPLEBOWJ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-HSADZOVN.mjs → chunk-O4EOBXAP.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-JCKI3VZ6.mjs → chunk-ORYS5CC4.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-2NPABFPN.mjs → chunk-PMGJ7FLI.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-6VY6HTJC.mjs → chunk-QUBR7LHU.mjs} +2036 -1918
- package/dist-lib/esm-chunks/{chunk-IWJUYJQO.mjs → chunk-QYYJESMK.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-CVGDRROP.mjs → chunk-VAQJQDWI.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-DEGYKHN7.mjs → chunk-VCAJFWZD.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-2EUHEBIJ.mjs → chunk-XO5GX4PI.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-MIQSRBVU.mjs → chunk-ZCMAKWHN.mjs} +1 -1
- package/dist-lib/esm-chunks/{metro-layout-parser-MVUAXRUJ.mjs → metro-layout-parser-AUAVE5VL.mjs} +3 -3
- package/dist-lib/expo-swift-bundle.cjs +5580 -5768
- 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 +6332 -6500
- package/dist-lib/host/fetch-proxy-handler.cjs +13891 -13919
- 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/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.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 +784 -536
- package/dist-lib/native-app-identity-project.mjs +543 -408
- 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 +81 -79
- package/dist-lib/public-origins-lib.json +185 -195
- 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 +7 -7
- package/dist-lib/skills.cjs +7579 -7758
- package/dist-lib/swift-compile.cjs +1978 -1922
- package/dist-lib/swift-compile.mjs +8 -8
- 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 +5 -5
- package/dist-lib/swift-toolchain.cjs +3 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
- package/dist-lib/vendor/acorn.cjs +1 -1
- package/dist-lib/vendor/bplist-parser.cjs +1 -1
- package/dist-lib/vendor/ignore.cjs +1 -1
- package/dist-lib/vendor/magic-string.cjs +1 -1
- package/dist-lib/vendor/plist.cjs +17 -17
- package/dist-lib/vendor/smol-toml.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/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-compat/src/stubs/native-seams/react-native-cookies.d.ts +4 -0
- package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +2 -2
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +9 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSDateComponentsFormatter.h +1 -1
- package/src/expo-discovery-cache.ts +9 -45
- package/src/expo-native-compiler-digest.ts +8 -0
- package/src/expo-native-prebuilt.ts +1 -10
- package/src/expo-native-workspace.ts +5 -120
- package/src/expo-pod-prebuilt.ts +1 -1
- package/src/expo-swift-host.ts +48 -35
- package/src/host/bridge-host.ts +2 -0
- package/src/installed-native-libraries.ts +10 -20
- package/src/native-slices.ts +1 -1
- package/src/pod-graph-specifications.ts +11 -0
- package/src/pods-install.ts +10 -7
- package/src/podspec-cocoapods.ts +8 -3
- package/src/podspec-sources.ts +19 -15
- package/src/swift-clang-type-ownership.ts +118 -0
- package/src/swift-compile.ts +20 -12
- package/src/swift-guest-image-ledger.ts +48 -0
- package/src/swift-guest-link.ts +11 -1
- package/src/swift-host.ts +7 -8
- package/src/swift-package-manifest.ts +13 -8
- package/src/swift-packages.ts +0 -5
- package/src/swift-toolchain.ts +1 -1
- package/src/xcode-project.ts +64 -46
- package/src/portable-expo-contract.ts +0 -108
- package/src/portable-expo-workspace.ts +0 -100
- package/src/prepared-xcode-phases.ts +0 -194
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2441 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -78,8 +78,8 @@ var require_parse = __commonJS({
|
|
|
78
78
|
var token;
|
|
79
79
|
var key;
|
|
80
80
|
var root;
|
|
81
|
-
module2.exports = function parse5(
|
|
82
|
-
source = String(
|
|
81
|
+
module2.exports = function parse5(text3, reviver) {
|
|
82
|
+
source = String(text3);
|
|
83
83
|
parseState = "start";
|
|
84
84
|
stack = [];
|
|
85
85
|
pos = 0;
|
|
@@ -1156,24 +1156,24 @@ __export(native_app_identity_project_exports, {
|
|
|
1156
1156
|
module.exports = __toCommonJS(native_app_identity_project_exports);
|
|
1157
1157
|
var import_node_fs44 = __toESM(require("node:fs"), 1);
|
|
1158
1158
|
var import_node_module = require("node:module");
|
|
1159
|
-
var
|
|
1159
|
+
var import_node_path45 = __toESM(require("node:path"), 1);
|
|
1160
1160
|
|
|
1161
1161
|
// src/android-string-value.ts
|
|
1162
|
-
function compileAndroidStringValue(
|
|
1163
|
-
if (/^\s*[@?]/.test(
|
|
1162
|
+
function compileAndroidStringValue(text3, where) {
|
|
1163
|
+
if (/^\s*[@?]/.test(text3))
|
|
1164
1164
|
throw new Error(`${where} is a resource reference, not resolved by Peach yet`);
|
|
1165
1165
|
const out = [];
|
|
1166
1166
|
let quoted = false;
|
|
1167
|
-
for (let index = 0; index <
|
|
1168
|
-
const char =
|
|
1167
|
+
for (let index = 0; index < text3.length; index++) {
|
|
1168
|
+
const char = text3[index] ?? "";
|
|
1169
1169
|
if (char === "\\") {
|
|
1170
|
-
const next =
|
|
1170
|
+
const next = text3[index + 1];
|
|
1171
1171
|
if (next === void 0) break;
|
|
1172
1172
|
index++;
|
|
1173
1173
|
if (next === "n") out.push({ char: "\n", soft: false });
|
|
1174
1174
|
else if (next === "t") out.push({ char: " ", soft: false });
|
|
1175
1175
|
else if (next === "u") {
|
|
1176
|
-
const hex =
|
|
1176
|
+
const hex = text3.slice(index + 1, index + 5);
|
|
1177
1177
|
if (!/^[0-9a-fA-F]{4}$/.test(hex))
|
|
1178
1178
|
throw new Error(`${where} has an invalid unicode escape \\u${hex}`);
|
|
1179
1179
|
out.push({ char: String.fromCharCode(Number.parseInt(hex, 16)), soft: false });
|
|
@@ -1212,10 +1212,10 @@ function decodeXmlText(value, file) {
|
|
|
1212
1212
|
return character;
|
|
1213
1213
|
});
|
|
1214
1214
|
}
|
|
1215
|
-
function parseXml(
|
|
1215
|
+
function parseXml(text3, file) {
|
|
1216
1216
|
const root = { name: "#document", attributes: {}, children: [], text: "" };
|
|
1217
1217
|
const stack = [root];
|
|
1218
|
-
const body =
|
|
1218
|
+
const body = text3.replace(/<!--[\s\S]*?-->/g, "").replace(/<\?[\s\S]*?\?>/g, "");
|
|
1219
1219
|
let index = 0;
|
|
1220
1220
|
while (index < body.length) {
|
|
1221
1221
|
const open = body.indexOf("<", index);
|
|
@@ -1399,8 +1399,8 @@ function resolveNativeAppIconArtwork(resources, readText, resourceUri, icons, pr
|
|
|
1399
1399
|
const populatedCatalogs = [];
|
|
1400
1400
|
for (const catalog of catalogs) {
|
|
1401
1401
|
const catalogCandidates = [];
|
|
1402
|
-
const
|
|
1403
|
-
const contents =
|
|
1402
|
+
const text3 = readText(catalog);
|
|
1403
|
+
const contents = text3 === null ? null : JSON.parse(text3);
|
|
1404
1404
|
if (isRecord(contents) && Array.isArray(contents.images)) {
|
|
1405
1405
|
for (const image of contents.images) {
|
|
1406
1406
|
if (!isRecord(image) || typeof image.filename !== "string" || /[/\\]/.test(image.filename) || !/\.(png|jpe?g|webp)$/i.test(image.filename) || image.appearances !== void 0 || !["iphone", "universal", "ios-marketing"].includes(String(image.idiom)))
|
|
@@ -1457,23 +1457,23 @@ function resolveNativeAppIconArtwork(resources, readText, resourceUri, icons, pr
|
|
|
1457
1457
|
var isDict = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1458
1458
|
var str = (value) => typeof value === "string" ? value : void 0;
|
|
1459
1459
|
var list = (value) => Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
|
|
1460
|
-
function parseOpenStepPlist(
|
|
1460
|
+
function parseOpenStepPlist(text3) {
|
|
1461
1461
|
let i = 0;
|
|
1462
1462
|
const fail = (message) => {
|
|
1463
|
-
const line =
|
|
1463
|
+
const line = text3.slice(0, i).split("\n").length;
|
|
1464
1464
|
throw new Error(`project.pbxproj line ${line}: ${message}`);
|
|
1465
1465
|
};
|
|
1466
1466
|
const skip = () => {
|
|
1467
1467
|
for (; ; ) {
|
|
1468
|
-
const ch =
|
|
1468
|
+
const ch = text3[i];
|
|
1469
1469
|
if (ch === " " || ch === " " || ch === "\n" || ch === "\r") i++;
|
|
1470
|
-
else if (ch === "/" &&
|
|
1471
|
-
const end =
|
|
1470
|
+
else if (ch === "/" && text3[i + 1] === "*") {
|
|
1471
|
+
const end = text3.indexOf("*/", i + 2);
|
|
1472
1472
|
if (end < 0) fail("unterminated comment");
|
|
1473
1473
|
i = end + 2;
|
|
1474
|
-
} else if (ch === "/" &&
|
|
1475
|
-
const end =
|
|
1476
|
-
i = end < 0 ?
|
|
1474
|
+
} else if (ch === "/" && text3[i + 1] === "/") {
|
|
1475
|
+
const end = text3.indexOf("\n", i);
|
|
1476
|
+
i = end < 0 ? text3.length : end + 1;
|
|
1477
1477
|
} else return;
|
|
1478
1478
|
}
|
|
1479
1479
|
};
|
|
@@ -1481,43 +1481,43 @@ function parseOpenStepPlist(text2) {
|
|
|
1481
1481
|
i++;
|
|
1482
1482
|
let out = "";
|
|
1483
1483
|
for (; ; ) {
|
|
1484
|
-
const ch =
|
|
1484
|
+
const ch = text3[i++];
|
|
1485
1485
|
if (ch === void 0) fail("unterminated string");
|
|
1486
1486
|
if (ch === '"') return out;
|
|
1487
1487
|
if (ch !== "\\") {
|
|
1488
1488
|
out += ch;
|
|
1489
1489
|
continue;
|
|
1490
1490
|
}
|
|
1491
|
-
const next =
|
|
1491
|
+
const next = text3[i++];
|
|
1492
1492
|
if (next === "n") out += "\n";
|
|
1493
1493
|
else if (next === "t") out += " ";
|
|
1494
1494
|
else if (next === "r") out += "\r";
|
|
1495
1495
|
else if (next === "U") {
|
|
1496
|
-
out += String.fromCharCode(parseInt(
|
|
1496
|
+
out += String.fromCharCode(parseInt(text3.slice(i, i + 4), 16));
|
|
1497
1497
|
i += 4;
|
|
1498
1498
|
} else out += next;
|
|
1499
1499
|
}
|
|
1500
1500
|
};
|
|
1501
1501
|
const value = () => {
|
|
1502
1502
|
skip();
|
|
1503
|
-
const ch =
|
|
1503
|
+
const ch = text3[i];
|
|
1504
1504
|
if (ch === "{") {
|
|
1505
1505
|
i++;
|
|
1506
1506
|
const dict = {};
|
|
1507
1507
|
for (; ; ) {
|
|
1508
1508
|
skip();
|
|
1509
|
-
if (
|
|
1509
|
+
if (text3[i] === "}") {
|
|
1510
1510
|
i++;
|
|
1511
1511
|
return dict;
|
|
1512
1512
|
}
|
|
1513
1513
|
const key = value();
|
|
1514
1514
|
if (typeof key !== "string") fail("dictionary key is not a string");
|
|
1515
1515
|
skip();
|
|
1516
|
-
if (
|
|
1516
|
+
if (text3[i++] !== "=") fail("expected =");
|
|
1517
1517
|
if (Object.hasOwn(dict, key)) fail(`duplicate key ${key}`);
|
|
1518
1518
|
dict[key] = value();
|
|
1519
1519
|
skip();
|
|
1520
|
-
if (
|
|
1520
|
+
if (text3[i++] !== ";") fail("expected ;");
|
|
1521
1521
|
}
|
|
1522
1522
|
}
|
|
1523
1523
|
if (ch === "(") {
|
|
@@ -1525,26 +1525,26 @@ function parseOpenStepPlist(text2) {
|
|
|
1525
1525
|
const list2 = [];
|
|
1526
1526
|
for (; ; ) {
|
|
1527
1527
|
skip();
|
|
1528
|
-
if (
|
|
1528
|
+
if (text3[i] === ")") {
|
|
1529
1529
|
i++;
|
|
1530
1530
|
return list2;
|
|
1531
1531
|
}
|
|
1532
1532
|
list2.push(value());
|
|
1533
1533
|
skip();
|
|
1534
|
-
if (
|
|
1535
|
-
else if (
|
|
1534
|
+
if (text3[i] === ",") i++;
|
|
1535
|
+
else if (text3[i] !== ")") fail("expected , or )");
|
|
1536
1536
|
}
|
|
1537
1537
|
}
|
|
1538
1538
|
if (ch === '"') return quoted();
|
|
1539
1539
|
const start = i;
|
|
1540
|
-
while (i <
|
|
1540
|
+
while (i < text3.length && /[A-Za-z0-9_$+/:.\-<>]/.test(text3[i])) i++;
|
|
1541
1541
|
if (i === start) fail(`unexpected ${JSON.stringify(ch ?? "end of file")}`);
|
|
1542
|
-
return
|
|
1542
|
+
return text3.slice(start, i);
|
|
1543
1543
|
};
|
|
1544
|
-
if (
|
|
1544
|
+
if (text3.startsWith("// !$*UTF8*$!")) i = text3.indexOf("\n") + 1;
|
|
1545
1545
|
const root = value();
|
|
1546
1546
|
skip();
|
|
1547
|
-
if (i !==
|
|
1547
|
+
if (i !== text3.length) fail("trailing content");
|
|
1548
1548
|
return root;
|
|
1549
1549
|
}
|
|
1550
1550
|
|
|
@@ -1809,10 +1809,10 @@ function appTargetReleaseSettings(pbxproj, targetName, infoPlistRelativePath) {
|
|
|
1809
1809
|
var APP_DELEGATE_PATH_RE = /(?:^|\/)(?:ios\/)?([^/]+)\/AppDelegate\.(?:swift|mm|m)$/;
|
|
1810
1810
|
function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri) {
|
|
1811
1811
|
const pbxprojPath = Object.keys(files).find(
|
|
1812
|
-
(
|
|
1812
|
+
(path40) => /(?:^|\/)ios\/[^/]+\.xcodeproj\/project\.pbxproj$/.test(path40)
|
|
1813
1813
|
) ?? Object.keys(files).find(
|
|
1814
|
-
(
|
|
1815
|
-
) ?? Object.keys(files).find((
|
|
1814
|
+
(path40) => /(?:^|\/)[^/]+\.xcodeproj\/project\.pbxproj$/.test(path40)
|
|
1815
|
+
) ?? Object.keys(files).find((path40) => /(?:^|\/)project\.pbxproj$/.test(path40));
|
|
1816
1816
|
if (!pbxprojPath) return null;
|
|
1817
1817
|
const pbxproj = files[pbxprojPath];
|
|
1818
1818
|
let objects = {};
|
|
@@ -1854,7 +1854,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
|
|
|
1854
1854
|
} else if (applicationTargetNames.size === 1) {
|
|
1855
1855
|
targetName = [...applicationTargetNames][0];
|
|
1856
1856
|
} else if (applicationTargetNames.size > 1) {
|
|
1857
|
-
const delegateTargets = Object.keys(files).filter((
|
|
1857
|
+
const delegateTargets = Object.keys(files).filter((path40) => !path40.includes("/Pods/")).map((path40) => path40.match(APP_DELEGATE_PATH_RE)?.[1]).filter(
|
|
1858
1858
|
(name) => typeof name === "string" && applicationTargetNames.has(name)
|
|
1859
1859
|
);
|
|
1860
1860
|
if (delegateTargets.length === 1) {
|
|
@@ -2095,7 +2095,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
|
|
|
2095
2095
|
if (Object.hasOwn(files, file)) return [file];
|
|
2096
2096
|
const prefix = file === "" ? "" : `${file.replace(/\/$/, "")}/`;
|
|
2097
2097
|
return paths.filter(
|
|
2098
|
-
(
|
|
2098
|
+
(path40) => path40.startsWith(prefix) && !/(?:^|\/)\./.test(path40.slice(prefix.length))
|
|
2099
2099
|
);
|
|
2100
2100
|
},
|
|
2101
2101
|
join8,
|
|
@@ -2106,7 +2106,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
|
|
|
2106
2106
|
}
|
|
2107
2107
|
const rootModuleName = readRootModuleName(
|
|
2108
2108
|
Object.entries(files).filter(
|
|
2109
|
-
([
|
|
2109
|
+
([path40]) => !path40.includes("/Pods/") && (/(?:^|\/)(?:ios\/)?AppDelegate\.(?:swift|mm|m)$/.test(path40) || path40.match(APP_DELEGATE_PATH_RE)?.[1] === targetName)
|
|
2110
2110
|
).map(([, source]) => source)
|
|
2111
2111
|
);
|
|
2112
2112
|
return {
|
|
@@ -2309,6 +2309,69 @@ var compilerArchives = {
|
|
|
2309
2309
|
}
|
|
2310
2310
|
}
|
|
2311
2311
|
};
|
|
2312
|
+
var SWIFT_PRIVATE_DISTRIBUTION_ENV = "PEACH_SWIFT_PRIVATE_DISTRIBUTION";
|
|
2313
|
+
function privateSwiftDistributionRoot() {
|
|
2314
|
+
const root = process.env[SWIFT_PRIVATE_DISTRIBUTION_ENV]?.trim();
|
|
2315
|
+
return root ? import_node_path3.default.resolve(root) : null;
|
|
2316
|
+
}
|
|
2317
|
+
function privateSwiftCompilerRelease() {
|
|
2318
|
+
return process.env.PEACH_SWIFT_PRIVATE_COMPILER_RELEASE?.trim() || null;
|
|
2319
|
+
}
|
|
2320
|
+
function privateSwiftRelease() {
|
|
2321
|
+
const compiler = privateSwiftCompilerRelease();
|
|
2322
|
+
if (compiler) return compiler;
|
|
2323
|
+
const root = privateSwiftDistributionRoot();
|
|
2324
|
+
if (!root) return null;
|
|
2325
|
+
const manifest = JSON.parse(
|
|
2326
|
+
import_node_fs3.default.readFileSync(import_node_path3.default.join(root, "distribution.json"), "utf8")
|
|
2327
|
+
);
|
|
2328
|
+
const release = manifest && typeof manifest === "object" && Reflect.get(manifest, "release");
|
|
2329
|
+
if (typeof release !== "string")
|
|
2330
|
+
throw new Error(`${root} holds no Swift distribution release`);
|
|
2331
|
+
return release;
|
|
2332
|
+
}
|
|
2333
|
+
function registerSwiftHostCompiler(release, pin2) {
|
|
2334
|
+
compilerArchives[release] = pin2;
|
|
2335
|
+
}
|
|
2336
|
+
function swiftToolchainBin(release) {
|
|
2337
|
+
if (process.platform === "darwin") {
|
|
2338
|
+
const dirs = [import_node_os.default.homedir(), "/"].map(
|
|
2339
|
+
(base) => import_node_path3.default.join(base, `Library/Developer/Toolchains/${release}.xctoolchain/usr/bin`)
|
|
2340
|
+
);
|
|
2341
|
+
return dirs.find((dir) => import_node_fs3.default.existsSync(import_node_path3.default.join(dir, "swift"))) ?? dirs[0];
|
|
2342
|
+
}
|
|
2343
|
+
if (process.env.CONTRAST_SWIFT_TOOLCHAINS) {
|
|
2344
|
+
return import_node_path3.default.join(process.env.CONTRAST_SWIFT_TOOLCHAINS, release, "usr/bin");
|
|
2345
|
+
}
|
|
2346
|
+
const image = import_node_path3.default.join("/opt/swift", release, "usr/bin");
|
|
2347
|
+
if (import_node_fs3.default.existsSync(import_node_path3.default.join(image, "swift"))) return image;
|
|
2348
|
+
if (release.includes("-custom-"))
|
|
2349
|
+
return import_node_path3.default.join(peachHome(), "swift", "toolchains", release, "usr/bin");
|
|
2350
|
+
return (process.env.PATH ?? "").split(import_node_path3.default.delimiter).find((dir) => dir && import_node_fs3.default.existsSync(import_node_path3.default.join(dir, "swift"))) ?? image;
|
|
2351
|
+
}
|
|
2352
|
+
function peachHome() {
|
|
2353
|
+
const override = process.env.PEACH_HOME;
|
|
2354
|
+
return override ? import_node_path3.default.resolve(override) : import_node_path3.default.join(import_node_os.default.homedir(), ".peach");
|
|
2355
|
+
}
|
|
2356
|
+
var scratch;
|
|
2357
|
+
var linuxLibraryPath;
|
|
2358
|
+
var linuxHostSdkRoot;
|
|
2359
|
+
function swiftEnvironment(base = process.env) {
|
|
2360
|
+
return {
|
|
2361
|
+
...base,
|
|
2362
|
+
...linuxHostSdkRoot ? { SDKROOT: linuxHostSdkRoot } : {},
|
|
2363
|
+
...linuxLibraryPath ? {
|
|
2364
|
+
LD_LIBRARY_PATH: [linuxLibraryPath, base.LD_LIBRARY_PATH].filter(Boolean).join(":")
|
|
2365
|
+
} : {},
|
|
2366
|
+
...scratch ? {
|
|
2367
|
+
TMPDIR: scratch.directory,
|
|
2368
|
+
XDG_CONFIG_HOME: import_node_path3.default.join(scratch.home, ".config"),
|
|
2369
|
+
XDG_CACHE_HOME: import_node_path3.default.join(scratch.home, ".cache"),
|
|
2370
|
+
XDG_DATA_HOME: import_node_path3.default.join(scratch.home, ".local", "share"),
|
|
2371
|
+
...process.platform === "linux" ? { HOME: scratch.home } : {}
|
|
2372
|
+
} : {}
|
|
2373
|
+
};
|
|
2374
|
+
}
|
|
2312
2375
|
|
|
2313
2376
|
// src/swift-objc-sdk.ts
|
|
2314
2377
|
var import_node_path6 = __toESM(require("node:path"), 1);
|
|
@@ -2349,11 +2412,11 @@ var SWIFT_NATIVE_SOURCE_EXTENSIONS = [
|
|
|
2349
2412
|
".def",
|
|
2350
2413
|
".modulemap"
|
|
2351
2414
|
];
|
|
2352
|
-
function moduleMapTokens(
|
|
2353
|
-
return (
|
|
2415
|
+
function moduleMapTokens(text3) {
|
|
2416
|
+
return (text3.match(/\/\*[\s\S]*?\*\/|\/\/[^\n]*|"[^"]*"|[\w.*]+|[{}\[\]]/g) ?? []).filter((token) => !token.startsWith("/"));
|
|
2354
2417
|
}
|
|
2355
|
-
function moduleMapName(
|
|
2356
|
-
const tokens = moduleMapTokens(
|
|
2418
|
+
function moduleMapName(text3) {
|
|
2419
|
+
const tokens = moduleMapTokens(text3);
|
|
2357
2420
|
const index = tokens.findIndex(
|
|
2358
2421
|
(token, i) => token === "module" && tokens[i - 1] !== "extern"
|
|
2359
2422
|
);
|
|
@@ -2379,9 +2442,9 @@ var NATIVE_GRAPH_ID = (0, import_node_crypto3.createHash)("sha256").update(JSON.
|
|
|
2379
2442
|
|
|
2380
2443
|
// src/xcode-project.ts
|
|
2381
2444
|
var import_node_child_process24 = require("node:child_process");
|
|
2382
|
-
var
|
|
2445
|
+
var import_node_crypto25 = require("node:crypto");
|
|
2383
2446
|
var import_node_fs43 = __toESM(require("node:fs"), 1);
|
|
2384
|
-
var
|
|
2447
|
+
var import_node_path44 = __toESM(require("node:path"), 1);
|
|
2385
2448
|
var import_plist3 = __toESM(require("peachsim/vendor/plist"), 1);
|
|
2386
2449
|
|
|
2387
2450
|
// src/bazel-project.ts
|
|
@@ -2524,7 +2587,7 @@ function bazelGraph(root, label, configuration) {
|
|
|
2524
2587
|
const infoplists = app2.attrs.get("infoplists")?.list ?? [];
|
|
2525
2588
|
const roots = [...deps, ...strings];
|
|
2526
2589
|
const query = `kind("${QUERIED_RULES.join("|")}", deps(set(${roots.join(" ")})))${infoplists.length > 0 ? ` + set(${infoplists.join(" ")})` : ""}`;
|
|
2527
|
-
const
|
|
2590
|
+
const output = run2(["cquery", query, ...flags, "--output=jsonproto"]);
|
|
2528
2591
|
const defaults = run2([
|
|
2529
2592
|
"cquery",
|
|
2530
2593
|
query,
|
|
@@ -2540,7 +2603,7 @@ function bazelGraph(root, label, configuration) {
|
|
|
2540
2603
|
`${file}.partial`,
|
|
2541
2604
|
JSON.stringify({
|
|
2542
2605
|
application,
|
|
2543
|
-
cquery:
|
|
2606
|
+
cquery: output,
|
|
2544
2607
|
defaults,
|
|
2545
2608
|
info: info2,
|
|
2546
2609
|
bin: bin.slice(0, bin.indexOf("/bin/") + 4)
|
|
@@ -2613,7 +2676,7 @@ var BazelFiles = class {
|
|
|
2613
2676
|
this.graph = graph;
|
|
2614
2677
|
this.root = root;
|
|
2615
2678
|
for (const rule of graph.rules.values())
|
|
2616
|
-
for (const
|
|
2679
|
+
for (const output of rule.outputs) this.generated.add(output);
|
|
2617
2680
|
}
|
|
2618
2681
|
generated = /* @__PURE__ */ new Set();
|
|
2619
2682
|
repoDir(repo) {
|
|
@@ -2655,7 +2718,7 @@ var BazelFiles = class {
|
|
|
2655
2718
|
if (actual) visit(actual, label, seen);
|
|
2656
2719
|
} else if (rule.ruleClass === "filegroup")
|
|
2657
2720
|
for (const item of rule.attrs.get("srcs")?.list ?? []) visit(item, label, seen);
|
|
2658
|
-
else for (const
|
|
2721
|
+
else for (const output of rule.outputs) files.push(this.path(output));
|
|
2659
2722
|
};
|
|
2660
2723
|
for (const label of labels) visit(label, from, /* @__PURE__ */ new Set());
|
|
2661
2724
|
return [...new Set(files)];
|
|
@@ -2841,7 +2904,7 @@ function readBazelAppTarget(buildFile, targetName, configurationName, options =
|
|
|
2841
2904
|
const textual = new Set(
|
|
2842
2905
|
files.expand(rule.attrs.get("textual_hdrs")?.list ?? [], rule.label)
|
|
2843
2906
|
);
|
|
2844
|
-
const
|
|
2907
|
+
const text3 = `module ${moduleName} {
|
|
2845
2908
|
${published.map(
|
|
2846
2909
|
(file) => ` ${textual.has(file) ? "textual header" : "header"} "${import_node_path8.default.relative(import_node_path8.default.dirname(moduleMap), file)}"
|
|
2847
2910
|
`
|
|
@@ -2849,8 +2912,8 @@ ${published.map(
|
|
|
2849
2912
|
}
|
|
2850
2913
|
`;
|
|
2851
2914
|
import_node_fs6.default.mkdirSync(import_node_path8.default.dirname(moduleMap), { recursive: true });
|
|
2852
|
-
if (!import_node_fs6.default.existsSync(moduleMap) || import_node_fs6.default.readFileSync(moduleMap, "utf8") !==
|
|
2853
|
-
import_node_fs6.default.writeFileSync(moduleMap,
|
|
2915
|
+
if (!import_node_fs6.default.existsSync(moduleMap) || import_node_fs6.default.readFileSync(moduleMap, "utf8") !== text3)
|
|
2916
|
+
import_node_fs6.default.writeFileSync(moduleMap, text3);
|
|
2854
2917
|
const clangDefines = [...debug ? ["DEBUG=1"] : [], ...defines].map(
|
|
2855
2918
|
(define) => `-D${define}`
|
|
2856
2919
|
);
|
|
@@ -2968,8 +3031,8 @@ ${published.map(
|
|
|
2968
3031
|
].filter((file) => !import_node_fs6.default.existsSync(file));
|
|
2969
3032
|
const mirror = () => {
|
|
2970
3033
|
for (const rule of graph.rules.values())
|
|
2971
|
-
for (const
|
|
2972
|
-
const target = files.path(
|
|
3034
|
+
for (const output of rule.outputs) {
|
|
3035
|
+
const target = files.path(output);
|
|
2973
3036
|
if (target.endsWith(".a")) continue;
|
|
2974
3037
|
const source = import_node_path8.default.join(graph.outputs, import_node_path8.default.relative(graph.bin, target));
|
|
2975
3038
|
if (!import_node_fs6.default.existsSync(source)) continue;
|
|
@@ -2989,7 +3052,7 @@ ${published.map(
|
|
|
2989
3052
|
if (options.prepareGeneratedSources && absent().length > 0) {
|
|
2990
3053
|
const owners = /* @__PURE__ */ new Map();
|
|
2991
3054
|
for (const rule of graph.rules.values())
|
|
2992
|
-
for (const
|
|
3055
|
+
for (const output of rule.outputs) owners.set(files.path(output), rule.label);
|
|
2993
3056
|
const generators = [
|
|
2994
3057
|
...new Set(absent().flatMap((file) => owners.get(file) ?? []))
|
|
2995
3058
|
].sort();
|
|
@@ -3024,7 +3087,7 @@ ${published.map(
|
|
|
3024
3087
|
const label2 = canonicalLabel(raw, rule.label);
|
|
3025
3088
|
for (const archive of files.expand([raw], rule.label).filter((file) => file.endsWith(".a"))) {
|
|
3026
3089
|
const owner = [...graph.rules.values()].find(
|
|
3027
|
-
(item) => item.outputs.some((
|
|
3090
|
+
(item) => item.outputs.some((output) => files.path(output) === archive)
|
|
3028
3091
|
);
|
|
3029
3092
|
const key = owner?.label ?? label2;
|
|
3030
3093
|
const entry = archives.get(key) ?? {
|
|
@@ -3576,100 +3639,59 @@ var ios_sdk_frameworks_default = {
|
|
|
3576
3639
|
]
|
|
3577
3640
|
};
|
|
3578
3641
|
|
|
3579
|
-
// src/
|
|
3580
|
-
var import_node_crypto5 = require("node:crypto");
|
|
3642
|
+
// src/pod-graph-specifications.ts
|
|
3581
3643
|
var import_node_fs7 = __toESM(require("node:fs"), 1);
|
|
3582
|
-
var
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
throw new Error(`prepared Xcode output is outside its workspace: ${file}`);
|
|
3589
|
-
return relative2.split(import_node_path9.default.sep).join("/");
|
|
3590
|
-
}
|
|
3591
|
-
function output(root, file) {
|
|
3592
|
-
const relative2 = relativeFile(root, file);
|
|
3593
|
-
const stat = import_node_fs7.default.statSync(file, { throwIfNoEntry: false });
|
|
3594
|
-
if (!stat) return { path: relative2, sha256: null };
|
|
3595
|
-
if (!stat.isFile()) throw new Error(`prepared Xcode output is not a file: ${file}`);
|
|
3596
|
-
relativeFile(root, import_node_fs7.default.realpathSync(file));
|
|
3597
|
-
const bytes = import_node_fs7.default.readFileSync(file);
|
|
3598
|
-
const prefix = Buffer.from(root);
|
|
3599
|
-
const hash = (0, import_node_crypto5.createHash)("sha256");
|
|
3600
|
-
let offset = 0;
|
|
3601
|
-
for (let index = bytes.indexOf(prefix); index !== -1; index = bytes.indexOf(prefix, offset)) {
|
|
3602
|
-
hash.update(bytes.subarray(offset, index)).update("\0workspace\0");
|
|
3603
|
-
offset = index + prefix.length;
|
|
3604
|
-
}
|
|
3605
|
-
hash.update(bytes.subarray(offset));
|
|
3606
|
-
return {
|
|
3607
|
-
path: relative2,
|
|
3608
|
-
sha256: hash.digest("hex")
|
|
3609
|
-
};
|
|
3610
|
-
}
|
|
3611
|
-
function preparedXcodePhase(project, target, phase, configuration, outputs, recorded) {
|
|
3612
|
-
const root = recording?.root ?? [...workspaces.keys()].find((root2) => {
|
|
3613
|
-
const relative2 = import_node_path9.default.relative(root2, project);
|
|
3614
|
-
return relative2 !== ".." && !relative2.startsWith(`..${import_node_path9.default.sep}`) && !import_node_path9.default.isAbsolute(relative2);
|
|
3615
|
-
});
|
|
3616
|
-
if (!root) return false;
|
|
3617
|
-
const entry = {
|
|
3618
|
-
project: relativeFile(root, project),
|
|
3619
|
-
target,
|
|
3620
|
-
phase,
|
|
3621
|
-
configuration,
|
|
3622
|
-
outputs: outputs.map((file) => output(root, file))
|
|
3623
|
-
};
|
|
3624
|
-
if (recorded) {
|
|
3625
|
-
if (recording) {
|
|
3626
|
-
const previous = recording.phases.find(
|
|
3627
|
-
(item) => item.project === entry.project && item.target === target && item.phase === phase && item.configuration === configuration
|
|
3628
|
-
);
|
|
3629
|
-
if (previous && JSON.stringify(previous.outputs) !== JSON.stringify(entry.outputs))
|
|
3630
|
-
throw new Error(
|
|
3631
|
-
`Xcode phase produced inconsistent outputs: ${project} ${target} ${phase}`
|
|
3632
|
-
);
|
|
3633
|
-
if (!previous) recording.phases.push(entry);
|
|
3634
|
-
}
|
|
3635
|
-
return false;
|
|
3636
|
-
}
|
|
3637
|
-
if (recording) return false;
|
|
3638
|
-
const expected = workspaces.get(root)?.phases.find(
|
|
3639
|
-
(item) => item.project === entry.project && item.target === target && item.phase === phase && item.configuration === configuration
|
|
3640
|
-
);
|
|
3641
|
-
if (!expected || JSON.stringify(expected.outputs) !== JSON.stringify(entry.outputs))
|
|
3642
|
-
throw new Error(
|
|
3643
|
-
`prepared Xcode phase does not match its attested outputs: ${project} ${target} ${phase}`
|
|
3644
|
-
);
|
|
3645
|
-
return true;
|
|
3644
|
+
var POD_GRAPH_SPECIFICATIONS = ".peach-podspecs.json";
|
|
3645
|
+
function readPodGraphSpecifications(file) {
|
|
3646
|
+
const value = JSON.parse(import_node_fs7.default.readFileSync(file, "utf8"));
|
|
3647
|
+
if (!isRecord(value) || !Object.values(value).every((item) => typeof item === "string"))
|
|
3648
|
+
throw new Error(`${file}: invalid pod graph specifications`);
|
|
3649
|
+
return new Map(Object.entries(value).map(([name, json]) => [name, String(json)]));
|
|
3646
3650
|
}
|
|
3647
3651
|
|
|
3648
3652
|
// src/swift-binary-modules.ts
|
|
3649
|
-
var
|
|
3653
|
+
var import_node_crypto6 = require("node:crypto");
|
|
3650
3654
|
var import_node_fs9 = __toESM(require("node:fs"), 1);
|
|
3651
|
-
var
|
|
3655
|
+
var import_node_path10 = __toESM(require("node:path"), 1);
|
|
3652
3656
|
|
|
3653
3657
|
// src/home-paths.ts
|
|
3654
|
-
var
|
|
3658
|
+
var import_node_crypto5 = require("node:crypto");
|
|
3655
3659
|
var import_node_fs8 = __toESM(require("node:fs"), 1);
|
|
3656
3660
|
var import_node_os3 = require("node:os");
|
|
3657
|
-
var
|
|
3661
|
+
var import_node_path9 = __toESM(require("node:path"), 1);
|
|
3658
3662
|
var PEACH_HOME_ENV = "PEACH_HOME";
|
|
3663
|
+
var ACTIVE_RUNTIME_FILE = "active";
|
|
3659
3664
|
function ambientHomeDir() {
|
|
3660
|
-
return
|
|
3665
|
+
return import_node_path9.default.join((0, import_node_os3.homedir)(), ".peach");
|
|
3661
3666
|
}
|
|
3662
3667
|
function rnxHomeDir() {
|
|
3663
3668
|
const override = process.env[PEACH_HOME_ENV];
|
|
3664
|
-
return override && override.length > 0 ?
|
|
3669
|
+
return override && override.length > 0 ? import_node_path9.default.resolve(override) : ambientHomeDir();
|
|
3670
|
+
}
|
|
3671
|
+
function runtimesDir() {
|
|
3672
|
+
return import_node_path9.default.join(rnxHomeDir(), "runtimes");
|
|
3673
|
+
}
|
|
3674
|
+
function runtimeDir(version) {
|
|
3675
|
+
return import_node_path9.default.join(runtimesDir(), version);
|
|
3676
|
+
}
|
|
3677
|
+
function activeRuntimeFile() {
|
|
3678
|
+
return import_node_path9.default.join(runtimesDir(), ACTIVE_RUNTIME_FILE);
|
|
3665
3679
|
}
|
|
3666
3680
|
function cacheDir() {
|
|
3667
|
-
return
|
|
3681
|
+
return import_node_path9.default.join(rnxHomeDir(), "cache");
|
|
3682
|
+
}
|
|
3683
|
+
function readActiveRuntime() {
|
|
3684
|
+
try {
|
|
3685
|
+
const value = import_node_fs8.default.readFileSync(activeRuntimeFile(), "utf8").trim();
|
|
3686
|
+
return value.length > 0 ? value : null;
|
|
3687
|
+
} catch {
|
|
3688
|
+
return null;
|
|
3689
|
+
}
|
|
3668
3690
|
}
|
|
3669
3691
|
var DAEMON_LOCKFILE_MAX_BYTES = 16 * 1024;
|
|
3670
3692
|
|
|
3671
3693
|
// src/swift-binary-modules.ts
|
|
3672
|
-
var cacheDir2 =
|
|
3694
|
+
var cacheDir2 = import_node_path10.default.join(cacheDir(), "swift-binary-modules");
|
|
3673
3695
|
function frameworkModules(paths) {
|
|
3674
3696
|
const modules = /* @__PURE__ */ new Set();
|
|
3675
3697
|
for (const file of paths) {
|
|
@@ -3683,17 +3705,17 @@ function localSwiftBinaryModules(dir) {
|
|
|
3683
3705
|
const slices = import_node_fs9.default.readdirSync(dir, { withFileTypes: true }).filter((slice) => slice.isDirectory());
|
|
3684
3706
|
const frameworks = frameworkModules(
|
|
3685
3707
|
slices.flatMap(
|
|
3686
|
-
(slice) => import_node_fs9.default.readdirSync(
|
|
3708
|
+
(slice) => import_node_fs9.default.readdirSync(import_node_path10.default.join(dir, slice.name)).map((entry) => `${slice.name}/${entry}`)
|
|
3687
3709
|
)
|
|
3688
3710
|
);
|
|
3689
3711
|
if (frameworks.length > 0) return frameworks;
|
|
3690
3712
|
const modules = /* @__PURE__ */ new Set();
|
|
3691
3713
|
for (const slice of slices) {
|
|
3692
|
-
const headers =
|
|
3714
|
+
const headers = import_node_path10.default.join(dir, slice.name, "Headers");
|
|
3693
3715
|
if (!import_node_fs9.default.existsSync(headers)) continue;
|
|
3694
3716
|
for (const file of import_node_fs9.default.readdirSync(headers, { recursive: true, encoding: "utf8" })) {
|
|
3695
|
-
if (
|
|
3696
|
-
const module2 = moduleMapName(import_node_fs9.default.readFileSync(
|
|
3717
|
+
if (import_node_path10.default.basename(file) !== "module.modulemap") continue;
|
|
3718
|
+
const module2 = moduleMapName(import_node_fs9.default.readFileSync(import_node_path10.default.join(headers, file), "utf8"));
|
|
3697
3719
|
if (module2) modules.add(module2);
|
|
3698
3720
|
}
|
|
3699
3721
|
}
|
|
@@ -3701,19 +3723,19 @@ function localSwiftBinaryModules(dir) {
|
|
|
3701
3723
|
}
|
|
3702
3724
|
|
|
3703
3725
|
// src/swift-coverage/xcode-assets.ts
|
|
3704
|
-
var
|
|
3726
|
+
var import_node_crypto8 = require("node:crypto");
|
|
3705
3727
|
var import_node_fs12 = require("node:fs");
|
|
3706
|
-
var
|
|
3728
|
+
var import_node_path13 = require("node:path");
|
|
3707
3729
|
|
|
3708
3730
|
// src/swift-coverage/provenance.ts
|
|
3709
|
-
var
|
|
3731
|
+
var import_node_crypto7 = require("node:crypto");
|
|
3710
3732
|
var import_node_fs10 = require("node:fs");
|
|
3711
|
-
var
|
|
3712
|
-
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":"65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa","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":"f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c","swift-coverage/reader.ts":"da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c","swift-coverage/provenance.ts":"f5039c16e63c6129e22b71203f58982c68cef6e282a4f236b93da28edd39c108","swift-package-manifest.ts":"
|
|
3733
|
+
var import_node_path11 = require("node:path");
|
|
3734
|
+
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":"65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa","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":"f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c","swift-coverage/reader.ts":"da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c","swift-coverage/provenance.ts":"f5039c16e63c6129e22b71203f58982c68cef6e282a4f236b93da28edd39c108","swift-package-manifest.ts":"a29021d65b39fb2fd2301b1e235d5913662e65f23f4565a7f391f73661951725","swift-package.ts":"851417572ca9aff699ad368bdc3ff05309b0256e483d40812b9c0beb869d0a5b","swift-source-file.ts":"8becce5e73b76a61d9d202c1ecfb39b1238e9bbf0e77841f1c51c98fa9ac7bd3","swift-toolchain.ts":"407dafd67b3369981c1d91f67c8ea26580b478e15528d1a2c255af7bf6bfd40d","home-paths.ts":"d1606390f0e8e50f0ff72544eadb3d49dfabf08e004c1218f2998c36fb8995dd","xcode-header-search.ts":"4a775ba92c7b23ce71dd6bb08c188c4bccd6e1ed500cc9fc7850030b945fc8d4","xcode-project.ts":"2806d7a7a347e63313177f63a8c450c0a1926a3a30bc44864872f423a28806d8","xcode-target-members.ts":"2f25aaf5a3aa34395983c75935491c06bd68554c47ff1cb06b49c79499c03db0","xcode-json-project.ts":"41990ebbe4b488eef34e74c4608b4b48e5a5b299ba98ca7fbcfdfa0e77be63b6","openstep-plist.ts":"74e6ce1dac80c9c318e0e9f5e3e8cd19a898a8820c36fc160609695bcb59dcd3"}') : swiftCoverageSourceDigests((0, import_node_path11.join)(__sootsim_import_meta_dirname, ".."));
|
|
3713
3735
|
|
|
3714
3736
|
// src/swift-coverage/xcode-asset-symbols.ts
|
|
3715
3737
|
var import_node_fs11 = require("node:fs");
|
|
3716
|
-
var
|
|
3738
|
+
var import_node_path12 = require("node:path");
|
|
3717
3739
|
var silentTypes = /* @__PURE__ */ new Set([
|
|
3718
3740
|
"appiconset",
|
|
3719
3741
|
"brandassets",
|
|
@@ -3894,31 +3916,44 @@ var assetSymbolSettingKeys = [
|
|
|
3894
3916
|
"ASSETCATALOG_OTHER_FLAGS"
|
|
3895
3917
|
];
|
|
3896
3918
|
|
|
3897
|
-
// src/
|
|
3898
|
-
var
|
|
3899
|
-
var
|
|
3900
|
-
var
|
|
3901
|
-
var import_node_os13 = __toESM(require("node:os"), 1);
|
|
3902
|
-
var import_node_path43 = __toESM(require("node:path"), 1);
|
|
3903
|
-
var import_node_util4 = require("node:util");
|
|
3919
|
+
// src/answeredNativePackages.ts
|
|
3920
|
+
var import_node_async_hooks = require("node:async_hooks");
|
|
3921
|
+
var import_node_fs17 = require("node:fs");
|
|
3922
|
+
var import_node_path17 = require("node:path");
|
|
3904
3923
|
|
|
3905
|
-
// src/
|
|
3906
|
-
var
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3924
|
+
// src/launchMetadataContract.ts
|
|
3925
|
+
var LAUNCH_METADATA_KEYS_PATH = "node/launch-metadata-keys.json";
|
|
3926
|
+
var LAUNCH_METADATA_KEYS = [
|
|
3927
|
+
"appFonts",
|
|
3928
|
+
"appSplash",
|
|
3929
|
+
"appCatalog",
|
|
3930
|
+
"appBundleResources",
|
|
3931
|
+
"nativeAppIdentity",
|
|
3932
|
+
"nativeFirebase",
|
|
3933
|
+
"expoSwift",
|
|
3934
|
+
"expoWidgets",
|
|
3935
|
+
"expoKotlin",
|
|
3936
|
+
"nitro",
|
|
3937
|
+
"turbo",
|
|
3938
|
+
"widgetExtension",
|
|
3939
|
+
"appManifest",
|
|
3940
|
+
"packageVersions",
|
|
3941
|
+
"dotEnv",
|
|
3942
|
+
"env"
|
|
3943
|
+
];
|
|
3944
|
+
var LAUNCH_METADATA_KEYS_BEFORE_RUNTIME_STATED_THEM = LAUNCH_METADATA_KEYS.filter((key) => key !== "widgetExtension");
|
|
3910
3945
|
|
|
3911
|
-
// src/
|
|
3912
|
-
var
|
|
3913
|
-
var
|
|
3914
|
-
var
|
|
3946
|
+
// src/runtime-assets.ts
|
|
3947
|
+
var import_fs = __toESM(require("fs"), 1);
|
|
3948
|
+
var import_path = __toESM(require("path"), 1);
|
|
3949
|
+
var import_url = require("url");
|
|
3915
3950
|
|
|
3916
3951
|
// ../contrast-runtime-delivery/src/index.ts
|
|
3917
3952
|
var import_node_child_process7 = require("node:child_process");
|
|
3918
|
-
var
|
|
3953
|
+
var import_node_crypto9 = __toESM(require("node:crypto"), 1);
|
|
3919
3954
|
var import_node_fs16 = __toESM(require("node:fs"), 1);
|
|
3920
3955
|
var import_node_os6 = __toESM(require("node:os"), 1);
|
|
3921
|
-
var
|
|
3956
|
+
var import_node_path16 = __toESM(require("node:path"), 1);
|
|
3922
3957
|
var import_promises3 = require("node:stream/promises");
|
|
3923
3958
|
var import_node_zlib2 = __toESM(require("node:zlib"), 1);
|
|
3924
3959
|
|
|
@@ -3926,7 +3961,7 @@ var import_node_zlib2 = __toESM(require("node:zlib"), 1);
|
|
|
3926
3961
|
var import_node_child_process6 = require("node:child_process");
|
|
3927
3962
|
var import_node_fs14 = require("node:fs");
|
|
3928
3963
|
var import_node_os5 = require("node:os");
|
|
3929
|
-
var
|
|
3964
|
+
var import_node_path14 = require("node:path");
|
|
3930
3965
|
var import_node_stream = require("node:stream");
|
|
3931
3966
|
var import_promises2 = require("node:timers/promises");
|
|
3932
3967
|
|
|
@@ -3937,19 +3972,269 @@ var import_node_os4 = require("node:os");
|
|
|
3937
3972
|
|
|
3938
3973
|
// ../contrast-runtime-delivery/src/product.ts
|
|
3939
3974
|
var import_node_fs15 = __toESM(require("node:fs"), 1);
|
|
3940
|
-
var
|
|
3975
|
+
var import_node_path15 = __toESM(require("node:path"), 1);
|
|
3976
|
+
|
|
3977
|
+
// src/runtime-assets.ts
|
|
3978
|
+
var _monorepoRootCache;
|
|
3979
|
+
function findMonorepoRoot() {
|
|
3980
|
+
if (_monorepoRootCache !== void 0) return _monorepoRootCache;
|
|
3981
|
+
let dir = import_path.default.dirname((0, import_url.fileURLToPath)(__sootsim_import_meta_url));
|
|
3982
|
+
for (let i = 0; i < 12 && dir !== import_path.default.dirname(dir); i++) {
|
|
3983
|
+
if (import_fs.default.existsSync(import_path.default.join(dir, "packages/peach-engine/package.json")) && import_fs.default.existsSync(import_path.default.join(dir, "public/sootsim"))) {
|
|
3984
|
+
_monorepoRootCache = dir;
|
|
3985
|
+
return dir;
|
|
3986
|
+
}
|
|
3987
|
+
dir = import_path.default.dirname(dir);
|
|
3988
|
+
}
|
|
3989
|
+
_monorepoRootCache = null;
|
|
3990
|
+
return null;
|
|
3991
|
+
}
|
|
3992
|
+
function resolveDevCheckoutRuntimeAssetRoot() {
|
|
3993
|
+
if (process.env.PEACH_HOME && readActiveRuntime()) return null;
|
|
3994
|
+
const root = findMonorepoRoot();
|
|
3995
|
+
if (!root) return null;
|
|
3996
|
+
return import_path.default.join(root, "public/sootsim");
|
|
3997
|
+
}
|
|
3998
|
+
function resolveDevCheckoutRuntimeRoot() {
|
|
3999
|
+
const devBuild = resolveDevCheckoutRuntimeAssetRoot();
|
|
4000
|
+
if (!devBuild) return null;
|
|
4001
|
+
if (import_fs.default.existsSync(import_path.default.join(devBuild, "index.html")) && import_fs.default.existsSync(import_path.default.join(devBuild, "engine/index.html")) && import_fs.default.existsSync(import_path.default.join(devBuild, "engine-tenant/worker.js")) && import_fs.default.existsSync(import_path.default.join(devBuild, "engine-tenant/worker.prod.js"))) {
|
|
4002
|
+
return devBuild;
|
|
4003
|
+
}
|
|
4004
|
+
return null;
|
|
4005
|
+
}
|
|
4006
|
+
function resolveActiveRuntimeRoot() {
|
|
4007
|
+
const devRoot = resolveDevCheckoutRuntimeRoot();
|
|
4008
|
+
if (devRoot) return devRoot;
|
|
4009
|
+
const active = readActiveRuntime();
|
|
4010
|
+
if (!active) return null;
|
|
4011
|
+
const dir = runtimeDir(active);
|
|
4012
|
+
if (!import_fs.default.existsSync(import_path.default.join(dir, "index.html"))) return null;
|
|
4013
|
+
return dir;
|
|
4014
|
+
}
|
|
4015
|
+
|
|
4016
|
+
// src/answeredNativePackages.ts
|
|
4017
|
+
var runtimeLaunchMetadataKeysFile = {
|
|
4018
|
+
path: LAUNCH_METADATA_KEYS_PATH,
|
|
4019
|
+
contents: `${JSON.stringify(LAUNCH_METADATA_KEYS)}
|
|
4020
|
+
`
|
|
4021
|
+
};
|
|
4022
|
+
var unansweredStore = new import_node_async_hooks.AsyncLocalStorage();
|
|
4023
|
+
var answeredStore = new import_node_async_hooks.AsyncLocalStorage();
|
|
4024
|
+
function peachRuntimeRoot() {
|
|
4025
|
+
const root = resolveDevCheckoutRuntimeAssetRoot() ?? resolveActiveRuntimeRoot();
|
|
4026
|
+
if (!root) throw new Error("No Peach runtime installed; run `peach runtime install`");
|
|
4027
|
+
return root;
|
|
4028
|
+
}
|
|
4029
|
+
function readPeachRuntimeJson(relative2) {
|
|
4030
|
+
try {
|
|
4031
|
+
return JSON.parse((0, import_node_fs17.readFileSync)((0, import_node_path17.join)(peachRuntimeRoot(), relative2), "utf8"));
|
|
4032
|
+
} catch (error) {
|
|
4033
|
+
if (error instanceof Error && "code" in error && error.code === "ENOENT")
|
|
4034
|
+
throw new Error(
|
|
4035
|
+
`The active Peach runtime predates ${relative2}; run \`peach runtime install\``
|
|
4036
|
+
);
|
|
4037
|
+
throw error;
|
|
4038
|
+
}
|
|
4039
|
+
}
|
|
4040
|
+
|
|
4041
|
+
// src/nitroAdapterContract.ts
|
|
4042
|
+
var import_node_crypto10 = require("node:crypto");
|
|
4043
|
+
var import_node_fs18 = require("node:fs");
|
|
4044
|
+
var import_node_path18 = __toESM(require("node:path"), 1);
|
|
4045
|
+
var ADAPTER_FAMILIES = {
|
|
4046
|
+
nitro: {
|
|
4047
|
+
label: "Nitro adapter",
|
|
4048
|
+
archive: "libPeachNitroAdapter.a",
|
|
4049
|
+
key: "nitro-adapter",
|
|
4050
|
+
headers: ["reactNativeJsi", "nitroModules"]
|
|
4051
|
+
},
|
|
4052
|
+
turbo: {
|
|
4053
|
+
label: "TurboModule runtime",
|
|
4054
|
+
archive: "libPeachTurboRuntime.a",
|
|
4055
|
+
key: "turbo-runtime",
|
|
4056
|
+
headers: ["reactNativeJsi"]
|
|
4057
|
+
}
|
|
4058
|
+
};
|
|
4059
|
+
var hex64 = (value) => typeof value === "string" && /^[a-f0-9]{64}$/.test(value);
|
|
4060
|
+
function text(family, value, what) {
|
|
4061
|
+
if (typeof value !== "string" || !value)
|
|
4062
|
+
throw new Error(`invalid ${ADAPTER_FAMILIES[family].label} ${what}`);
|
|
4063
|
+
return value;
|
|
4064
|
+
}
|
|
4065
|
+
function digestField(family, value, what) {
|
|
4066
|
+
if (!hex64(value)) throw new Error(`invalid ${ADAPTER_FAMILIES[family].label} ${what}`);
|
|
4067
|
+
return value;
|
|
4068
|
+
}
|
|
4069
|
+
function headerSet(family, value) {
|
|
4070
|
+
const keys = ADAPTER_FAMILIES[family].headers;
|
|
4071
|
+
if (!isRecord(value) || Object.keys(value).length !== keys.length)
|
|
4072
|
+
throw new Error(`invalid ${ADAPTER_FAMILIES[family].label} headers`);
|
|
4073
|
+
return Object.fromEntries(
|
|
4074
|
+
keys.map((key) => [key, digestField(family, value[key], `${key} header digest`)])
|
|
4075
|
+
);
|
|
4076
|
+
}
|
|
4077
|
+
function identity(family, value) {
|
|
4078
|
+
const invalid = () => new Error(`invalid ${ADAPTER_FAMILIES[family].label} manifest`);
|
|
4079
|
+
if (!isRecord(value) || value.schema !== 1) throw invalid();
|
|
4080
|
+
const { adapter, sdk, framework } = value;
|
|
4081
|
+
if (!isRecord(adapter) || !isRecord(sdk) || !isRecord(framework)) throw invalid();
|
|
4082
|
+
return {
|
|
4083
|
+
schema: 1,
|
|
4084
|
+
platform: text(family, value.platform, "platform"),
|
|
4085
|
+
target: text(family, value.target, "target"),
|
|
4086
|
+
recipe: digestField(family, value.recipe, "recipe"),
|
|
4087
|
+
adapter: { sha256: digestField(family, adapter.sha256, "adapter digest") },
|
|
4088
|
+
headers: headerSet(family, value.headers),
|
|
4089
|
+
compiler: text(family, value.compiler, "compiler"),
|
|
4090
|
+
sdk: {
|
|
4091
|
+
id: text(family, sdk.id, "sdk id"),
|
|
4092
|
+
checksum: digestField(family, sdk.checksum, "sdk checksum")
|
|
4093
|
+
},
|
|
4094
|
+
framework: {
|
|
4095
|
+
distribution: text(family, framework.distribution, "distribution"),
|
|
4096
|
+
wireAbi: digestField(family, framework.wireAbi, "wire abi")
|
|
4097
|
+
}
|
|
4098
|
+
};
|
|
4099
|
+
}
|
|
4100
|
+
var sameHeaders = (a, b) => JSON.stringify(a) === JSON.stringify(b);
|
|
4101
|
+
function parseAdapterLock(family, value) {
|
|
4102
|
+
const label = ADAPTER_FAMILIES[family].label;
|
|
4103
|
+
if (!isRecord(value) || value.schema !== 2 || !Array.isArray(value.archives))
|
|
4104
|
+
throw new Error(`invalid ${label} lock`);
|
|
4105
|
+
const { headers: _headers, ...shared } = identity(family, {
|
|
4106
|
+
...value,
|
|
4107
|
+
schema: 1,
|
|
4108
|
+
headers: Object.fromEntries(
|
|
4109
|
+
ADAPTER_FAMILIES[family].headers.map((key) => [key, "0".repeat(64)])
|
|
4110
|
+
)
|
|
4111
|
+
});
|
|
4112
|
+
const archives = value.archives.map((entry) => {
|
|
4113
|
+
if (!isRecord(entry) || typeof entry.size !== "number")
|
|
4114
|
+
throw new Error(`invalid ${label} lock archive`);
|
|
4115
|
+
return {
|
|
4116
|
+
headers: headerSet(family, entry.headers),
|
|
4117
|
+
sha256: digestField(family, entry.sha256, "lock archive digest"),
|
|
4118
|
+
size: entry.size
|
|
4119
|
+
};
|
|
4120
|
+
});
|
|
4121
|
+
archives.forEach((entry, index) => {
|
|
4122
|
+
if (archives.findIndex((other) => sameHeaders(other.headers, entry.headers)) !== index)
|
|
4123
|
+
throw new Error(`${label} lock repeats a header set`);
|
|
4124
|
+
});
|
|
4125
|
+
return { ...shared, schema: 2, archives };
|
|
4126
|
+
}
|
|
4127
|
+
|
|
4128
|
+
// src/swift-distribution-contract.ts
|
|
4129
|
+
var isStrings = (value) => Array.isArray(value) && value.every((item) => typeof item === "string");
|
|
4130
|
+
function parseSwiftDistributionLock(value) {
|
|
4131
|
+
if (!isRecord(value) || typeof value.id !== "string" || !/^[a-f0-9]{16}$/.test(value.id) || typeof value.release !== "string" || typeof value.wasmSdkId !== "string" || typeof value.wasmSdkUrl !== "string" || typeof value.wasmSdkChecksum !== "string" || typeof value.source !== "string" || !isStrings(value.targets) || !isRecord(value.systemEnvironment) || !Object.values(value.systemEnvironment).every(isStrings) || !isRecord(value.hosts)) {
|
|
4132
|
+
throw new Error("invalid Swift distribution lock");
|
|
4133
|
+
}
|
|
4134
|
+
const hosts = value.hosts;
|
|
4135
|
+
const entry = (host2) => {
|
|
4136
|
+
const item = hosts[host2];
|
|
4137
|
+
if (!isRecord(item) || typeof item.sha256 !== "string" || !/^[a-f0-9]{64}$/.test(item.sha256) || typeof item.size !== "number") {
|
|
4138
|
+
throw new Error(`invalid Swift distribution lock entry for ${host2}`);
|
|
4139
|
+
}
|
|
4140
|
+
return { sha256: item.sha256, size: item.size };
|
|
4141
|
+
};
|
|
4142
|
+
return {
|
|
4143
|
+
id: value.id,
|
|
4144
|
+
release: value.release,
|
|
4145
|
+
wasmSdkId: value.wasmSdkId,
|
|
4146
|
+
wasmSdkUrl: value.wasmSdkUrl,
|
|
4147
|
+
wasmSdkChecksum: value.wasmSdkChecksum,
|
|
4148
|
+
source: value.source,
|
|
4149
|
+
targets: value.targets,
|
|
4150
|
+
systemEnvironment: Object.fromEntries(
|
|
4151
|
+
Object.entries(value.systemEnvironment).map(([key, values]) => {
|
|
4152
|
+
if (!isStrings(values))
|
|
4153
|
+
throw new Error(`invalid Swift system environment values for ${key}`);
|
|
4154
|
+
return [key, values];
|
|
4155
|
+
})
|
|
4156
|
+
),
|
|
4157
|
+
hosts: {
|
|
4158
|
+
"darwin-arm64": entry("darwin-arm64"),
|
|
4159
|
+
"linux-x64": entry("linux-x64"),
|
|
4160
|
+
"linux-arm64": entry("linux-arm64")
|
|
4161
|
+
}
|
|
4162
|
+
};
|
|
4163
|
+
}
|
|
4164
|
+
|
|
4165
|
+
// src/swiftNativePinContract.ts
|
|
4166
|
+
var SWIFT_NATIVE_PIN_PATH = "node/swift-native.json";
|
|
4167
|
+
var SWIFT_NATIVE_PIN_SCHEMA = 3;
|
|
4168
|
+
var DIGEST = /^[a-f0-9]{64}$/;
|
|
4169
|
+
function parseSwiftNativePin(value) {
|
|
4170
|
+
if (!isRecord(value)) throw new Error("invalid Swift native pin");
|
|
4171
|
+
if (value.schema !== SWIFT_NATIVE_PIN_SCHEMA)
|
|
4172
|
+
throw new Error(
|
|
4173
|
+
typeof value.schema === "number" && value.schema > SWIFT_NATIVE_PIN_SCHEMA ? "the active Peach runtime pins Swift for a newer peach CLI; update peach" : "the active Peach runtime pins Swift for an older peach CLI; run `peach runtime install`"
|
|
4174
|
+
);
|
|
4175
|
+
const { compiler, adapters } = value;
|
|
4176
|
+
if (!isRecord(compiler) || typeof compiler.identity !== "string" || compiler.archive !== "tar.gz" && compiler.archive !== "tar.zst" || !isRecord(compiler.hosts) || !isRecord(adapters))
|
|
4177
|
+
throw new Error("invalid Swift native pin");
|
|
4178
|
+
const hosts = {};
|
|
4179
|
+
for (const [host2, archive] of Object.entries(compiler.hosts)) {
|
|
4180
|
+
if (!isRecord(archive) || typeof archive.checksum !== "string" || !DIGEST.test(archive.checksum) || typeof archive.manifest !== "string" || !DIGEST.test(archive.manifest))
|
|
4181
|
+
throw new Error(`invalid Swift native pin compiler entry for ${host2}`);
|
|
4182
|
+
hosts[host2] = { checksum: archive.checksum, manifest: archive.manifest };
|
|
4183
|
+
}
|
|
4184
|
+
return {
|
|
4185
|
+
schema: SWIFT_NATIVE_PIN_SCHEMA,
|
|
4186
|
+
distribution: parseSwiftDistributionLock(value.distribution),
|
|
4187
|
+
compiler: { identity: compiler.identity, archive: compiler.archive, hosts },
|
|
4188
|
+
adapters: {
|
|
4189
|
+
nitro: parseAdapterLock("nitro", adapters.nitro),
|
|
4190
|
+
turbo: parseAdapterLock("turbo", adapters.turbo)
|
|
4191
|
+
}
|
|
4192
|
+
};
|
|
4193
|
+
}
|
|
4194
|
+
|
|
4195
|
+
// src/swift-native-pin.ts
|
|
4196
|
+
var pin;
|
|
4197
|
+
function swiftNativePin() {
|
|
4198
|
+
if (pin) return pin;
|
|
4199
|
+
if (true) {
|
|
4200
|
+
pin = parseSwiftNativePin(readPeachRuntimeJson(SWIFT_NATIVE_PIN_PATH));
|
|
4201
|
+
registerSwiftHostCompiler(pin.distribution.release, pin.compiler);
|
|
4202
|
+
} else {
|
|
4203
|
+
pin = repoSwiftNativePin();
|
|
4204
|
+
}
|
|
4205
|
+
return pin;
|
|
4206
|
+
}
|
|
4207
|
+
|
|
4208
|
+
// src/swift-package-manifest.ts
|
|
4209
|
+
var import_node_child_process23 = require("node:child_process");
|
|
4210
|
+
var import_node_crypto24 = require("node:crypto");
|
|
4211
|
+
var import_node_fs42 = __toESM(require("node:fs"), 1);
|
|
4212
|
+
var import_node_os13 = __toESM(require("node:os"), 1);
|
|
4213
|
+
var import_node_path42 = __toESM(require("node:path"), 1);
|
|
4214
|
+
var import_node_util4 = require("node:util");
|
|
4215
|
+
|
|
4216
|
+
// src/git-repo-env.ts
|
|
4217
|
+
var UNATTENDED_GIT_ENV = {
|
|
4218
|
+
GIT_TERMINAL_PROMPT: "0",
|
|
4219
|
+
GIT_SSH_COMMAND: process.env.GIT_SSH_COMMAND ?? "ssh -o BatchMode=yes"
|
|
4220
|
+
};
|
|
4221
|
+
|
|
4222
|
+
// src/swift-distribution.ts
|
|
4223
|
+
var import_node_fs41 = __toESM(require("node:fs"), 1);
|
|
4224
|
+
var import_node_os12 = __toESM(require("node:os"), 1);
|
|
4225
|
+
var import_node_path41 = __toESM(require("node:path"), 1);
|
|
3941
4226
|
|
|
3942
4227
|
// cli/drivers/linux-browser-libs.ts
|
|
3943
4228
|
var import_node_child_process8 = require("node:child_process");
|
|
3944
|
-
var
|
|
3945
|
-
var
|
|
4229
|
+
var import_node_fs19 = require("node:fs");
|
|
4230
|
+
var import_node_path19 = require("node:path");
|
|
3946
4231
|
|
|
3947
4232
|
// src/swift-compile.ts
|
|
3948
4233
|
var import_node_child_process22 = require("node:child_process");
|
|
3949
4234
|
var import_node_crypto23 = require("node:crypto");
|
|
3950
|
-
var
|
|
4235
|
+
var import_node_fs40 = require("node:fs");
|
|
3951
4236
|
var import_node_os11 = __toESM(require("node:os"), 1);
|
|
3952
|
-
var
|
|
4237
|
+
var import_node_path40 = __toESM(require("node:path"), 1);
|
|
3953
4238
|
var v5 = __toESM(require("peachsim/vendor/valibot"), 1);
|
|
3954
4239
|
|
|
3955
4240
|
// src/admitted-mac-build.ts
|
|
@@ -3957,46 +4242,46 @@ var import_node_child_process9 = require("node:child_process");
|
|
|
3957
4242
|
|
|
3958
4243
|
// src/retired-cache-directory.ts
|
|
3959
4244
|
var import_node_crypto11 = require("node:crypto");
|
|
3960
|
-
var
|
|
4245
|
+
var import_node_fs21 = require("node:fs");
|
|
3961
4246
|
var import_promises4 = require("node:fs/promises");
|
|
3962
|
-
var
|
|
4247
|
+
var import_node_path20 = __toESM(require("node:path"), 1);
|
|
3963
4248
|
|
|
3964
4249
|
// src/process-liveness.ts
|
|
3965
|
-
var
|
|
4250
|
+
var import_node_fs20 = require("node:fs");
|
|
3966
4251
|
|
|
3967
4252
|
// src/swift-compiler-digest.ts
|
|
3968
4253
|
var import_node_crypto12 = require("node:crypto");
|
|
3969
|
-
var
|
|
3970
|
-
var
|
|
4254
|
+
var import_node_fs22 = require("node:fs");
|
|
4255
|
+
var import_node_path21 = __toESM(require("node:path"), 1);
|
|
3971
4256
|
|
|
3972
4257
|
// src/swift-darwin-records.ts
|
|
3973
4258
|
var import_node_child_process11 = require("node:child_process");
|
|
3974
|
-
var
|
|
4259
|
+
var import_node_fs24 = require("node:fs");
|
|
3975
4260
|
var import_node_os7 = require("node:os");
|
|
3976
|
-
var
|
|
4261
|
+
var import_node_path23 = __toESM(require("node:path"), 1);
|
|
3977
4262
|
|
|
3978
4263
|
// src/swift-shared-sdk.ts
|
|
3979
4264
|
var import_node_child_process10 = require("node:child_process");
|
|
3980
4265
|
var import_node_crypto13 = require("node:crypto");
|
|
3981
|
-
var
|
|
3982
|
-
var
|
|
4266
|
+
var import_node_fs23 = __toESM(require("node:fs"), 1);
|
|
4267
|
+
var import_node_path22 = __toESM(require("node:path"), 1);
|
|
3983
4268
|
|
|
3984
4269
|
// src/swift-guest-compile.ts
|
|
3985
4270
|
var import_node_child_process17 = require("node:child_process");
|
|
3986
|
-
var
|
|
3987
|
-
var
|
|
4271
|
+
var import_node_fs32 = require("node:fs");
|
|
4272
|
+
var import_node_path31 = __toESM(require("node:path"), 1);
|
|
3988
4273
|
|
|
3989
4274
|
// src/swift-guest-archive.ts
|
|
3990
4275
|
var import_node_child_process13 = require("node:child_process");
|
|
3991
4276
|
var import_node_crypto15 = require("node:crypto");
|
|
3992
|
-
var
|
|
3993
|
-
var
|
|
4277
|
+
var import_node_fs26 = require("node:fs");
|
|
4278
|
+
var import_node_path25 = __toESM(require("node:path"), 1);
|
|
3994
4279
|
|
|
3995
4280
|
// src/swift-wasm-prune.ts
|
|
3996
4281
|
var import_node_child_process12 = require("node:child_process");
|
|
3997
4282
|
var import_node_crypto14 = require("node:crypto");
|
|
3998
|
-
var
|
|
3999
|
-
var
|
|
4283
|
+
var import_node_fs25 = __toESM(require("node:fs"), 1);
|
|
4284
|
+
var import_node_path24 = __toESM(require("node:path"), 1);
|
|
4000
4285
|
var v2 = __toESM(require("peachsim/vendor/valibot"), 1);
|
|
4001
4286
|
|
|
4002
4287
|
// src/swiftRuntimeProductContract.ts
|
|
@@ -4144,26 +4429,26 @@ var SWIFTUI_WRAPPER_HOST_PROTOCOLS = new Set(
|
|
|
4144
4429
|
);
|
|
4145
4430
|
|
|
4146
4431
|
// src/swift-guest-link.ts
|
|
4147
|
-
var
|
|
4148
|
-
var
|
|
4149
|
-
var
|
|
4432
|
+
var import_node_child_process15 = require("node:child_process");
|
|
4433
|
+
var import_node_fs30 = __toESM(require("node:fs"), 1);
|
|
4434
|
+
var import_node_path29 = __toESM(require("node:path"), 1);
|
|
4150
4435
|
var import_node_string_decoder = require("node:string_decoder");
|
|
4151
4436
|
|
|
4152
4437
|
// src/swift-guest-manifest.ts
|
|
4153
4438
|
var import_node_crypto16 = require("node:crypto");
|
|
4154
|
-
var
|
|
4439
|
+
var import_node_fs27 = require("node:fs");
|
|
4155
4440
|
|
|
4156
4441
|
// src/swift-guest-projection-storage.ts
|
|
4157
4442
|
var maxProjectionRegions = 1 << 20;
|
|
4158
4443
|
|
|
4159
4444
|
// src/swift-guest-runtime-plan.ts
|
|
4160
4445
|
var import_node_crypto18 = require("node:crypto");
|
|
4161
|
-
var
|
|
4162
|
-
var
|
|
4446
|
+
var import_node_fs28 = require("node:fs");
|
|
4447
|
+
var import_node_path27 = __toESM(require("node:path"), 1);
|
|
4163
4448
|
var v4 = __toESM(require("peachsim/vendor/valibot"), 1);
|
|
4164
4449
|
|
|
4165
4450
|
// src/swift-guest-source-plan.ts
|
|
4166
|
-
var
|
|
4451
|
+
var import_node_path26 = __toESM(require("node:path"), 1);
|
|
4167
4452
|
|
|
4168
4453
|
// src/swift-runtime-products.ts
|
|
4169
4454
|
var import_node_crypto17 = require("node:crypto");
|
|
@@ -4187,16 +4472,10 @@ var packageSchema = v3.object({
|
|
|
4187
4472
|
)
|
|
4188
4473
|
});
|
|
4189
4474
|
|
|
4190
|
-
// src/swift-guest-source-inputs.ts
|
|
4191
|
-
var import_node_child_process15 = require("node:child_process");
|
|
4192
|
-
var import_node_crypto19 = require("node:crypto");
|
|
4193
|
-
var import_node_fs28 = require("node:fs");
|
|
4194
|
-
var import_node_path28 = __toESM(require("node:path"), 1);
|
|
4195
|
-
|
|
4196
4475
|
// src/wasm-optimize.ts
|
|
4197
|
-
var
|
|
4476
|
+
var import_node_child_process14 = require("node:child_process");
|
|
4198
4477
|
var import_node_fs29 = require("node:fs");
|
|
4199
|
-
var
|
|
4478
|
+
var import_node_path28 = require("node:path");
|
|
4200
4479
|
var import_node_util2 = require("node:util");
|
|
4201
4480
|
|
|
4202
4481
|
// src/binaryen.lock.json
|
|
@@ -4239,26 +4518,32 @@ var FEATURES = [
|
|
|
4239
4518
|
var KEEP_WASM_NAMES = process.env.PEACH_SWIFT_NAMES === "1";
|
|
4240
4519
|
var LOWERING = ["--memory64-lowering", "--table64-lowering"];
|
|
4241
4520
|
var BINARYEN_VERSION = binaryen_lock_default.version;
|
|
4242
|
-
var runBinaryen = (0, import_node_util2.promisify)(
|
|
4521
|
+
var runBinaryen = (0, import_node_util2.promisify)(import_node_child_process14.execFile);
|
|
4243
4522
|
var WASM_LOWER_IDENTITY = `binaryen ${BINARYEN_VERSION} narrow ${LOWERING.join(" ")} ${FEATURES.join(",")} unoptimized-names`;
|
|
4244
4523
|
var BINARYEN_RELEASES = new Map(Object.entries(binaryen_lock_default.platforms));
|
|
4245
4524
|
|
|
4525
|
+
// src/swift-guest-source-inputs.ts
|
|
4526
|
+
var import_node_child_process16 = require("node:child_process");
|
|
4527
|
+
var import_node_crypto19 = require("node:crypto");
|
|
4528
|
+
var import_node_fs31 = require("node:fs");
|
|
4529
|
+
var import_node_path30 = __toESM(require("node:path"), 1);
|
|
4530
|
+
|
|
4246
4531
|
// src/swift-header-compiler.ts
|
|
4247
4532
|
var import_node_crypto20 = require("node:crypto");
|
|
4248
|
-
var
|
|
4533
|
+
var import_node_fs33 = require("node:fs");
|
|
4249
4534
|
var import_node_http = require("node:http");
|
|
4250
|
-
var
|
|
4535
|
+
var import_node_path32 = __toESM(require("node:path"), 1);
|
|
4251
4536
|
|
|
4252
4537
|
// src/swift-header-dependencies.ts
|
|
4253
|
-
var
|
|
4538
|
+
var import_node_path33 = __toESM(require("node:path"), 1);
|
|
4254
4539
|
|
|
4255
4540
|
// src/swift-icu.ts
|
|
4256
4541
|
var import_node_child_process18 = require("node:child_process");
|
|
4257
4542
|
var import_node_crypto21 = require("node:crypto");
|
|
4258
|
-
var
|
|
4543
|
+
var import_node_fs34 = require("node:fs");
|
|
4259
4544
|
var import_promises5 = require("node:fs/promises");
|
|
4260
4545
|
var import_node_os8 = __toESM(require("node:os"), 1);
|
|
4261
|
-
var
|
|
4546
|
+
var import_node_path34 = __toESM(require("node:path"), 1);
|
|
4262
4547
|
var import_node_util3 = require("node:util");
|
|
4263
4548
|
var import_node_zlib3 = require("node:zlib");
|
|
4264
4549
|
|
|
@@ -4274,32 +4559,32 @@ var compressBrotli = (0, import_node_util3.promisify)(import_node_zlib3.brotliCo
|
|
|
4274
4559
|
var inflateGzip = (0, import_node_util3.promisify)(import_node_zlib3.gunzip);
|
|
4275
4560
|
|
|
4276
4561
|
// src/swift-link-roots.ts
|
|
4277
|
-
var
|
|
4278
|
-
var
|
|
4562
|
+
var import_node_fs35 = __toESM(require("node:fs"), 1);
|
|
4563
|
+
var import_node_path35 = __toESM(require("node:path"), 1);
|
|
4279
4564
|
|
|
4280
4565
|
// src/swift-project-user.ts
|
|
4281
4566
|
var import_node_child_process19 = require("node:child_process");
|
|
4282
|
-
var
|
|
4283
|
-
var
|
|
4567
|
+
var import_node_fs36 = require("node:fs");
|
|
4568
|
+
var import_node_path36 = __toESM(require("node:path"), 1);
|
|
4284
4569
|
|
|
4285
4570
|
// src/swift-reproducible.ts
|
|
4286
|
-
var
|
|
4571
|
+
var import_node_fs37 = require("node:fs");
|
|
4287
4572
|
var import_node_os9 = __toESM(require("node:os"), 1);
|
|
4288
4573
|
|
|
4289
4574
|
// src/swift-root-lock.ts
|
|
4290
4575
|
var import_node_child_process20 = require("node:child_process");
|
|
4291
4576
|
var import_node_crypto22 = require("node:crypto");
|
|
4292
|
-
var
|
|
4577
|
+
var import_node_fs38 = require("node:fs");
|
|
4293
4578
|
var import_node_os10 = require("node:os");
|
|
4294
|
-
var
|
|
4579
|
+
var import_node_path37 = __toESM(require("node:path"), 1);
|
|
4295
4580
|
|
|
4296
4581
|
// src/swift-uniform-type-constants.ts
|
|
4297
4582
|
var import_node_child_process21 = require("node:child_process");
|
|
4298
|
-
var
|
|
4583
|
+
var import_node_path38 = __toESM(require("node:path"), 1);
|
|
4299
4584
|
|
|
4300
4585
|
// src/xcode-header-search.ts
|
|
4301
|
-
var
|
|
4302
|
-
var
|
|
4586
|
+
var import_node_fs39 = __toESM(require("node:fs"), 1);
|
|
4587
|
+
var import_node_path39 = __toESM(require("node:path"), 1);
|
|
4303
4588
|
|
|
4304
4589
|
// src/swift-compile.ts
|
|
4305
4590
|
var OPTIONAL_FRAMEWORK_DEPENDENCIES = {
|
|
@@ -4377,7 +4662,7 @@ var FOUNDATION_IMPLICIT_MODULES = [
|
|
|
4377
4662
|
var FOUNDATION_IMPLICIT_FLAGS = FOUNDATION_IMPLICIT_MODULES.map(
|
|
4378
4663
|
(module2) => `, "-Xfrontend", "-import-module", "-Xfrontend", "${module2}"`
|
|
4379
4664
|
).join("");
|
|
4380
|
-
var compilerSourceDigest = true ? "
|
|
4665
|
+
var compilerSourceDigest = true ? "f691ad9847363fc601dda32d460b473efaac6c30948a278f162a896afa1df816" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
4381
4666
|
var C_WORDS = new Set(
|
|
4382
4667
|
"auto bool break case char const continue default do double else enum extern false float for goto if inline int long register restrict return short signed sizeof static struct switch true typedef union unsigned void volatile while YES NO NULL nil Nil id self super instancetype".split(
|
|
4383
4668
|
" "
|
|
@@ -4420,83 +4705,37 @@ var host = globalThis;
|
|
|
4420
4705
|
var rootLocks = host[ROOT_LOCKS] ??= /* @__PURE__ */ new Map();
|
|
4421
4706
|
var SHARED_ARTIFACT_BUDGET_BYTES = 4 * 1024 ** 3;
|
|
4422
4707
|
|
|
4423
|
-
// src/answeredNativePackages.ts
|
|
4424
|
-
var import_node_async_hooks = require("node:async_hooks");
|
|
4425
|
-
var import_node_fs39 = require("node:fs");
|
|
4426
|
-
var import_node_path40 = require("node:path");
|
|
4427
|
-
|
|
4428
|
-
// src/launchMetadataContract.ts
|
|
4429
|
-
var LAUNCH_METADATA_KEYS_PATH = "node/launch-metadata-keys.json";
|
|
4430
|
-
var LAUNCH_METADATA_KEYS = [
|
|
4431
|
-
"appFonts",
|
|
4432
|
-
"appSplash",
|
|
4433
|
-
"appCatalog",
|
|
4434
|
-
"appBundleResources",
|
|
4435
|
-
"nativeAppIdentity",
|
|
4436
|
-
"nativeFirebase",
|
|
4437
|
-
"expoSwift",
|
|
4438
|
-
"expoWidgets",
|
|
4439
|
-
"expoKotlin",
|
|
4440
|
-
"nitro",
|
|
4441
|
-
"turbo",
|
|
4442
|
-
"widgetExtension",
|
|
4443
|
-
"appManifest",
|
|
4444
|
-
"packageVersions",
|
|
4445
|
-
"dotEnv",
|
|
4446
|
-
"env"
|
|
4447
|
-
];
|
|
4448
|
-
var LAUNCH_METADATA_KEYS_BEFORE_RUNTIME_STATED_THEM = LAUNCH_METADATA_KEYS.filter((key) => key !== "widgetExtension");
|
|
4449
|
-
|
|
4450
|
-
// src/runtime-assets.ts
|
|
4451
|
-
var import_fs = __toESM(require("fs"), 1);
|
|
4452
|
-
var import_path = __toESM(require("path"), 1);
|
|
4453
|
-
var import_url = require("url");
|
|
4454
|
-
|
|
4455
|
-
// src/answeredNativePackages.ts
|
|
4456
|
-
var runtimeLaunchMetadataKeysFile = {
|
|
4457
|
-
path: LAUNCH_METADATA_KEYS_PATH,
|
|
4458
|
-
contents: `${JSON.stringify(LAUNCH_METADATA_KEYS)}
|
|
4459
|
-
`
|
|
4460
|
-
};
|
|
4461
|
-
var unansweredStore = new import_node_async_hooks.AsyncLocalStorage();
|
|
4462
|
-
var answeredStore = new import_node_async_hooks.AsyncLocalStorage();
|
|
4463
|
-
|
|
4464
|
-
// src/nitroAdapterContract.ts
|
|
4465
|
-
var import_node_crypto24 = require("node:crypto");
|
|
4466
|
-
var import_node_fs40 = require("node:fs");
|
|
4467
|
-
var import_node_path41 = __toESM(require("node:path"), 1);
|
|
4468
|
-
|
|
4469
4708
|
// src/swift-package-manifest.ts
|
|
4470
|
-
var cacheDir3 =
|
|
4709
|
+
var cacheDir3 = import_node_path42.default.join(cacheDir(), "swift-manifests");
|
|
4471
4710
|
var execFileAsync = (0, import_node_util4.promisify)(import_node_child_process23.execFile);
|
|
4472
4711
|
|
|
4473
4712
|
// src/xcode-json-project.ts
|
|
4474
|
-
var
|
|
4713
|
+
var import_node_path43 = __toESM(require("node:path"), 1);
|
|
4475
4714
|
var import_json5 = __toESM(require_lib(), 1);
|
|
4476
4715
|
var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
4477
|
-
var
|
|
4716
|
+
var text2 = (value) => typeof value === "string" ? value : void 0;
|
|
4478
4717
|
var items = (value) => Array.isArray(value) ? value : [];
|
|
4479
4718
|
function remoteVersionRequirement(entry) {
|
|
4480
|
-
const revision =
|
|
4719
|
+
const revision = text2(entry.revision);
|
|
4481
4720
|
if (revision !== void 0) return { requirement: { kind: "revision", revision } };
|
|
4482
|
-
const branch =
|
|
4721
|
+
const branch = text2(entry.branch);
|
|
4483
4722
|
if (branch !== void 0) return { requirement: { kind: "branch", branch } };
|
|
4484
|
-
const version =
|
|
4723
|
+
const version = text2(entry.version);
|
|
4485
4724
|
if (version !== void 0) return { requirement: { kind: "exactVersion", version } };
|
|
4486
|
-
const minor =
|
|
4725
|
+
const minor = text2(entry["up-to-next-minor-version"]);
|
|
4487
4726
|
if (minor !== void 0)
|
|
4488
4727
|
return { requirement: { kind: "upToNextMinorVersion", minimumVersion: minor } };
|
|
4489
|
-
const major =
|
|
4728
|
+
const major = text2(entry["up-to-next-major-version"]);
|
|
4490
4729
|
if (major !== void 0)
|
|
4491
4730
|
return { requirement: { kind: "upToNextMajorVersion", minimumVersion: major } };
|
|
4492
|
-
const range =
|
|
4731
|
+
const range = text2(entry["version-range"]);
|
|
4493
4732
|
if (range !== void 0) {
|
|
4494
4733
|
const bounds = range.split("..<");
|
|
4495
4734
|
const minimum2 = bounds[0];
|
|
4496
4735
|
const maximum2 = bounds[1];
|
|
4497
4736
|
if (bounds.length !== 2 || !minimum2 || !maximum2 || bounds[2] !== void 0)
|
|
4498
4737
|
throw new Error(
|
|
4499
|
-
`${
|
|
4738
|
+
`${text2(entry.repository) ?? "package"} has a version-range that is not min..<max`
|
|
4500
4739
|
);
|
|
4501
4740
|
return {
|
|
4502
4741
|
requirement: {
|
|
@@ -4506,8 +4745,8 @@ function remoteVersionRequirement(entry) {
|
|
|
4506
4745
|
}
|
|
4507
4746
|
};
|
|
4508
4747
|
}
|
|
4509
|
-
const minimum =
|
|
4510
|
-
const maximum =
|
|
4748
|
+
const minimum = text2(entry["version-range-min"]);
|
|
4749
|
+
const maximum = text2(entry["version-range-max"]);
|
|
4511
4750
|
if (minimum !== void 0 && maximum !== void 0)
|
|
4512
4751
|
return {
|
|
4513
4752
|
requirement: {
|
|
@@ -4529,7 +4768,7 @@ var PHASE_ISA = {
|
|
|
4529
4768
|
function readXcodeJsonProject(xcodeproj, source) {
|
|
4530
4769
|
const json = import_json5.default.parse(source);
|
|
4531
4770
|
if (!isJsonObject(json)) throw new Error(`${xcodeproj}/project.xcproj is not an object`);
|
|
4532
|
-
const projectDir =
|
|
4771
|
+
const projectDir = import_node_path43.default.dirname(xcodeproj);
|
|
4533
4772
|
const objects = {};
|
|
4534
4773
|
let next = 0;
|
|
4535
4774
|
const add = (entry, id) => {
|
|
@@ -4542,7 +4781,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
4542
4781
|
const base = /^<([A-Z]+)>\/(.*)$/.exec(raw);
|
|
4543
4782
|
if (base) {
|
|
4544
4783
|
if (base[1] === "PROJECT")
|
|
4545
|
-
return { sourceTree: "<absolute>", path:
|
|
4784
|
+
return { sourceTree: "<absolute>", path: import_node_path43.default.join(projectDir, base[2]) };
|
|
4546
4785
|
if (base[1] === "PRODUCTS")
|
|
4547
4786
|
return { sourceTree: "BUILT_PRODUCTS_DIR", path: base[2] };
|
|
4548
4787
|
return null;
|
|
@@ -4550,7 +4789,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
4550
4789
|
const unescaped = raw.replaceAll("\\<", "<");
|
|
4551
4790
|
if (unescaped.startsWith("/")) return { sourceTree: "<absolute>", path: unescaped };
|
|
4552
4791
|
if (unescaped.startsWith("~")) return null;
|
|
4553
|
-
return groupDir === null ? null : { sourceTree: "<absolute>", path:
|
|
4792
|
+
return groupDir === null ? null : { sourceTree: "<absolute>", path: import_node_path43.default.join(groupDir, unescaped) };
|
|
4554
4793
|
};
|
|
4555
4794
|
const memberships = [];
|
|
4556
4795
|
const folders = [];
|
|
@@ -4558,10 +4797,10 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
4558
4797
|
const root = { id: "", name: "", dir: projectDir, parent: null, children: [] };
|
|
4559
4798
|
const walk = (entries, parent) => entries.flatMap((entry) => {
|
|
4560
4799
|
if (!isObject(entry)) return [];
|
|
4561
|
-
const kind =
|
|
4562
|
-
const raw =
|
|
4800
|
+
const kind = text2(entry.kind) ?? "file-reference";
|
|
4801
|
+
const raw = text2(entry.path) ?? "";
|
|
4563
4802
|
const located = raw === "" ? null : locate(raw, parent.dir);
|
|
4564
|
-
const name =
|
|
4803
|
+
const name = text2(entry.name) ?? import_node_path43.default.basename(raw);
|
|
4565
4804
|
const node = { id: "", name, dir: null, parent, children: [] };
|
|
4566
4805
|
if (kind === "group" || kind === "variant-group" || kind === "version-group") {
|
|
4567
4806
|
node.dir = raw === "" ? parent.dir : located?.sourceTree === "<absolute>" ? located.path : null;
|
|
@@ -4577,7 +4816,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
4577
4816
|
...kind === "variant-group" ? {} : { sourceTree: "<absolute>", path: node.dir ?? "" },
|
|
4578
4817
|
name
|
|
4579
4818
|
},
|
|
4580
|
-
|
|
4819
|
+
text2(entry.id)
|
|
4581
4820
|
);
|
|
4582
4821
|
} else if (kind === "folder") {
|
|
4583
4822
|
node.id = add(
|
|
@@ -4585,7 +4824,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
4585
4824
|
isa: "PBXFileSystemSynchronizedRootGroup",
|
|
4586
4825
|
...located ?? { sourceTree: "SDKROOT", path: raw }
|
|
4587
4826
|
},
|
|
4588
|
-
|
|
4827
|
+
text2(entry.id)
|
|
4589
4828
|
);
|
|
4590
4829
|
folders.push({ id: node.id, folder: entry });
|
|
4591
4830
|
} else {
|
|
@@ -4595,7 +4834,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
4595
4834
|
...located ?? { sourceTree: "SDKROOT", path: raw },
|
|
4596
4835
|
name
|
|
4597
4836
|
},
|
|
4598
|
-
|
|
4837
|
+
text2(entry.id)
|
|
4599
4838
|
);
|
|
4600
4839
|
if (located?.sourceTree === "<absolute>" && located.path.endsWith(".xcodeproj"))
|
|
4601
4840
|
projectFiles.push(node.id);
|
|
@@ -4622,7 +4861,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
4622
4861
|
if (Array.isArray(reference)) {
|
|
4623
4862
|
return lookupNode(
|
|
4624
4863
|
reference.map(
|
|
4625
|
-
(component) => isObject(component) ?
|
|
4864
|
+
(component) => isObject(component) ? text2(component.name) ?? "" : text2(component) ?? ""
|
|
4626
4865
|
).join("/"),
|
|
4627
4866
|
from
|
|
4628
4867
|
)?.id;
|
|
@@ -4630,7 +4869,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
4630
4869
|
return lookupNode(reference, from)?.id;
|
|
4631
4870
|
};
|
|
4632
4871
|
const lookupNode = (reference, from) => {
|
|
4633
|
-
const value =
|
|
4872
|
+
const value = text2(reference);
|
|
4634
4873
|
if (value === void 0) return void 0;
|
|
4635
4874
|
if (value.startsWith("id:")) {
|
|
4636
4875
|
const id = value.slice(3);
|
|
@@ -4645,7 +4884,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
4645
4884
|
return node;
|
|
4646
4885
|
};
|
|
4647
4886
|
const configurations = items(json.configurations).flatMap((entry) => {
|
|
4648
|
-
const name = isObject(entry) ?
|
|
4887
|
+
const name = isObject(entry) ? text2(entry.name) : text2(entry);
|
|
4649
4888
|
return name ? [{ name, file: isObject(entry) ? entry.file : void 0 }] : [];
|
|
4650
4889
|
});
|
|
4651
4890
|
const settingsOf = (value) => Object.fromEntries(
|
|
@@ -4660,12 +4899,12 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
4660
4899
|
);
|
|
4661
4900
|
const configurationList = (settings, specialized) => add({
|
|
4662
4901
|
isa: "XCConfigurationList",
|
|
4663
|
-
defaultConfigurationName:
|
|
4902
|
+
defaultConfigurationName: text2(json["default-configuration"]) ?? "Debug",
|
|
4664
4903
|
buildConfigurations: configurations.map(({ name, file }) => {
|
|
4665
4904
|
const reference = specialized.has(name) ? specialized.get(name) : file;
|
|
4666
4905
|
const base = lookup(reference);
|
|
4667
4906
|
const anchor = isObject(reference) ? lookupNode(reference.anchor, root)?.id : null;
|
|
4668
|
-
const relative2 = isObject(reference) ?
|
|
4907
|
+
const relative2 = isObject(reference) ? text2(reference["relative-path"]) : null;
|
|
4669
4908
|
return add({
|
|
4670
4909
|
isa: "XCBuildConfiguration",
|
|
4671
4910
|
name,
|
|
@@ -4680,10 +4919,10 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
4680
4919
|
const packageIds = /* @__PURE__ */ new Map();
|
|
4681
4920
|
for (const entry of items(json.packages)) {
|
|
4682
4921
|
if (!isObject(entry)) continue;
|
|
4683
|
-
const repository =
|
|
4684
|
-
const local =
|
|
4685
|
-
const name = local !== void 0 ?
|
|
4686
|
-
const id =
|
|
4922
|
+
const repository = text2(entry.repository);
|
|
4923
|
+
const local = text2(entry.path);
|
|
4924
|
+
const name = local !== void 0 ? import_node_path43.default.basename(import_node_path43.default.resolve(import_node_path43.default.dirname(xcodeproj), local)) : import_node_path43.default.basename(repository ?? "").replace(/\.git$/, "");
|
|
4925
|
+
const id = text2(entry.kind) === "local" && local !== void 0 ? add({ isa: "XCLocalSwiftPackageReference", relativePath: local }) : add({
|
|
4687
4926
|
isa: "XCRemoteSwiftPackageReference",
|
|
4688
4927
|
repositoryURL: repository ?? "",
|
|
4689
4928
|
...remoteVersionRequirement(entry)
|
|
@@ -4692,29 +4931,29 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
4692
4931
|
}
|
|
4693
4932
|
const productDependency = (entry) => add({
|
|
4694
4933
|
isa: "XCSwiftPackageProductDependency",
|
|
4695
|
-
productName:
|
|
4934
|
+
productName: text2(entry["product-name"]) ?? "",
|
|
4696
4935
|
// xcode finds a product by name across packages when none is named
|
|
4697
|
-
...packageIds.has(
|
|
4936
|
+
...packageIds.has(text2(entry.package)?.toLowerCase() ?? "") ? { package: packageIds.get(text2(entry.package).toLowerCase()) } : {}
|
|
4698
4937
|
});
|
|
4699
4938
|
const proxy = (entry, remote, proxyType) => add({
|
|
4700
4939
|
isa: "PBXContainerItemProxy",
|
|
4701
4940
|
containerPortal: lookup(entry.project) ?? "",
|
|
4702
4941
|
proxyType,
|
|
4703
4942
|
remoteGlobalIDString: remote ?? "",
|
|
4704
|
-
remoteInfo:
|
|
4943
|
+
remoteInfo: text2(entry.target) ?? ""
|
|
4705
4944
|
});
|
|
4706
4945
|
const phases = /* @__PURE__ */ new Map();
|
|
4707
4946
|
const targetIds = /* @__PURE__ */ new Map();
|
|
4708
4947
|
const targets = [];
|
|
4709
4948
|
for (const entry of items(json.targets)) {
|
|
4710
4949
|
if (!isObject(entry)) continue;
|
|
4711
|
-
const name =
|
|
4712
|
-
const productType =
|
|
4950
|
+
const name = text2(entry.name) ?? "";
|
|
4951
|
+
const productType = text2(entry["product-type"]);
|
|
4713
4952
|
const target = {
|
|
4714
|
-
isa:
|
|
4953
|
+
isa: text2(entry.kind) === "aggregate" ? "PBXAggregateTarget" : "PBXNativeTarget",
|
|
4715
4954
|
name,
|
|
4716
4955
|
productName: name,
|
|
4717
|
-
productType: productType ? `com.apple.product-type.${productType}` :
|
|
4956
|
+
productType: productType ? `com.apple.product-type.${productType}` : text2(entry["full-product-type"]) ?? "",
|
|
4718
4957
|
buildPhases: [],
|
|
4719
4958
|
dependencies: [],
|
|
4720
4959
|
packageProductDependencies: [],
|
|
@@ -4722,17 +4961,17 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
4722
4961
|
};
|
|
4723
4962
|
const product = lookup(entry.product);
|
|
4724
4963
|
if (product) target.productReference = product;
|
|
4725
|
-
const id = add(target,
|
|
4964
|
+
const id = add(target, text2(entry.id));
|
|
4726
4965
|
targetIds.set(name, id);
|
|
4727
4966
|
targets.push({ id, target, entry });
|
|
4728
4967
|
for (const phase of items(entry["build-phases"])) {
|
|
4729
|
-
const kind = isObject(phase) ?
|
|
4968
|
+
const kind = isObject(phase) ? text2(phase.kind) : text2(phase);
|
|
4730
4969
|
const isa = kind ? PHASE_ISA[kind] : void 0;
|
|
4731
4970
|
if (!kind || !isa) continue;
|
|
4732
|
-
const phaseName = isObject(phase) ?
|
|
4971
|
+
const phaseName = isObject(phase) ? text2(phase.name) : void 0;
|
|
4733
4972
|
const phaseId = add(
|
|
4734
4973
|
{ isa, files: [] },
|
|
4735
|
-
isObject(phase) ?
|
|
4974
|
+
isObject(phase) ? text2(phase.id) : void 0
|
|
4736
4975
|
);
|
|
4737
4976
|
target.buildPhases.push(phaseId);
|
|
4738
4977
|
phases.set([name, kind, phaseName].filter(Boolean).join("/"), phaseId);
|
|
@@ -4740,7 +4979,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
4740
4979
|
}
|
|
4741
4980
|
}
|
|
4742
4981
|
const phaseFiles = (reference, targetName) => {
|
|
4743
|
-
const value =
|
|
4982
|
+
const value = text2(reference);
|
|
4744
4983
|
if (value === void 0) return null;
|
|
4745
4984
|
const key = value.startsWith("id:") || !targetName ? value : `${targetName}/${value}`;
|
|
4746
4985
|
const phase = objects[phases.get(key) ?? ""];
|
|
@@ -4751,17 +4990,17 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
4751
4990
|
files?.push(add({ isa: "PBXBuildFile", fileRef: refId }));
|
|
4752
4991
|
}
|
|
4753
4992
|
for (const { target, entry } of targets) {
|
|
4754
|
-
const name =
|
|
4993
|
+
const name = text2(entry.name) ?? "";
|
|
4755
4994
|
target.buildConfigurationList = configurationList(
|
|
4756
4995
|
settingsOf(entry["build-settings"]),
|
|
4757
4996
|
new Map(
|
|
4758
4997
|
items(entry["specialized-configurations"]).flatMap(
|
|
4759
|
-
(configuration) => isObject(configuration) &&
|
|
4998
|
+
(configuration) => isObject(configuration) && text2(configuration.name) ? [[text2(configuration.name), configuration.file]] : []
|
|
4760
4999
|
)
|
|
4761
5000
|
)
|
|
4762
5001
|
);
|
|
4763
5002
|
for (const dependency of items(entry.dependencies)) {
|
|
4764
|
-
const kind = isObject(dependency) ?
|
|
5003
|
+
const kind = isObject(dependency) ? text2(dependency.kind) ?? "localTarget" : "localTarget";
|
|
4765
5004
|
if (kind === "package" && isObject(dependency)) {
|
|
4766
5005
|
;
|
|
4767
5006
|
target.dependencies.push(
|
|
@@ -4772,11 +5011,11 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
4772
5011
|
target.dependencies.push(
|
|
4773
5012
|
add({
|
|
4774
5013
|
isa: "PBXTargetDependency",
|
|
4775
|
-
targetProxy: proxy(dependency,
|
|
5014
|
+
targetProxy: proxy(dependency, text2(dependency["target-id"]), "1")
|
|
4776
5015
|
})
|
|
4777
5016
|
);
|
|
4778
5017
|
} else {
|
|
4779
|
-
const local = isObject(dependency) ?
|
|
5018
|
+
const local = isObject(dependency) ? text2(dependency.target) : text2(dependency);
|
|
4780
5019
|
const id = local ? targetIds.get(local) : void 0;
|
|
4781
5020
|
if (id)
|
|
4782
5021
|
target.dependencies.push(
|
|
@@ -4798,9 +5037,9 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
4798
5037
|
if (!isObject(imported)) continue;
|
|
4799
5038
|
const reference = add({
|
|
4800
5039
|
isa: "PBXReferenceProxy",
|
|
4801
|
-
path:
|
|
5040
|
+
path: text2(imported.name) ?? text2(imported.path) ?? "",
|
|
4802
5041
|
sourceTree: "BUILT_PRODUCTS_DIR",
|
|
4803
|
-
remoteRef: proxy(imported,
|
|
5042
|
+
remoteRef: proxy(imported, text2(imported["product-id"]), "2")
|
|
4804
5043
|
});
|
|
4805
5044
|
for (const membership of items(imported["target-membership"])) {
|
|
4806
5045
|
phaseFiles(isObject(membership) ? membership["build-phase"] : membership)?.push(
|
|
@@ -4812,7 +5051,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
4812
5051
|
const exceptions = [];
|
|
4813
5052
|
for (const exception of items(folder["membership-exceptions"])) {
|
|
4814
5053
|
if (!isObject(exception)) continue;
|
|
4815
|
-
const target = targetIds.get(
|
|
5054
|
+
const target = targetIds.get(text2(exception.target) ?? "");
|
|
4816
5055
|
if (!target) continue;
|
|
4817
5056
|
exceptions.push(
|
|
4818
5057
|
add({
|
|
@@ -4830,7 +5069,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
4830
5069
|
group.exceptions = exceptions;
|
|
4831
5070
|
for (const owner of items(folder["target-membership"])) {
|
|
4832
5071
|
const target = targets.find(
|
|
4833
|
-
(candidate) => candidate.id === targetIds.get(
|
|
5072
|
+
(candidate) => candidate.id === targetIds.get(text2(owner) ?? "")
|
|
4834
5073
|
);
|
|
4835
5074
|
target?.target.fileSystemSynchronizedGroups?.push(id);
|
|
4836
5075
|
}
|
|
@@ -4840,7 +5079,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
4840
5079
|
isa: "PBXProject",
|
|
4841
5080
|
mainGroup,
|
|
4842
5081
|
projectDirPath: "",
|
|
4843
|
-
developmentRegion:
|
|
5082
|
+
developmentRegion: text2(localizations.development) ?? "en",
|
|
4844
5083
|
buildConfigurationList: configurationList(
|
|
4845
5084
|
settingsOf(json["build-settings"]),
|
|
4846
5085
|
/* @__PURE__ */ new Map()
|
|
@@ -4907,7 +5146,7 @@ function walkFiles(dir) {
|
|
|
4907
5146
|
const out = [];
|
|
4908
5147
|
for (const entry of import_node_fs43.default.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name))) {
|
|
4909
5148
|
if (entry.name.startsWith(".")) continue;
|
|
4910
|
-
const full =
|
|
5149
|
+
const full = import_node_path44.default.join(dir, entry.name);
|
|
4911
5150
|
if (entry.isDirectory()) out.push(...walkFiles(full));
|
|
4912
5151
|
else if (entry.isFile()) out.push(full);
|
|
4913
5152
|
}
|
|
@@ -4924,7 +5163,7 @@ function readXcconfig(file, read) {
|
|
|
4924
5163
|
if (include) {
|
|
4925
5164
|
Object.assign(
|
|
4926
5165
|
settings,
|
|
4927
|
-
readXcconfig(
|
|
5166
|
+
readXcconfig(import_node_path44.default.resolve(import_node_path44.default.dirname(file), include[1]), read)
|
|
4928
5167
|
);
|
|
4929
5168
|
continue;
|
|
4930
5169
|
}
|
|
@@ -4969,28 +5208,28 @@ function applyOperator(value, operator) {
|
|
|
4969
5208
|
return value.replace(/[^A-Za-z0-9_]/g, "_").replace(/^[0-9]/, "_");
|
|
4970
5209
|
case "standardizepath":
|
|
4971
5210
|
if (value === ".") return value;
|
|
4972
|
-
if (
|
|
4973
|
-
return
|
|
5211
|
+
if (import_node_path44.default.posix.isAbsolute(value))
|
|
5212
|
+
return import_node_path44.default.posix.normalize(value).replace(/(?<=.)\/$/, "");
|
|
4974
5213
|
return value.split("/").filter((component) => component !== "" && component !== ".").join("/");
|
|
4975
5214
|
}
|
|
4976
5215
|
throw new Error(`unsupported build setting operator :${operator}`);
|
|
4977
5216
|
}
|
|
4978
|
-
function decodeXml(
|
|
4979
|
-
return
|
|
5217
|
+
function decodeXml(text3) {
|
|
5218
|
+
return text3.replaceAll(""", '"').replaceAll("'", "'").replaceAll("<", "<").replaceAll(">", ">").replaceAll("&", "&");
|
|
4980
5219
|
}
|
|
4981
5220
|
function workspaceReferences(workspace) {
|
|
4982
|
-
const data =
|
|
5221
|
+
const data = import_node_path44.default.join(workspace, "contents.xcworkspacedata");
|
|
4983
5222
|
if (!import_node_fs43.default.existsSync(data))
|
|
4984
5223
|
throw new Error(`${workspace} has no contents.xcworkspacedata`);
|
|
4985
|
-
const container =
|
|
5224
|
+
const container = import_node_path44.default.dirname(workspace);
|
|
4986
5225
|
const locate = (location, base) => {
|
|
4987
5226
|
const colon = location.indexOf(":");
|
|
4988
5227
|
const kind = location.slice(0, colon);
|
|
4989
5228
|
const rest = location.slice(colon + 1);
|
|
4990
|
-
if (kind === "group") return
|
|
4991
|
-
if (kind === "container" || kind === "self") return
|
|
4992
|
-
if (kind === "absolute") return
|
|
4993
|
-
throw new Error(`${
|
|
5229
|
+
if (kind === "group") return import_node_path44.default.resolve(base, rest);
|
|
5230
|
+
if (kind === "container" || kind === "self") return import_node_path44.default.resolve(container, rest);
|
|
5231
|
+
if (kind === "absolute") return import_node_path44.default.resolve(rest);
|
|
5232
|
+
throw new Error(`${import_node_path44.default.basename(workspace)} has an unsupported location ${location}`);
|
|
4994
5233
|
};
|
|
4995
5234
|
const groups = [container];
|
|
4996
5235
|
const references = [];
|
|
@@ -5045,7 +5284,7 @@ function remotePackageRequirements(projects) {
|
|
|
5045
5284
|
var loaded = /* @__PURE__ */ new Map();
|
|
5046
5285
|
function xcodeProjectFile(xcodeproj) {
|
|
5047
5286
|
for (const name of ["project.pbxproj", "project.xcproj"]) {
|
|
5048
|
-
const file =
|
|
5287
|
+
const file = import_node_path44.default.join(xcodeproj, name);
|
|
5049
5288
|
if (import_node_fs43.default.existsSync(file)) return file;
|
|
5050
5289
|
}
|
|
5051
5290
|
return null;
|
|
@@ -5055,7 +5294,7 @@ function loadProject(xcodeproj) {
|
|
|
5055
5294
|
if (!projectFile)
|
|
5056
5295
|
throw new Error(`${xcodeproj} has no project.pbxproj or project.xcproj`);
|
|
5057
5296
|
const source = import_node_fs43.default.readFileSync(projectFile, "utf8");
|
|
5058
|
-
const digest = (0,
|
|
5297
|
+
const digest = (0, import_node_crypto25.createHash)("sha256").update(source).digest("hex");
|
|
5059
5298
|
const cached = loaded.get(projectFile);
|
|
5060
5299
|
if (cached?.digest === digest) return cached.project;
|
|
5061
5300
|
const root = projectFile.endsWith(".xcproj") ? readXcodeJsonProject(xcodeproj, source) : parseOpenStepPlist(source);
|
|
@@ -5072,9 +5311,9 @@ function loadProject(xcodeproj) {
|
|
|
5072
5311
|
throw new Error(`${projectFile} has no PBXProject root`);
|
|
5073
5312
|
}
|
|
5074
5313
|
const projectDir = import_node_fs43.default.realpathSync.native(
|
|
5075
|
-
|
|
5314
|
+
import_node_path44.default.resolve(import_node_path44.default.dirname(xcodeproj), str(project.projectDirPath) ?? "")
|
|
5076
5315
|
);
|
|
5077
|
-
const resolvePath = xcodePathResolver(objects, projectDir,
|
|
5316
|
+
const resolvePath = xcodePathResolver(objects, projectDir, import_node_path44.default.join);
|
|
5078
5317
|
const result = {
|
|
5079
5318
|
xcodeproj,
|
|
5080
5319
|
projectFile,
|
|
@@ -5122,7 +5361,7 @@ function targetSettings(ref, configuration, builtins, options = {}, overrides =
|
|
|
5122
5361
|
const relative2 = str(config.baseConfigurationReferenceRelativePath);
|
|
5123
5362
|
const own = isDict(config.buildSettings) ? config.buildSettings : {};
|
|
5124
5363
|
const directory = anchor ? project.resolvePath(anchor) : null;
|
|
5125
|
-
const baseFile = base ? project.resolvePath(base) : directory && relative2 ?
|
|
5364
|
+
const baseFile = base ? project.resolvePath(base) : directory && relative2 ? import_node_path44.default.resolve(directory, relative2) : null;
|
|
5126
5365
|
if (options.requireSources !== false && (base || anchor || relative2) && (!baseFile || !import_node_fs43.default.existsSync(baseFile)))
|
|
5127
5366
|
throw new Error(
|
|
5128
5367
|
`Unable to open base configuration reference file '${baseFile ?? base ?? relative2 ?? anchor}'`
|
|
@@ -5214,10 +5453,10 @@ function scriptCommand(shell, script) {
|
|
|
5214
5453
|
return [executable, ...args, "-c", script];
|
|
5215
5454
|
}
|
|
5216
5455
|
function expandSearchPath(directory, rules2) {
|
|
5217
|
-
if (
|
|
5456
|
+
if (import_node_path44.default.basename(directory) !== "**") return [directory];
|
|
5218
5457
|
const expanded = [];
|
|
5219
5458
|
const seen = /* @__PURE__ */ new Set();
|
|
5220
|
-
const queue = [
|
|
5459
|
+
const queue = [import_node_path44.default.dirname(directory)];
|
|
5221
5460
|
for (let at = 0; at < queue.length; at++) {
|
|
5222
5461
|
const current = queue[at];
|
|
5223
5462
|
let real;
|
|
@@ -5233,7 +5472,7 @@ function expandSearchPath(directory, rules2) {
|
|
|
5233
5472
|
if (entry.isSymbolicLink() ? !rules2.followLinks : !entry.isDirectory()) continue;
|
|
5234
5473
|
if (rules2.excluded.some((pattern) => pattern.test(entry.name)) && !rules2.included.some((pattern) => pattern.test(entry.name)))
|
|
5235
5474
|
continue;
|
|
5236
|
-
queue.push(
|
|
5475
|
+
queue.push(import_node_path44.default.join(current, entry.name));
|
|
5237
5476
|
}
|
|
5238
5477
|
}
|
|
5239
5478
|
return expanded;
|
|
@@ -5266,7 +5505,7 @@ function compilationConditions(settings) {
|
|
|
5266
5505
|
}
|
|
5267
5506
|
function expand(value, lookup) {
|
|
5268
5507
|
const references = /\$([({]|[A-Za-z_][A-Za-z0-9_]*)/g;
|
|
5269
|
-
let
|
|
5508
|
+
let output = "";
|
|
5270
5509
|
let cursor = 0;
|
|
5271
5510
|
for (let match = references.exec(value); match; match = references.exec(value)) {
|
|
5272
5511
|
let expression = match[1];
|
|
@@ -5285,14 +5524,14 @@ function expand(value, lookup) {
|
|
|
5285
5524
|
}
|
|
5286
5525
|
const [name, ...operators] = expression.split(":");
|
|
5287
5526
|
if (!name || !/^[A-Za-z_][A-Za-z0-9_-]*$/.test(name)) continue;
|
|
5288
|
-
|
|
5289
|
-
|
|
5527
|
+
output += value.slice(cursor, match.index);
|
|
5528
|
+
output += operators.reduce(
|
|
5290
5529
|
(current, operator) => applyOperator(current, operator),
|
|
5291
5530
|
lookup(name)
|
|
5292
5531
|
);
|
|
5293
5532
|
cursor = references.lastIndex = end;
|
|
5294
5533
|
}
|
|
5295
|
-
return
|
|
5534
|
+
return output + value.slice(cursor);
|
|
5296
5535
|
}
|
|
5297
5536
|
var preparedSourcePhases = /* @__PURE__ */ new Map();
|
|
5298
5537
|
function shellAssetCatalogs(script, settings, projectDir) {
|
|
@@ -5324,7 +5563,7 @@ function shellAssetCatalogs(script, settings, projectDir) {
|
|
|
5324
5563
|
for (const token of tokens) {
|
|
5325
5564
|
if (token.startsWith("-")) break;
|
|
5326
5565
|
const file = resolve(token);
|
|
5327
|
-
if (file?.endsWith(".xcassets")) catalogs.push(
|
|
5566
|
+
if (file?.endsWith(".xcassets")) catalogs.push(import_node_path44.default.resolve(projectDir, file));
|
|
5328
5567
|
}
|
|
5329
5568
|
}
|
|
5330
5569
|
return catalogs;
|
|
@@ -5369,8 +5608,8 @@ function shellCopies(script, settings, projectDir) {
|
|
|
5369
5608
|
if (operands.length !== 2 || operands.some((operand) => operand.startsWith("-")))
|
|
5370
5609
|
return [];
|
|
5371
5610
|
copies.push({
|
|
5372
|
-
from:
|
|
5373
|
-
to:
|
|
5611
|
+
from: import_node_path44.default.resolve(projectDir, operands[0]),
|
|
5612
|
+
to: import_node_path44.default.resolve(projectDir, operands[1])
|
|
5374
5613
|
});
|
|
5375
5614
|
}
|
|
5376
5615
|
return copies;
|
|
@@ -5390,7 +5629,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
5390
5629
|
const copiedFiles = [];
|
|
5391
5630
|
let generatedInfoPlist = false;
|
|
5392
5631
|
const declaredInfoPlist = settings("INFOPLIST_FILE");
|
|
5393
|
-
const infoPlistOutput = declaredInfoPlist ?
|
|
5632
|
+
const infoPlistOutput = declaredInfoPlist ? import_node_path44.default.resolve(project.projectDir, declaredInfoPlist) : null;
|
|
5394
5633
|
const isPreparedOutput = (file) => file === infoPlistOutput || options.requireSources !== false && file.endsWith(".swift");
|
|
5395
5634
|
for (const phaseId of list(target.buildPhases)) {
|
|
5396
5635
|
const phase = project.object(phaseId);
|
|
@@ -5405,7 +5644,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
5405
5644
|
copiedFiles.push(
|
|
5406
5645
|
...shellCopies(str(phase.shellScript) ?? "", settings, project.projectDir)
|
|
5407
5646
|
);
|
|
5408
|
-
const absolute = (raw) =>
|
|
5647
|
+
const absolute = (raw) => import_node_path44.default.resolve(project.projectDir, expand(raw, settings));
|
|
5409
5648
|
const inputs = list(phase.inputPaths).map(absolute);
|
|
5410
5649
|
const outputs = list(phase.outputPaths).map(absolute);
|
|
5411
5650
|
const fileLists = /* @__PURE__ */ new Map();
|
|
@@ -5426,9 +5665,9 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
5426
5665
|
...fileLists.get("OUTPUT").flatMap((item) => item.entries)
|
|
5427
5666
|
];
|
|
5428
5667
|
if (allOutputs.includes(infoPlistOutput)) generatedInfoPlist = true;
|
|
5429
|
-
for (const
|
|
5430
|
-
if (
|
|
5431
|
-
scriptForOutput.set(
|
|
5668
|
+
for (const output of allOutputs)
|
|
5669
|
+
if (output.endsWith(".swift") && !scriptForOutput.has(output))
|
|
5670
|
+
scriptForOutput.set(output, script);
|
|
5432
5671
|
const inputFiles = [
|
|
5433
5672
|
...inputs,
|
|
5434
5673
|
...fileLists.get("INPUT").flatMap((item) => [item.file, ...item.entries]),
|
|
@@ -5438,17 +5677,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
5438
5677
|
for (const file of inputFiles) if (import_node_fs43.default.existsSync(file)) projectInputs.add(file);
|
|
5439
5678
|
}
|
|
5440
5679
|
if (options.prepareGeneratedSources === true && allOutputs.some(isPreparedOutput)) {
|
|
5441
|
-
const
|
|
5442
|
-
if (preparedXcodePhase(
|
|
5443
|
-
project.projectFile,
|
|
5444
|
-
targetId,
|
|
5445
|
-
phaseId,
|
|
5446
|
-
configuration,
|
|
5447
|
-
allOutputs,
|
|
5448
|
-
false
|
|
5449
|
-
))
|
|
5450
|
-
continue;
|
|
5451
|
-
const phaseDir = import_node_path45.default.join(settings("TARGET_TEMP_DIR"), `Script-${phaseId}`);
|
|
5680
|
+
const phaseDir = import_node_path44.default.join(settings("TARGET_TEMP_DIR"), `Script-${phaseId}`);
|
|
5452
5681
|
for (const lists of fileLists.values())
|
|
5453
5682
|
for (const { file } of lists)
|
|
5454
5683
|
if (!import_node_fs43.default.existsSync(file))
|
|
@@ -5470,13 +5699,13 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
5470
5699
|
const lists = fileLists.get(kind);
|
|
5471
5700
|
env[`SCRIPT_${kind}_FILE_LIST_COUNT`] = String(lists.length);
|
|
5472
5701
|
lists.forEach((_item, index) => {
|
|
5473
|
-
env[`SCRIPT_${kind}_FILE_LIST_${index}`] =
|
|
5702
|
+
env[`SCRIPT_${kind}_FILE_LIST_${index}`] = import_node_path44.default.join(
|
|
5474
5703
|
phaseDir,
|
|
5475
5704
|
`${kind}-${index}.xcfilelist`
|
|
5476
5705
|
);
|
|
5477
5706
|
});
|
|
5478
5707
|
}
|
|
5479
|
-
const signature = (0,
|
|
5708
|
+
const signature = (0, import_node_crypto25.createHash)("sha256").update(
|
|
5480
5709
|
JSON.stringify([phase, [...settingKeys].map((key2) => [key2, settings(key2)])])
|
|
5481
5710
|
);
|
|
5482
5711
|
for (const file of inputFiles) {
|
|
@@ -5488,22 +5717,29 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
5488
5717
|
}
|
|
5489
5718
|
const stamp = signature.digest("hex");
|
|
5490
5719
|
const key = `${project.projectFile}:${targetId}:${phaseId}:${settings("CONFIGURATION")}`;
|
|
5491
|
-
if (preparedSourcePhases.get(key) === stamp && allOutputs.every((file) => import_node_fs43.default.existsSync(file)))
|
|
5492
|
-
preparedXcodePhase(
|
|
5493
|
-
project.projectFile,
|
|
5494
|
-
targetId,
|
|
5495
|
-
phaseId,
|
|
5496
|
-
configuration,
|
|
5497
|
-
allOutputs,
|
|
5498
|
-
true
|
|
5499
|
-
);
|
|
5720
|
+
if (preparedSourcePhases.get(key) === stamp && allOutputs.every((file) => import_node_fs43.default.existsSync(file)))
|
|
5500
5721
|
continue;
|
|
5501
|
-
}
|
|
5502
5722
|
import_node_fs43.default.mkdirSync(phaseDir, { recursive: true });
|
|
5723
|
+
if (process.platform === "linux") {
|
|
5724
|
+
const bin = swiftToolchainBin(
|
|
5725
|
+
privateSwiftRelease() ?? swiftNativePin().distribution.release
|
|
5726
|
+
);
|
|
5727
|
+
const startup = import_node_path44.default.join(phaseDir, "peach-tools.sh");
|
|
5728
|
+
import_node_fs43.default.writeFileSync(
|
|
5729
|
+
startup,
|
|
5730
|
+
'if [[ -n "$PEACH_PHASE_BASH_ENV" ]]; then source "$PEACH_PHASE_BASH_ENV"; fi\nexport PATH="$PEACH_PHASE_TOOLCHAIN:$PATH"\n'
|
|
5731
|
+
);
|
|
5732
|
+
const { LD_LIBRARY_PATH } = swiftEnvironment(env);
|
|
5733
|
+
env.LD_LIBRARY_PATH = LD_LIBRARY_PATH;
|
|
5734
|
+
env.PEACH_PHASE_TOOLCHAIN = bin;
|
|
5735
|
+
env.PEACH_PHASE_BASH_ENV = env.BASH_ENV;
|
|
5736
|
+
env.BASH_ENV = startup;
|
|
5737
|
+
env.PATH = [bin, env.PATH].filter(Boolean).join(import_node_path44.default.delimiter);
|
|
5738
|
+
}
|
|
5503
5739
|
import_node_fs43.default.mkdirSync(settings("BUILT_PRODUCTS_DIR"), { recursive: true });
|
|
5504
5740
|
import_node_fs43.default.mkdirSync(settings("DERIVED_FILE_DIR"), { recursive: true });
|
|
5505
|
-
for (const
|
|
5506
|
-
import_node_fs43.default.mkdirSync(
|
|
5741
|
+
for (const output of allOutputs)
|
|
5742
|
+
import_node_fs43.default.mkdirSync(import_node_path44.default.dirname(output), { recursive: true });
|
|
5507
5743
|
for (const [kind, lists] of fileLists)
|
|
5508
5744
|
lists.forEach((item, index) => {
|
|
5509
5745
|
import_node_fs43.default.writeFileSync(
|
|
@@ -5514,7 +5750,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
5514
5750
|
});
|
|
5515
5751
|
const rawScript = str(phase.shellScript) ?? "";
|
|
5516
5752
|
if (rawScript.includes("generate-modules-provider")) {
|
|
5517
|
-
const preloadPath =
|
|
5753
|
+
const preloadPath = import_node_path44.default.join(phaseDir, "expo-scan-timeout.cjs");
|
|
5518
5754
|
import_node_fs43.default.mkdirSync(phaseDir, { recursive: true });
|
|
5519
5755
|
import_node_fs43.default.writeFileSync(
|
|
5520
5756
|
preloadPath,
|
|
@@ -5546,11 +5782,11 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
5546
5782
|
timeout: runScriptTimeoutMs
|
|
5547
5783
|
});
|
|
5548
5784
|
} catch (error) {
|
|
5549
|
-
const
|
|
5785
|
+
const output = error instanceof Error ? `${error.message}
|
|
5550
5786
|
${"stdout" in error ? String(error.stdout) : ""}${"stderr" in error ? String(error.stderr) : ""}` : String(error);
|
|
5551
5787
|
throw new Error(
|
|
5552
5788
|
`${targetName}: Run Script "${script}" failed preparing generated outputs:
|
|
5553
|
-
${
|
|
5789
|
+
${output}`
|
|
5554
5790
|
);
|
|
5555
5791
|
}
|
|
5556
5792
|
const missing = allOutputs.filter(
|
|
@@ -5561,21 +5797,13 @@ ${output2}`
|
|
|
5561
5797
|
`${targetName}: Run Script "${script}" did not produce ${missing.join(", ")}`
|
|
5562
5798
|
);
|
|
5563
5799
|
preparedSourcePhases.set(key, stamp);
|
|
5564
|
-
preparedXcodePhase(
|
|
5565
|
-
project.projectFile,
|
|
5566
|
-
targetId,
|
|
5567
|
-
phaseId,
|
|
5568
|
-
configuration,
|
|
5569
|
-
allOutputs,
|
|
5570
|
-
true
|
|
5571
|
-
);
|
|
5572
5800
|
}
|
|
5573
5801
|
}
|
|
5574
5802
|
project.visitMembers(
|
|
5575
5803
|
targetId,
|
|
5576
|
-
xcodePathResolver(project.objects, project.projectDir,
|
|
5804
|
+
xcodePathResolver(project.objects, project.projectDir, import_node_path44.default.join, settings),
|
|
5577
5805
|
(file) => isDirectory(file) ? walkFiles(file) : import_node_fs43.default.existsSync(file) ? [file] : [],
|
|
5578
|
-
|
|
5806
|
+
import_node_path44.default.join,
|
|
5579
5807
|
(file, kind, bundleName) => {
|
|
5580
5808
|
if (kind === "header") {
|
|
5581
5809
|
headers.add(file);
|
|
@@ -5588,7 +5816,7 @@ ${output2}`
|
|
|
5588
5816
|
}
|
|
5589
5817
|
if (!import_node_fs43.default.existsSync(file)) {
|
|
5590
5818
|
if (options.requireSources === false) return;
|
|
5591
|
-
const script = scriptForOutput.get(
|
|
5819
|
+
const script = scriptForOutput.get(import_node_path44.default.normalize(file));
|
|
5592
5820
|
throw new Error(
|
|
5593
5821
|
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}`
|
|
5594
5822
|
);
|
|
@@ -5599,7 +5827,7 @@ ${output2}`
|
|
|
5599
5827
|
);
|
|
5600
5828
|
if (options.prepareGeneratedSources && options.requireSources !== false) {
|
|
5601
5829
|
const interfaceFiles = [...resources].filter(
|
|
5602
|
-
(file) => /\.(storyboard|xib)$/.test(file) && !file.split(
|
|
5830
|
+
(file) => /\.(storyboard|xib)$/.test(file) && !file.split(import_node_path44.default.sep).some((part) => part.endsWith(".bundle"))
|
|
5603
5831
|
);
|
|
5604
5832
|
if (process.platform !== "darwin") {
|
|
5605
5833
|
let launchName = settings("INFOPLIST_KEY_UILaunchStoryboardName");
|
|
@@ -5609,7 +5837,7 @@ ${output2}`
|
|
|
5609
5837
|
if (typeof declared === "string") launchName = expand(declared, settings);
|
|
5610
5838
|
}
|
|
5611
5839
|
const runtimeInterfaceFiles = interfaceFiles.filter(
|
|
5612
|
-
(file) =>
|
|
5840
|
+
(file) => import_node_path44.default.basename(file, import_node_path44.default.extname(file)) !== launchName
|
|
5613
5841
|
);
|
|
5614
5842
|
if (runtimeInterfaceFiles.length > 0)
|
|
5615
5843
|
throw new Error(
|
|
@@ -5620,21 +5848,21 @@ ${output2}`
|
|
|
5620
5848
|
}
|
|
5621
5849
|
const interfaceOutputs = /* @__PURE__ */ new Set();
|
|
5622
5850
|
for (const file of interfaceFiles) {
|
|
5623
|
-
const localization = file.split(
|
|
5851
|
+
const localization = file.split(import_node_path44.default.sep).findLast((part) => part.endsWith(".lproj")) ?? "";
|
|
5624
5852
|
const extension = file.endsWith(".storyboard") ? ".storyboardc" : ".nib";
|
|
5625
|
-
const
|
|
5853
|
+
const output = import_node_path44.default.join(
|
|
5626
5854
|
settings("DERIVED_FILE_DIR"),
|
|
5627
5855
|
"InterfaceBuilder",
|
|
5628
5856
|
localization,
|
|
5629
|
-
|
|
5857
|
+
import_node_path44.default.basename(file, import_node_path44.default.extname(file)) + extension
|
|
5630
5858
|
);
|
|
5631
|
-
if (interfaceOutputs.has(
|
|
5632
|
-
throw new Error(`${targetName}: duplicate Interface Builder output ${
|
|
5633
|
-
interfaceOutputs.add(
|
|
5859
|
+
if (interfaceOutputs.has(output))
|
|
5860
|
+
throw new Error(`${targetName}: duplicate Interface Builder output ${output}`);
|
|
5861
|
+
interfaceOutputs.add(output);
|
|
5634
5862
|
const args = [
|
|
5635
5863
|
"ibtool",
|
|
5636
5864
|
"--compile",
|
|
5637
|
-
|
|
5865
|
+
output,
|
|
5638
5866
|
file,
|
|
5639
5867
|
"--module",
|
|
5640
5868
|
settings("PRODUCT_MODULE_NAME")
|
|
@@ -5644,16 +5872,16 @@ ${output2}`
|
|
|
5644
5872
|
const families = settings("TARGETED_DEVICE_FAMILY").split(",").map((value) => value.trim());
|
|
5645
5873
|
if (families.includes("1")) args.push("--target-device", "iphone");
|
|
5646
5874
|
if (families.includes("2")) args.push("--target-device", "ipad");
|
|
5647
|
-
const stamp = `${
|
|
5875
|
+
const stamp = `${output}.peach-inputs`;
|
|
5648
5876
|
const inputs = JSON.stringify({
|
|
5649
5877
|
args,
|
|
5650
5878
|
developer: settings("DEVELOPER_DIR"),
|
|
5651
|
-
source: (0,
|
|
5879
|
+
source: (0, import_node_crypto25.createHash)("sha256").update(import_node_fs43.default.readFileSync(file)).digest("hex")
|
|
5652
5880
|
});
|
|
5653
|
-
if (!import_node_fs43.default.existsSync(
|
|
5654
|
-
import_node_fs43.default.rmSync(
|
|
5881
|
+
if (!import_node_fs43.default.existsSync(output) || !import_node_fs43.default.existsSync(stamp) || import_node_fs43.default.readFileSync(stamp, "utf8") !== inputs) {
|
|
5882
|
+
import_node_fs43.default.rmSync(output, { recursive: true, force: true });
|
|
5655
5883
|
import_node_fs43.default.rmSync(stamp, { force: true });
|
|
5656
|
-
import_node_fs43.default.mkdirSync(
|
|
5884
|
+
import_node_fs43.default.mkdirSync(import_node_path44.default.dirname(output), { recursive: true });
|
|
5657
5885
|
(0, import_node_child_process24.execFileSync)("xcrun", args, {
|
|
5658
5886
|
cwd: project.projectDir,
|
|
5659
5887
|
stdio: ["ignore", "pipe", "pipe"],
|
|
@@ -5663,7 +5891,7 @@ ${output2}`
|
|
|
5663
5891
|
}
|
|
5664
5892
|
projectInputs.add(file);
|
|
5665
5893
|
resources.delete(file);
|
|
5666
|
-
for (const compiled of isDirectory(
|
|
5894
|
+
for (const compiled of isDirectory(output) ? walkFiles(output) : [output])
|
|
5667
5895
|
resources.add(compiled);
|
|
5668
5896
|
}
|
|
5669
5897
|
const definitions = [...allSources].filter(
|
|
@@ -5676,20 +5904,20 @@ ${output2}`
|
|
|
5676
5904
|
for (const definition of definitions) {
|
|
5677
5905
|
const configuredLanguage = settings("INTENTS_CODEGEN_LANGUAGE");
|
|
5678
5906
|
const language = !configuredLanguage || configuredLanguage === "Automatic" ? sources.size > 0 ? "Swift" : "Objective-C" : configuredLanguage;
|
|
5679
|
-
const
|
|
5907
|
+
const output = import_node_path44.default.join(
|
|
5680
5908
|
settings("DERIVED_FILE_DIR"),
|
|
5681
5909
|
"IntentDefinitionGenerated",
|
|
5682
|
-
|
|
5910
|
+
import_node_path44.default.basename(definition, ".intentdefinition")
|
|
5683
5911
|
);
|
|
5684
|
-
import_node_fs43.default.rmSync(
|
|
5685
|
-
import_node_fs43.default.mkdirSync(
|
|
5912
|
+
import_node_fs43.default.rmSync(output, { recursive: true, force: true });
|
|
5913
|
+
import_node_fs43.default.mkdirSync(output, { recursive: true });
|
|
5686
5914
|
const args = [
|
|
5687
5915
|
"intentbuilderc",
|
|
5688
5916
|
"generate",
|
|
5689
5917
|
"-input",
|
|
5690
5918
|
definition,
|
|
5691
5919
|
"-output",
|
|
5692
|
-
|
|
5920
|
+
output,
|
|
5693
5921
|
"-classPrefix",
|
|
5694
5922
|
settings("PROJECT_CLASS_PREFIX"),
|
|
5695
5923
|
"-language",
|
|
@@ -5706,12 +5934,12 @@ ${output2}`
|
|
|
5706
5934
|
stdio: ["ignore", "pipe", "pipe"],
|
|
5707
5935
|
timeout: runScriptTimeoutMs
|
|
5708
5936
|
});
|
|
5709
|
-
const compiled =
|
|
5937
|
+
const compiled = import_node_path44.default.join(
|
|
5710
5938
|
settings("DERIVED_FILE_DIR"),
|
|
5711
5939
|
"IntentDefinitionCompiled",
|
|
5712
|
-
definition.split(
|
|
5940
|
+
definition.split(import_node_path44.default.sep).findLast((part) => part.endsWith(".lproj")) ?? ""
|
|
5713
5941
|
);
|
|
5714
|
-
const compiledDefinition =
|
|
5942
|
+
const compiledDefinition = import_node_path44.default.join(compiled, import_node_path44.default.basename(definition));
|
|
5715
5943
|
import_node_fs43.default.rmSync(compiledDefinition, { force: true });
|
|
5716
5944
|
import_node_fs43.default.mkdirSync(compiled, { recursive: true });
|
|
5717
5945
|
(0, import_node_child_process24.execFileSync)(
|
|
@@ -5734,7 +5962,7 @@ ${output2}`
|
|
|
5734
5962
|
);
|
|
5735
5963
|
resources.add(compiledDefinition);
|
|
5736
5964
|
projectInputs.add(definition);
|
|
5737
|
-
for (const file of walkFiles(
|
|
5965
|
+
for (const file of walkFiles(output)) {
|
|
5738
5966
|
allSources.add(file);
|
|
5739
5967
|
if (file.endsWith(".swift")) sources.add(file);
|
|
5740
5968
|
if (HEADER_FILE.test(file)) headers.add(file);
|
|
@@ -5754,22 +5982,22 @@ ${output2}`
|
|
|
5754
5982
|
function commonAncestor(dirs) {
|
|
5755
5983
|
let common = dirs[0];
|
|
5756
5984
|
for (const dir of dirs) {
|
|
5757
|
-
while (common !==
|
|
5758
|
-
common =
|
|
5985
|
+
while (common !== import_node_path44.default.dirname(common) && import_node_path44.default.relative(common, dir).startsWith(".."))
|
|
5986
|
+
common = import_node_path44.default.dirname(common);
|
|
5759
5987
|
}
|
|
5760
5988
|
return common;
|
|
5761
5989
|
}
|
|
5762
|
-
var isPodsProject = (xcodeproj) =>
|
|
5990
|
+
var isPodsProject = (xcodeproj) => import_node_path44.default.basename(xcodeproj) === "Pods.xcodeproj" && import_node_path44.default.basename(import_node_path44.default.dirname(xcodeproj)) === "Pods";
|
|
5763
5991
|
function installedPodsSandbox(pods) {
|
|
5764
|
-
const podfileLock =
|
|
5765
|
-
const manifestLock =
|
|
5992
|
+
const podfileLock = import_node_path44.default.join(import_node_path44.default.dirname(pods), "Podfile.lock");
|
|
5993
|
+
const manifestLock = import_node_path44.default.join(pods, "Manifest.lock");
|
|
5766
5994
|
if (!import_node_fs43.default.existsSync(podfileLock))
|
|
5767
5995
|
throw new Error(
|
|
5768
|
-
`${pods} has no ${podfileLock}: run \`pod install\` in ${
|
|
5996
|
+
`${pods} has no ${podfileLock}: run \`pod install\` in ${import_node_path44.default.dirname(pods)}`
|
|
5769
5997
|
);
|
|
5770
5998
|
if (!import_node_fs43.default.existsSync(manifestLock) || !import_node_fs43.default.readFileSync(manifestLock).equals(import_node_fs43.default.readFileSync(podfileLock)))
|
|
5771
5999
|
throw new Error(
|
|
5772
|
-
`The sandbox is not in sync with the Podfile.lock: ${manifestLock} differs from ${podfileLock}. Run \`pod install\` in ${
|
|
6000
|
+
`The sandbox is not in sync with the Podfile.lock: ${manifestLock} differs from ${podfileLock}. Run \`pod install\` in ${import_node_path44.default.dirname(pods)}`
|
|
5773
6001
|
);
|
|
5774
6002
|
const specChecksums = {};
|
|
5775
6003
|
const lines = import_node_fs43.default.readFileSync(manifestLock, "utf8").split("\n");
|
|
@@ -5779,12 +6007,28 @@ function installedPodsSandbox(pods) {
|
|
|
5779
6007
|
if (!entry) break;
|
|
5780
6008
|
specChecksums[entry[1]] = entry[2];
|
|
5781
6009
|
}
|
|
5782
|
-
const specs =
|
|
6010
|
+
const specs = import_node_path44.default.join(pods, "Local Podspecs");
|
|
6011
|
+
const generated = import_node_path44.default.join(pods, POD_GRAPH_SPECIFICATIONS);
|
|
6012
|
+
if (import_node_fs43.default.existsSync(generated))
|
|
6013
|
+
return {
|
|
6014
|
+
podfileLock,
|
|
6015
|
+
manifestLock,
|
|
6016
|
+
specChecksums,
|
|
6017
|
+
localPodspecs: readPodGraphSpecifications(generated),
|
|
6018
|
+
specificationFiles: [generated]
|
|
6019
|
+
};
|
|
6020
|
+
const specificationFiles = isDirectory(specs) ? import_node_fs43.default.readdirSync(specs).filter((name) => name.endsWith(".podspec.json")).sort().map((name) => import_node_path44.default.join(specs, name)) : [];
|
|
5783
6021
|
return {
|
|
5784
6022
|
podfileLock,
|
|
5785
6023
|
manifestLock,
|
|
5786
6024
|
specChecksums,
|
|
5787
|
-
localPodspecs:
|
|
6025
|
+
localPodspecs: new Map(
|
|
6026
|
+
specificationFiles.map((file) => [
|
|
6027
|
+
import_node_path44.default.basename(file, ".podspec.json"),
|
|
6028
|
+
import_node_fs43.default.readFileSync(file, "utf8")
|
|
6029
|
+
])
|
|
6030
|
+
),
|
|
6031
|
+
specificationFiles
|
|
5788
6032
|
};
|
|
5789
6033
|
}
|
|
5790
6034
|
function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
|
|
@@ -5796,14 +6040,14 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
|
|
|
5796
6040
|
if (!xcodeProjectFile(xcodeproj)) {
|
|
5797
6041
|
if (installedPods && isPodsProject(xcodeproj))
|
|
5798
6042
|
throw new Error(
|
|
5799
|
-
`${
|
|
6043
|
+
`${import_node_path44.default.basename(xcodeprojOrWorkspace)} builds ${xcodeproj}, which is not installed: run \`pod install\` in ${import_node_path44.default.dirname(import_node_path44.default.dirname(xcodeproj))}`
|
|
5800
6044
|
);
|
|
5801
6045
|
return;
|
|
5802
6046
|
}
|
|
5803
6047
|
const key = import_node_fs43.default.realpathSync.native(xcodeproj);
|
|
5804
|
-
if (projectAt.has(key) || !installedPods && key.split(
|
|
6048
|
+
if (projectAt.has(key) || !installedPods && key.split(import_node_path44.default.sep).includes("Pods"))
|
|
5805
6049
|
return;
|
|
5806
|
-
if (isPodsProject(key)) cocoapods = installedPodsSandbox(
|
|
6050
|
+
if (isPodsProject(key)) cocoapods = installedPodsSandbox(import_node_path44.default.dirname(key));
|
|
5807
6051
|
const project = loadProject(key);
|
|
5808
6052
|
projectAt.set(key, project);
|
|
5809
6053
|
projects.push(project);
|
|
@@ -5819,12 +6063,12 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
|
|
|
5819
6063
|
for (const reference of listed)
|
|
5820
6064
|
if (reference.endsWith(".xcodeproj")) addProject(reference);
|
|
5821
6065
|
if (projects.length === 0) {
|
|
5822
|
-
throw new Error(`${
|
|
6066
|
+
throw new Error(`${import_node_path44.default.basename(xcodeprojOrWorkspace)} lists no Xcode project`);
|
|
5823
6067
|
}
|
|
5824
|
-
const podfile =
|
|
6068
|
+
const podfile = import_node_path44.default.join(import_node_path44.default.dirname(xcodeprojOrWorkspace), "Podfile");
|
|
5825
6069
|
if (installedPods && !cocoapods && import_node_fs43.default.existsSync(podfile))
|
|
5826
6070
|
throw new Error(
|
|
5827
|
-
`${podfile} is not installed into ${
|
|
6071
|
+
`${podfile} is not installed into ${import_node_path44.default.basename(xcodeprojOrWorkspace)}: run \`pod install\` in ${import_node_path44.default.dirname(podfile)} and open the workspace it writes`
|
|
5828
6072
|
);
|
|
5829
6073
|
return { listed, projects, projectAt, cocoapods };
|
|
5830
6074
|
}
|
|
@@ -5877,26 +6121,26 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
|
5877
6121
|
];
|
|
5878
6122
|
const found = containers.flatMap(
|
|
5879
6123
|
(dir) => [
|
|
5880
|
-
|
|
5881
|
-
...isDirectory(
|
|
6124
|
+
import_node_path44.default.join(dir, "xcshareddata"),
|
|
6125
|
+
...isDirectory(import_node_path44.default.join(dir, "xcuserdata")) ? import_node_fs43.default.readdirSync(import_node_path44.default.join(dir, "xcuserdata")).sort().map((user) => import_node_path44.default.join(dir, "xcuserdata", user)) : []
|
|
5882
6126
|
].map((data) => ({
|
|
5883
6127
|
dir,
|
|
5884
|
-
file:
|
|
6128
|
+
file: import_node_path44.default.join(data, "xcschemes", `${scheme}.xcscheme`)
|
|
5885
6129
|
}))
|
|
5886
6130
|
).find((candidate) => import_node_fs43.default.existsSync(candidate.file));
|
|
5887
6131
|
if (!found) {
|
|
5888
6132
|
const known = containers.flatMap(
|
|
5889
|
-
(dir) => import_node_fs43.default.existsSync(
|
|
6133
|
+
(dir) => import_node_fs43.default.existsSync(import_node_path44.default.join(dir, "xcshareddata", "xcschemes")) ? import_node_fs43.default.readdirSync(import_node_path44.default.join(dir, "xcshareddata", "xcschemes")).filter((name2) => name2.endsWith(".xcscheme")).map((name2) => name2.slice(0, -".xcscheme".length)).sort() : []
|
|
5890
6134
|
);
|
|
5891
6135
|
throw new Error(
|
|
5892
|
-
`${
|
|
6136
|
+
`${import_node_path44.default.basename(container)} has no scheme ${scheme}; it shares ${known.join(", ") || "none"}`
|
|
5893
6137
|
);
|
|
5894
6138
|
}
|
|
5895
6139
|
const launch = /<LaunchAction\b([^>]*)>([\s\S]*?)<\/LaunchAction>/.exec(
|
|
5896
6140
|
import_node_fs43.default.readFileSync(found.file, "utf8")
|
|
5897
6141
|
);
|
|
5898
|
-
const attribute = (
|
|
5899
|
-
const value = new RegExp(`\\b${name2}\\s*=\\s*"([^"]*)"`).exec(
|
|
6142
|
+
const attribute = (text3, name2) => {
|
|
6143
|
+
const value = new RegExp(`\\b${name2}\\s*=\\s*"([^"]*)"`).exec(text3)?.[1];
|
|
5900
6144
|
return value === void 0 ? void 0 : decodeXml(value);
|
|
5901
6145
|
};
|
|
5902
6146
|
const runnable = launch ? /<BuildableProductRunnable\b[\s\S]*?<BuildableReference\b([^>]*)>/.exec(launch[2]) : null;
|
|
@@ -5906,8 +6150,8 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
|
5906
6150
|
if (!configuration || !blueprint || !referenced?.startsWith("container:")) {
|
|
5907
6151
|
throw new Error(`scheme ${scheme} runs no application target`);
|
|
5908
6152
|
}
|
|
5909
|
-
const projectPath =
|
|
5910
|
-
|
|
6153
|
+
const projectPath = import_node_path44.default.resolve(
|
|
6154
|
+
import_node_path44.default.dirname(found.dir),
|
|
5911
6155
|
referenced.slice("container:".length)
|
|
5912
6156
|
);
|
|
5913
6157
|
const project = projects.find(
|
|
@@ -5931,26 +6175,26 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
|
5931
6175
|
var NativeAppTargetSelectionError = class extends Error {
|
|
5932
6176
|
};
|
|
5933
6177
|
function selectIosAppTarget(projectRoot, iosTarget) {
|
|
5934
|
-
const nested =
|
|
6178
|
+
const nested = import_node_path44.default.join(projectRoot, "ios");
|
|
5935
6179
|
const iosRoot = import_node_fs43.default.existsSync(nested) ? nested : projectRoot;
|
|
5936
6180
|
const entries = import_node_fs43.default.readdirSync(iosRoot, { withFileTypes: true });
|
|
5937
6181
|
const projects = (entries.some((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj")) ? entries.filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj")).map((entry) => ({
|
|
5938
|
-
xcodeproj:
|
|
6182
|
+
xcodeproj: import_node_path44.default.join(iosRoot, entry.name),
|
|
5939
6183
|
workspace: null
|
|
5940
6184
|
})) : entries.filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcworkspace")).flatMap((entry) => {
|
|
5941
|
-
const workspace =
|
|
6185
|
+
const workspace = import_node_path44.default.join(iosRoot, entry.name);
|
|
5942
6186
|
return workspaceReferences(workspace).map((xcodeproj2) => ({
|
|
5943
6187
|
xcodeproj: xcodeproj2,
|
|
5944
6188
|
workspace
|
|
5945
6189
|
}));
|
|
5946
6190
|
}).filter(
|
|
5947
|
-
({ xcodeproj: xcodeproj2 }) => xcodeproj2.endsWith(".xcodeproj") && !xcodeproj2.split(
|
|
6191
|
+
({ xcodeproj: xcodeproj2 }) => xcodeproj2.endsWith(".xcodeproj") && !xcodeproj2.split(import_node_path44.default.sep).includes("Pods") && import_node_fs43.default.existsSync(xcodeproj2)
|
|
5948
6192
|
).filter(
|
|
5949
6193
|
({ xcodeproj: xcodeproj2 }) => listXcodeAppTargets(xcodeproj2, { requireSources: false }).length > 0
|
|
5950
6194
|
)).map(({ xcodeproj: xcodeproj2, workspace }) => ({
|
|
5951
6195
|
xcodeproj: xcodeproj2,
|
|
5952
6196
|
workspace,
|
|
5953
|
-
name:
|
|
6197
|
+
name: import_node_path44.default.basename(xcodeproj2)
|
|
5954
6198
|
}));
|
|
5955
6199
|
if (projects.length === 0) return null;
|
|
5956
6200
|
if (projects.length > 1 && !iosTarget) {
|
|
@@ -5991,11 +6235,11 @@ function selectIosAppTarget(projectRoot, iosTarget) {
|
|
|
5991
6235
|
const workspace = xcodeproj.replace(/\.xcodeproj$/, ".xcworkspace");
|
|
5992
6236
|
const container = import_node_fs43.default.existsSync(workspace) ? workspace : xcodeproj;
|
|
5993
6237
|
const hasScheme = [container, xcodeproj].some((dir) => {
|
|
5994
|
-
if (import_node_fs43.default.existsSync(
|
|
6238
|
+
if (import_node_fs43.default.existsSync(import_node_path44.default.join(dir, "xcshareddata", "xcschemes", `${target}.xcscheme`)))
|
|
5995
6239
|
return true;
|
|
5996
|
-
const users =
|
|
6240
|
+
const users = import_node_path44.default.join(dir, "xcuserdata");
|
|
5997
6241
|
return import_node_fs43.default.existsSync(users) && import_node_fs43.default.readdirSync(users).some(
|
|
5998
|
-
(user) => import_node_fs43.default.existsSync(
|
|
6242
|
+
(user) => import_node_fs43.default.existsSync(import_node_path44.default.join(users, user, "xcschemes", `${target}.xcscheme`))
|
|
5999
6243
|
);
|
|
6000
6244
|
});
|
|
6001
6245
|
if (hasScheme) target = readXcodeScheme(container, target).target;
|
|
@@ -6006,8 +6250,8 @@ function selectIosAppTarget(projectRoot, iosTarget) {
|
|
|
6006
6250
|
);
|
|
6007
6251
|
return { xcodeproj, target, workspace: project.workspace };
|
|
6008
6252
|
}
|
|
6009
|
-
var workspaceResolvedFile = (xcodeprojOrWorkspace) =>
|
|
6010
|
-
xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace :
|
|
6253
|
+
var workspaceResolvedFile = (xcodeprojOrWorkspace) => import_node_path44.default.join(
|
|
6254
|
+
xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : import_node_path44.default.join(xcodeprojOrWorkspace, "project.xcworkspace"),
|
|
6011
6255
|
"xcshareddata",
|
|
6012
6256
|
"swiftpm",
|
|
6013
6257
|
"Package.resolved"
|
|
@@ -6035,7 +6279,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6035
6279
|
(ref) => options.frameworkMachOType ? ref.target.name === targetName && FRAMEWORK_PRODUCTS.has(str(ref.target.productType) ?? "") : isIosAppTarget(ref, options) || targetName !== void 0 && ref.target.name === targetName && ref.target.productType === APP_EXTENSION
|
|
6036
6280
|
);
|
|
6037
6281
|
const appTargetNames = appTargets.map((ref) => str(ref.target.name) ?? ref.id);
|
|
6038
|
-
const container =
|
|
6282
|
+
const container = import_node_path44.default.basename(xcodeprojOrWorkspace);
|
|
6039
6283
|
const named = targetName ? appTargets.filter((ref) => ref.target.name === targetName) : appTargets;
|
|
6040
6284
|
if (named.length !== 1) {
|
|
6041
6285
|
if (options.frameworkMachOType)
|
|
@@ -6060,8 +6304,8 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6060
6304
|
for (const ref of allTargets) {
|
|
6061
6305
|
const product = ref.project.object(str(ref.target.productReference));
|
|
6062
6306
|
const file = str(product?.path);
|
|
6063
|
-
if (file && !byProduct.has(
|
|
6064
|
-
byProduct.set(
|
|
6307
|
+
if (file && !byProduct.has(import_node_path44.default.basename(file)))
|
|
6308
|
+
byProduct.set(import_node_path44.default.basename(file), ref);
|
|
6065
6309
|
}
|
|
6066
6310
|
const proxied = (project, proxyId) => {
|
|
6067
6311
|
const proxy = project.object(proxyId);
|
|
@@ -6085,7 +6329,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6085
6329
|
const buildFile = project.object(buildFileId);
|
|
6086
6330
|
if (!buildFile || !xcodeBuildFileBuildsForIos(buildFile)) continue;
|
|
6087
6331
|
const file = project.object(str(buildFile.fileRef));
|
|
6088
|
-
const resolved = file?.isa === "PBXReferenceProxy" ? proxied(project, str(file.remoteRef)) : file && str(file.sourceTree) === "BUILT_PRODUCTS_DIR" ? byProduct.get(
|
|
6332
|
+
const resolved = file?.isa === "PBXReferenceProxy" ? proxied(project, str(file.remoteRef)) : file && str(file.sourceTree) === "BUILT_PRODUCTS_DIR" ? byProduct.get(import_node_path44.default.basename(str(file.path) ?? "")) : void 0;
|
|
6089
6333
|
if (resolved)
|
|
6090
6334
|
found.push({
|
|
6091
6335
|
target: resolved,
|
|
@@ -6166,7 +6410,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6166
6410
|
const otherProduct = productName(other);
|
|
6167
6411
|
for (const { file, visibility } of headerPhase(other)) {
|
|
6168
6412
|
if (visibility === "Project") continue;
|
|
6169
|
-
const key = `${otherProduct}/${
|
|
6413
|
+
const key = `${otherProduct}/${import_node_path44.default.basename(file)}`;
|
|
6170
6414
|
if (!headers.has(key)) headers.set(key, file);
|
|
6171
6415
|
}
|
|
6172
6416
|
}
|
|
@@ -6197,7 +6441,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6197
6441
|
ref.id,
|
|
6198
6442
|
ref.project.resolvePath,
|
|
6199
6443
|
(file) => isDirectory(file) ? walkFiles(file) : import_node_fs43.default.existsSync(file) ? [file] : [],
|
|
6200
|
-
|
|
6444
|
+
import_node_path44.default.join,
|
|
6201
6445
|
(file, kind) => {
|
|
6202
6446
|
if (kind === "header") found.push(file);
|
|
6203
6447
|
}
|
|
@@ -6213,12 +6457,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6213
6457
|
for (const ref of projectTargets(project)) {
|
|
6214
6458
|
const product = productName(ref);
|
|
6215
6459
|
for (const { file, visibility } of headerPhase(ref)) {
|
|
6216
|
-
const name =
|
|
6460
|
+
const name = import_node_path44.default.basename(file);
|
|
6217
6461
|
if (!entries.has(name))
|
|
6218
6462
|
entries.set(name, visibility !== "Project" ? `${product}/${name}` : file);
|
|
6219
6463
|
}
|
|
6220
6464
|
for (const file of synchronizedHeaders(ref)) {
|
|
6221
|
-
const name =
|
|
6465
|
+
const name = import_node_path44.default.basename(file);
|
|
6222
6466
|
if (!entries.has(name)) entries.set(name, file);
|
|
6223
6467
|
}
|
|
6224
6468
|
}
|
|
@@ -6228,7 +6472,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6228
6472
|
if (folder === null) continue;
|
|
6229
6473
|
for (const file of walkFiles(folder)) {
|
|
6230
6474
|
if (!HEADER_FILE.test(file)) continue;
|
|
6231
|
-
const name =
|
|
6475
|
+
const name = import_node_path44.default.basename(file);
|
|
6232
6476
|
if (!entries.has(name)) entries.set(name, file);
|
|
6233
6477
|
}
|
|
6234
6478
|
}
|
|
@@ -6236,18 +6480,18 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6236
6480
|
for (const id of Object.keys(project.objects)) {
|
|
6237
6481
|
if (project.object(id)?.isa !== "PBXFileReference") continue;
|
|
6238
6482
|
const file = project.resolvePath(id);
|
|
6239
|
-
if (file && HEADER_FILE.test(file) && !entries.has(
|
|
6240
|
-
entries.set(
|
|
6483
|
+
if (file && HEADER_FILE.test(file) && !entries.has(import_node_path44.default.basename(file)))
|
|
6484
|
+
entries.set(import_node_path44.default.basename(file), file);
|
|
6241
6485
|
}
|
|
6242
6486
|
const map = [...entries];
|
|
6243
6487
|
projectHeaderMaps.set(project, map);
|
|
6244
6488
|
return map;
|
|
6245
6489
|
};
|
|
6246
6490
|
const xcconfigs = /* @__PURE__ */ new Set();
|
|
6247
|
-
const buildDir = (project) =>
|
|
6491
|
+
const buildDir = (project) => import_node_path44.default.join(project.projectDir, ".build/peach-xcode/Build");
|
|
6248
6492
|
const workspaceBuild = {
|
|
6249
|
-
SYMROOT:
|
|
6250
|
-
OBJROOT:
|
|
6493
|
+
SYMROOT: import_node_path44.default.join(buildDir(app.project), "Products"),
|
|
6494
|
+
OBJROOT: import_node_path44.default.join(buildDir(app.project), "Intermediates.noindex")
|
|
6251
6495
|
};
|
|
6252
6496
|
const moduleTarget = (ref) => {
|
|
6253
6497
|
const name = str(ref.target.name) ?? ref.id;
|
|
@@ -6262,16 +6506,16 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6262
6506
|
TARGET_NAME: name,
|
|
6263
6507
|
TARGETNAME: "$(TARGET_NAME)",
|
|
6264
6508
|
PROJECT: "$(PROJECT_NAME)",
|
|
6265
|
-
PROJECT_NAME:
|
|
6509
|
+
PROJECT_NAME: import_node_path44.default.basename(ref.project.xcodeproj, ".xcodeproj"),
|
|
6266
6510
|
PROJECT_CLASS_PREFIX: isDict(ref.project.project.attributes) ? str(ref.project.project.attributes.CLASSPREFIX) ?? "" : "",
|
|
6267
6511
|
PROJECT_FILE_PATH: ref.project.xcodeproj,
|
|
6268
6512
|
SRCROOT: ref.project.projectDir,
|
|
6269
6513
|
SOURCE_ROOT: ref.project.projectDir,
|
|
6270
6514
|
PROJECT_DIR: ref.project.projectDir,
|
|
6271
|
-
SYMROOT:
|
|
6515
|
+
SYMROOT: import_node_path44.default.join(buildDir(ref.project), "Products"),
|
|
6272
6516
|
BUILD_DIR: "$(SYMROOT)",
|
|
6273
6517
|
BUILD_ROOT: "$(SYMROOT)",
|
|
6274
|
-
OBJROOT:
|
|
6518
|
+
OBJROOT: import_node_path44.default.join(buildDir(ref.project), "Intermediates.noindex"),
|
|
6275
6519
|
CONFIGURATION_BUILD_DIR: "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)",
|
|
6276
6520
|
BUILT_PRODUCTS_DIR: "$(CONFIGURATION_BUILD_DIR)",
|
|
6277
6521
|
TARGET_BUILD_DIR: "$(CONFIGURATION_BUILD_DIR)",
|
|
@@ -6315,12 +6559,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6315
6559
|
const { headers, allSources, ...members } = targetMembers(
|
|
6316
6560
|
ref,
|
|
6317
6561
|
settings2,
|
|
6318
|
-
options,
|
|
6562
|
+
ref === app && options.nativeModules ? { ...options, requireSources: false } : options,
|
|
6319
6563
|
keys,
|
|
6320
6564
|
xcconfigs
|
|
6321
6565
|
);
|
|
6322
6566
|
const searchRules = recursiveSearchRules(settings2);
|
|
6323
|
-
const absolute = (file) =>
|
|
6567
|
+
const absolute = (file) => import_node_path44.default.resolve(ref.project.projectDir, file);
|
|
6324
6568
|
const framework = FRAMEWORK_PRODUCTS.has(str(ref.target.productType) ?? "");
|
|
6325
6569
|
const product = settings2("PRODUCT_NAME");
|
|
6326
6570
|
const moduleName = applyOperator(settings2("PRODUCT_MODULE_NAME"), "c99extidentifier");
|
|
@@ -6351,7 +6595,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6351
6595
|
`${name}: Swift compatibility header phase has no Swift producer sources`
|
|
6352
6596
|
);
|
|
6353
6597
|
const building = options.prepareGeneratedSources && options.requireSources !== false;
|
|
6354
|
-
const versioning = building && allSources.length > 0 && settings2("VERSIONING_SYSTEM") === "apple-generic" ?
|
|
6598
|
+
const versioning = building && allSources.length > 0 && settings2("VERSIONING_SYSTEM") === "apple-generic" ? import_node_path44.default.join(settings2("DERIVED_FILE_DIR"), `${product}_vers.c`) : null;
|
|
6355
6599
|
if (versioning) {
|
|
6356
6600
|
const version = settings2("CURRENT_PROJECT_VERSION");
|
|
6357
6601
|
const custom = [
|
|
@@ -6364,7 +6608,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6364
6608
|
].filter((key) => settings2(key));
|
|
6365
6609
|
if (custom.length)
|
|
6366
6610
|
throw new Error(
|
|
6367
|
-
`${name}: Xcode generates ${
|
|
6611
|
+
`${name}: Xcode generates ${import_node_path44.default.basename(versioning)} with ${custom.join(", ")}; peach does not model VERSION_INFO_* overrides`
|
|
6368
6612
|
);
|
|
6369
6613
|
const symbol = product.replace(/^[^A-Za-z_]/, "_").replace(/[^A-Za-z0-9_]/g, "_");
|
|
6370
6614
|
const [major, minor] = version.split(".");
|
|
@@ -6378,7 +6622,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6378
6622
|
""
|
|
6379
6623
|
].join("\n");
|
|
6380
6624
|
if (!import_node_fs43.default.existsSync(versioning) || import_node_fs43.default.readFileSync(versioning, "utf8") !== unit) {
|
|
6381
|
-
import_node_fs43.default.mkdirSync(
|
|
6625
|
+
import_node_fs43.default.mkdirSync(import_node_path44.default.dirname(versioning), { recursive: true });
|
|
6382
6626
|
import_node_fs43.default.writeFileSync(versioning, unit);
|
|
6383
6627
|
}
|
|
6384
6628
|
allSources.push(versioning);
|
|
@@ -6398,7 +6642,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6398
6642
|
const headerFiles = headerPhase(ref);
|
|
6399
6643
|
const ownHeaders = /* @__PURE__ */ new Map();
|
|
6400
6644
|
for (const { file, visibility } of headerFiles) {
|
|
6401
|
-
const name2 =
|
|
6645
|
+
const name2 = import_node_path44.default.basename(file);
|
|
6402
6646
|
const published = visibility !== "Project";
|
|
6403
6647
|
if (!ownHeaders.has(name2))
|
|
6404
6648
|
ownHeaders.set(name2, published ? `${product}/${name2}` : file);
|
|
@@ -6406,27 +6650,27 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6406
6650
|
ownHeaders.set(`${product}/${name2}`, file);
|
|
6407
6651
|
}
|
|
6408
6652
|
for (const file of synchronizedHeaders(ref)) {
|
|
6409
|
-
const name2 =
|
|
6653
|
+
const name2 = import_node_path44.default.basename(file);
|
|
6410
6654
|
if (ownHeaders.has(name2)) continue;
|
|
6411
6655
|
ownHeaders.set(name2, file);
|
|
6412
6656
|
const qualified = `${product}/${name2}`;
|
|
6413
6657
|
if (!ownHeaders.has(qualified)) ownHeaders.set(qualified, file);
|
|
6414
6658
|
}
|
|
6415
6659
|
const nonFrameworkHeaders = nonFrameworkHeadersOf(ref.project);
|
|
6416
|
-
const wrapper =
|
|
6660
|
+
const wrapper = import_node_path44.default.join(settings2("BUILT_PRODUCTS_DIR"), `${product}.framework`);
|
|
6417
6661
|
const moduleMap = (settings2("DEFINES_MODULE") === "YES" || !framework) && settings2("MODULEMAP_FILE") ? absolute(settings2("MODULEMAP_FILE")) : null;
|
|
6418
|
-
const frameworkUmbrella = !compatibility && framework && members.sources.length > 0 && moduleMap ?
|
|
6662
|
+
const frameworkUmbrella = !compatibility && framework && members.sources.length > 0 && moduleMap ? import_node_path44.default.join(import_node_path44.default.dirname(moduleMap), `${moduleName}-umbrella.h`) : null;
|
|
6419
6663
|
const frameworkCompatibility = frameworkUmbrella && moduleMap && import_node_fs43.default.existsSync(moduleMap) && import_node_fs43.default.existsSync(frameworkUmbrella) ? {
|
|
6420
6664
|
framework: true,
|
|
6421
6665
|
moduleMap,
|
|
6422
6666
|
umbrella: frameworkUmbrella,
|
|
6423
|
-
outputModuleMap:
|
|
6424
|
-
outputUmbrella:
|
|
6667
|
+
outputModuleMap: import_node_path44.default.join(wrapper, "Modules", "module.modulemap"),
|
|
6668
|
+
outputUmbrella: import_node_path44.default.join(
|
|
6425
6669
|
wrapper,
|
|
6426
6670
|
"Headers",
|
|
6427
|
-
|
|
6671
|
+
import_node_path44.default.basename(frameworkUmbrella)
|
|
6428
6672
|
),
|
|
6429
|
-
outputHeader:
|
|
6673
|
+
outputHeader: import_node_path44.default.join(
|
|
6430
6674
|
wrapper,
|
|
6431
6675
|
"Headers",
|
|
6432
6676
|
settings2("SWIFT_OBJC_INTERFACE_HEADER_NAME") || `${moduleName}-Swift.h`
|
|
@@ -6440,9 +6684,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6440
6684
|
outputUmbrella: compatibility.outputUmbrella,
|
|
6441
6685
|
outputHeader: compatibility.outputHeader
|
|
6442
6686
|
} : frameworkCompatibility;
|
|
6443
|
-
const podHeaders = !framework && isPodsProject(ref.project.xcodeproj) && moduleMap &&
|
|
6687
|
+
const podHeaders = !framework && isPodsProject(ref.project.xcodeproj) && moduleMap && import_node_path44.default.relative(import_node_path44.default.join(ref.project.projectDir, "Headers", "Public"), moduleMap).split(import_node_path44.default.sep)[0] !== ".." && import_node_fs43.default.existsSync(moduleMap) ? import_node_fs43.default.readdirSync(import_node_path44.default.dirname(moduleMap)).flatMap((entry) => {
|
|
6444
6688
|
if (!/\.(h|hh|hpp|hxx|modulemap)$/.test(entry)) return [];
|
|
6445
|
-
const file =
|
|
6689
|
+
const file = import_node_path44.default.join(import_node_path44.default.dirname(moduleMap), entry);
|
|
6446
6690
|
return import_node_fs43.default.existsSync(file) ? [file] : [];
|
|
6447
6691
|
}) : [];
|
|
6448
6692
|
const fileFlags = {};
|
|
@@ -6524,15 +6768,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6524
6768
|
// xcode searches its products' include directory before
|
|
6525
6769
|
// HEADER_SEARCH_PATHS and the target's derived sources after.
|
|
6526
6770
|
headerSearchPaths: [
|
|
6527
|
-
|
|
6771
|
+
import_node_path44.default.join(settings2("BUILT_PRODUCTS_DIR"), "include"),
|
|
6528
6772
|
...settingList(settings2("HEADER_SEARCH_PATHS")).flatMap(
|
|
6529
6773
|
(raw) => expandSearchPath(absolute(raw), searchRules)
|
|
6530
6774
|
),
|
|
6531
|
-
|
|
6775
|
+
import_node_path44.default.join(
|
|
6532
6776
|
`${settings2("DERIVED_FILE_DIR")}-normal`,
|
|
6533
6777
|
settings2("CURRENT_ARCH")
|
|
6534
6778
|
),
|
|
6535
|
-
|
|
6779
|
+
import_node_path44.default.join(settings2("DERIVED_FILE_DIR"), settings2("CURRENT_ARCH")),
|
|
6536
6780
|
settings2("DERIVED_FILE_DIR")
|
|
6537
6781
|
],
|
|
6538
6782
|
userHeaderSearchPaths: settingList(
|
|
@@ -6582,10 +6826,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6582
6826
|
...headerFiles.flatMap(
|
|
6583
6827
|
({ file, visibility }) => visibility === "Project" ? [] : [
|
|
6584
6828
|
[
|
|
6585
|
-
|
|
6829
|
+
import_node_path44.default.join(
|
|
6586
6830
|
wrapper,
|
|
6587
6831
|
visibility === "Public" ? "Headers" : "PrivateHeaders",
|
|
6588
|
-
|
|
6832
|
+
import_node_path44.default.basename(file)
|
|
6589
6833
|
),
|
|
6590
6834
|
file
|
|
6591
6835
|
]
|
|
@@ -6599,7 +6843,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6599
6843
|
return [];
|
|
6600
6844
|
const destination = expand(
|
|
6601
6845
|
str(phase.dstPath) ?? "",
|
|
6602
|
-
(name2) => name2 === "PUBLIC_HEADERS_FOLDER_PATH" ?
|
|
6846
|
+
(name2) => name2 === "PUBLIC_HEADERS_FOLDER_PATH" ? import_node_path44.default.join(wrapper, "Headers") : name2 === "PRIVATE_HEADERS_FOLDER_PATH" ? import_node_path44.default.join(wrapper, "PrivateHeaders") : settings2(name2)
|
|
6603
6847
|
);
|
|
6604
6848
|
return list(phase.files).flatMap((id) => {
|
|
6605
6849
|
const file = ref.project.resolvePath(
|
|
@@ -6607,17 +6851,17 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6607
6851
|
);
|
|
6608
6852
|
return file && HEADER_FILE.test(file) ? [
|
|
6609
6853
|
[
|
|
6610
|
-
|
|
6854
|
+
import_node_path44.default.resolve(
|
|
6611
6855
|
settings2("BUILT_PRODUCTS_DIR"),
|
|
6612
6856
|
destination,
|
|
6613
|
-
|
|
6857
|
+
import_node_path44.default.basename(file)
|
|
6614
6858
|
),
|
|
6615
6859
|
file
|
|
6616
6860
|
]
|
|
6617
6861
|
] : [];
|
|
6618
6862
|
});
|
|
6619
6863
|
}),
|
|
6620
|
-
...moduleMap ? [[
|
|
6864
|
+
...moduleMap ? [[import_node_path44.default.join(wrapper, "Modules", "module.modulemap"), moduleMap]] : []
|
|
6621
6865
|
]) : Object.fromEntries([
|
|
6622
6866
|
...podHeaders.map((file) => [file, file]),
|
|
6623
6867
|
...moduleMap ? [[moduleMap, moduleMap]] : []
|
|
@@ -6654,7 +6898,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6654
6898
|
const frameworkTargets = selectedTargets.filter((target) => target !== builtTargets.at(-1)).filter(({ ref }) => MODULE_PRODUCTS.has(str(ref.target.productType) ?? "")).map(({ ref, module: module3 }) => ({ ref, framework: module3 }));
|
|
6655
6899
|
const frameworks = frameworkTargets.map(({ framework }) => framework);
|
|
6656
6900
|
const podSourceDirs = builtTargets.slice(0, -1).flatMap(
|
|
6657
|
-
({ ref, module: module3 }) => isPodsProject(ref.project.xcodeproj) ? [...module3.allSources, ...module3.objc?.headers ?? []].map((file) =>
|
|
6901
|
+
({ ref, module: module3 }) => isPodsProject(ref.project.xcodeproj) ? [...module3.allSources, ...module3.objc?.headers ?? []].map((file) => import_node_path44.default.dirname(file)).filter((dir) => import_node_fs43.default.existsSync(dir)) : []
|
|
6658
6902
|
);
|
|
6659
6903
|
const expandValue = (value, settings2) => {
|
|
6660
6904
|
if (typeof value === "string") return expand(value, settings2);
|
|
@@ -6675,7 +6919,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6675
6919
|
const phase = owner.ref.project.object(phaseId);
|
|
6676
6920
|
if (phase?.isa !== "PBXShellScriptBuildPhase" || str(phase.name) !== "[CP] Copy Pods Resources")
|
|
6677
6921
|
continue;
|
|
6678
|
-
const absolute = (raw) =>
|
|
6922
|
+
const absolute = (raw) => import_node_path44.default.resolve(owner.ref.project.projectDir, expand(raw, owner.settings));
|
|
6679
6923
|
const entries = (paths) => paths.flatMap((raw) => {
|
|
6680
6924
|
const file = absolute(raw);
|
|
6681
6925
|
xcconfigs.add(file);
|
|
@@ -6691,7 +6935,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6691
6935
|
].filter((file) => file.endsWith(".bundle"));
|
|
6692
6936
|
if (inputs.length !== outputs.length)
|
|
6693
6937
|
throw new Error(`${owner.module.name}: resource bundle copy lists differ`);
|
|
6694
|
-
const destinationRoot =
|
|
6938
|
+
const destinationRoot = import_node_path44.default.join(
|
|
6695
6939
|
owner.settings("TARGET_BUILD_DIR"),
|
|
6696
6940
|
owner.settings("UNLOCALIZED_RESOURCES_FOLDER_PATH")
|
|
6697
6941
|
);
|
|
@@ -6700,24 +6944,24 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6700
6944
|
const file = str(
|
|
6701
6945
|
target.ref.project.object(str(target.ref.target.productReference))?.path
|
|
6702
6946
|
);
|
|
6703
|
-
return file &&
|
|
6947
|
+
return file && import_node_path44.default.join(target.settings("TARGET_BUILD_DIR"), file) === input2;
|
|
6704
6948
|
});
|
|
6705
6949
|
if (!product && !isDirectory(input2))
|
|
6706
6950
|
throw new Error(
|
|
6707
6951
|
`${owner.module.name}: resource bundle input has no selected producer: ${input2}`
|
|
6708
6952
|
);
|
|
6709
|
-
const destination =
|
|
6710
|
-
if (destination === ".." || destination.startsWith(`..${
|
|
6953
|
+
const destination = import_node_path44.default.relative(destinationRoot, outputs[index]);
|
|
6954
|
+
if (destination === ".." || destination.startsWith(`..${import_node_path44.default.sep}`) || import_node_path44.default.isAbsolute(destination) || import_node_path44.default.basename(input2) !== import_node_path44.default.basename(destination))
|
|
6711
6955
|
throw new Error(
|
|
6712
6956
|
`${owner.module.name}: invalid resource bundle copy destination`
|
|
6713
6957
|
);
|
|
6714
|
-
const infoFile = product ?
|
|
6958
|
+
const infoFile = product ? import_node_path44.default.resolve(
|
|
6715
6959
|
product.ref.project.projectDir,
|
|
6716
6960
|
product.settings("INFOPLIST_FILE")
|
|
6717
6961
|
) : null;
|
|
6718
6962
|
if (infoFile) xcconfigs.add(infoFile);
|
|
6719
6963
|
const prefix = owner.ref === app ? "" : `Frameworks/${owner.module.moduleName}.framework/`;
|
|
6720
|
-
const bundlePath = prefix + destination.split(
|
|
6964
|
+
const bundlePath = prefix + destination.split(import_node_path44.default.sep).join("/");
|
|
6721
6965
|
if (resourceProducts.some((resource) => resource.path === bundlePath))
|
|
6722
6966
|
throw new Error(
|
|
6723
6967
|
`${owner.module.name}: duplicate resource bundle destination ${bundlePath}`
|
|
@@ -6733,15 +6977,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6733
6977
|
)
|
|
6734
6978
|
)
|
|
6735
6979
|
} : {
|
|
6736
|
-
resources: import_node_fs43.default.readdirSync(input2, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) =>
|
|
6980
|
+
resources: import_node_fs43.default.readdirSync(input2, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => import_node_path44.default.join(entry.parentPath, entry.name)).sort(),
|
|
6737
6981
|
sourceRoot: input2
|
|
6738
6982
|
}
|
|
6739
6983
|
});
|
|
6740
6984
|
}
|
|
6741
6985
|
}
|
|
6742
6986
|
}
|
|
6743
|
-
const infoPlistFile = settings("INFOPLIST_FILE") ?
|
|
6744
|
-
const entitlementsFile = settings("CODE_SIGN_ENTITLEMENTS") ?
|
|
6987
|
+
const infoPlistFile = settings("INFOPLIST_FILE") ? import_node_path44.default.resolve(app.project.projectDir, settings("INFOPLIST_FILE")) : null;
|
|
6988
|
+
const entitlementsFile = settings("CODE_SIGN_ENTITLEMENTS") ? import_node_path44.default.resolve(app.project.projectDir, settings("CODE_SIGN_ENTITLEMENTS")) : null;
|
|
6745
6989
|
const infoPlistPending = module2.generatedInfoPlist && !options.prepareGeneratedSources;
|
|
6746
6990
|
const sourceInfo = infoPlistFile && !infoPlistPending ? import_plist3.default.parse(import_node_fs43.default.readFileSync(infoPlistFile, "utf8")) : {};
|
|
6747
6991
|
if (!sourceInfo || typeof sourceInfo !== "object" || Array.isArray(sourceInfo) || sourceInfo instanceof Date || Buffer.isBuffer(sourceInfo)) {
|
|
@@ -6806,7 +7050,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6806
7050
|
};
|
|
6807
7051
|
}
|
|
6808
7052
|
const localPackageDirs = [
|
|
6809
|
-
...listed.filter((reference) => import_node_fs43.default.existsSync(
|
|
7053
|
+
...listed.filter((reference) => import_node_fs43.default.existsSync(import_node_path44.default.join(reference, "Package.swift"))),
|
|
6810
7054
|
...projects.flatMap(
|
|
6811
7055
|
(project) => Object.entries(project.objects).flatMap(([id, entry]) => {
|
|
6812
7056
|
if (!isDict(entry)) return [];
|
|
@@ -6816,19 +7060,19 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6816
7060
|
const packages = [];
|
|
6817
7061
|
while (pending.length > 0) {
|
|
6818
7062
|
const dir = pending.pop();
|
|
6819
|
-
if (import_node_fs43.default.existsSync(
|
|
7063
|
+
if (import_node_fs43.default.existsSync(import_node_path44.default.join(dir, "Package.swift"))) {
|
|
6820
7064
|
packages.push(dir);
|
|
6821
7065
|
continue;
|
|
6822
7066
|
}
|
|
6823
7067
|
if (!isDirectory(dir)) continue;
|
|
6824
7068
|
for (const child of import_node_fs43.default.readdirSync(dir, { withFileTypes: true }))
|
|
6825
7069
|
if (child.isDirectory() && !child.name.startsWith("."))
|
|
6826
|
-
pending.push(
|
|
7070
|
+
pending.push(import_node_path44.default.join(dir, child.name));
|
|
6827
7071
|
}
|
|
6828
7072
|
return packages;
|
|
6829
7073
|
}
|
|
6830
|
-
const candidate = entry.isa === "XCLocalSwiftPackageReference" ?
|
|
6831
|
-
return candidate && import_node_fs43.default.existsSync(
|
|
7074
|
+
const candidate = entry.isa === "XCLocalSwiftPackageReference" ? import_node_path44.default.resolve(project.projectDir, str(entry.relativePath) ?? "") : entry.isa === "PBXFileReference" ? project.resolvePath(id) : null;
|
|
7075
|
+
return candidate && import_node_fs43.default.existsSync(import_node_path44.default.join(candidate, "Package.swift")) ? [candidate] : [];
|
|
6832
7076
|
})
|
|
6833
7077
|
)
|
|
6834
7078
|
];
|
|
@@ -6858,7 +7102,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6858
7102
|
if ((flag === "-framework" || flag === "-weak_framework") && name)
|
|
6859
7103
|
sdkFrameworks.add(name);
|
|
6860
7104
|
});
|
|
6861
|
-
const absolute = (raw) =>
|
|
7105
|
+
const absolute = (raw) => import_node_path44.default.resolve(ref.project.projectDir, expand(raw, settings2));
|
|
6862
7106
|
const requested = options.nativeModules;
|
|
6863
7107
|
const includeBinary = (name, dir) => {
|
|
6864
7108
|
if (!requested || nativeTargets.has(ref) || requested.includes(name) || dir.endsWith(".xcframework") && localSwiftBinaryModules(dir).some((module3) => requested.includes(module3)))
|
|
@@ -6876,7 +7120,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6876
7120
|
const name = /^(.+)\.framework$/.exec(entry.name)?.[1];
|
|
6877
7121
|
if (!name || byProduct.has(entry.name) || searchedFrameworks.has(name))
|
|
6878
7122
|
continue;
|
|
6879
|
-
const file =
|
|
7123
|
+
const file = import_node_path44.default.join(directory, entry.name);
|
|
6880
7124
|
if (import_node_fs43.default.statSync(file, { throwIfNoEntry: false })?.isDirectory())
|
|
6881
7125
|
searchedFrameworks.set(name, file);
|
|
6882
7126
|
}
|
|
@@ -6885,7 +7129,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6885
7129
|
}
|
|
6886
7130
|
for (const raw of settingList(settings2("SWIFT_INCLUDE_PATHS"))) {
|
|
6887
7131
|
const dir = absolute(raw);
|
|
6888
|
-
const modulemap =
|
|
7132
|
+
const modulemap = import_node_path44.default.join(dir, "module.modulemap");
|
|
6889
7133
|
if (!import_node_fs43.default.existsSync(modulemap)) continue;
|
|
6890
7134
|
const name = moduleMapName(import_node_fs43.default.readFileSync(modulemap, "utf8"));
|
|
6891
7135
|
if (name && !binaryFrameworks.has(name)) includeBinary(name, dir);
|
|
@@ -6961,7 +7205,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6961
7205
|
...productAttributes.get(dependencyId)?.length ? { attributes: productAttributes.get(dependencyId) } : {},
|
|
6962
7206
|
source: reference?.isa === "XCRemoteSwiftPackageReference" ? { kind: "remote", url: str(reference.repositoryURL) ?? "" } : reference?.isa === "XCLocalSwiftPackageReference" ? {
|
|
6963
7207
|
kind: "local",
|
|
6964
|
-
dir:
|
|
7208
|
+
dir: import_node_path44.default.resolve(
|
|
6965
7209
|
project.projectDir,
|
|
6966
7210
|
str(reference.relativePath) ?? ""
|
|
6967
7211
|
)
|
|
@@ -6995,7 +7239,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6995
7239
|
continue;
|
|
6996
7240
|
}
|
|
6997
7241
|
if (tree === "BUILT_PRODUCTS_DIR" || tree === "DEVELOPER_DIR" || // a target in the workspace builds it, so it exists only after that build
|
|
6998
|
-
byProduct.has(
|
|
7242
|
+
byProduct.has(import_node_path44.default.basename(rawPath)))
|
|
6999
7243
|
continue;
|
|
7000
7244
|
const resolved = fileId ? project.resolvePath(fileId) : null;
|
|
7001
7245
|
if (fileId && resolved !== null && !import_node_fs43.default.existsSync(resolved)) {
|
|
@@ -7025,7 +7269,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
7025
7269
|
({ product }) => !options.nativeModules || nativeTargets.has(built.ref) || options.nativeModules.includes(product)
|
|
7026
7270
|
);
|
|
7027
7271
|
const resolvedFile = workspaceResolvedFile(xcodeprojOrWorkspace);
|
|
7028
|
-
let packageResolved = import_node_fs43.default.existsSync(resolvedFile) ? [import_node_fs43.default.realpathSync.native(resolvedFile)] : [...new Set(localPackageDirs.map((dir) =>
|
|
7272
|
+
let packageResolved = import_node_fs43.default.existsSync(resolvedFile) ? [import_node_fs43.default.realpathSync.native(resolvedFile)] : [...new Set(localPackageDirs.map((dir) => import_node_path44.default.join(dir, "Package.resolved")))].filter((file) => import_node_fs43.default.existsSync(file)).map((file) => import_node_fs43.default.realpathSync.native(file)).sort();
|
|
7029
7273
|
if (packageResolved.length === 0) {
|
|
7030
7274
|
const requirements = remotePackageRequirements(projects);
|
|
7031
7275
|
if (requirements.length > 0) {
|
|
@@ -7076,7 +7320,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
7076
7320
|
} : {},
|
|
7077
7321
|
rootDir: commonAncestor(
|
|
7078
7322
|
[
|
|
7079
|
-
workspace ?
|
|
7323
|
+
workspace ? import_node_path44.default.dirname(workspace) : app.project.projectDir,
|
|
7080
7324
|
...used.map((project) => project.projectDir),
|
|
7081
7325
|
...localPackageDirs,
|
|
7082
7326
|
...linkedProducts.flatMap(
|
|
@@ -7086,7 +7330,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
7086
7330
|
// a target's own files may sit beside the project, such as an asset
|
|
7087
7331
|
// catalog one folder up, and xcode builds them from there
|
|
7088
7332
|
...new Set(
|
|
7089
|
-
[...module2.allSources, ...module2.resources].filter((file) => import_node_fs43.default.existsSync(file)).map((file) =>
|
|
7333
|
+
[...module2.allSources, ...module2.resources].filter((file) => import_node_fs43.default.existsSync(file)).map((file) => import_node_path44.default.dirname(file))
|
|
7090
7334
|
)
|
|
7091
7335
|
].map((dir) => import_node_fs43.default.realpathSync.native(dir))
|
|
7092
7336
|
),
|
|
@@ -7095,7 +7339,11 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
7095
7339
|
...used.map((project) => project.projectFile),
|
|
7096
7340
|
...xcconfigs,
|
|
7097
7341
|
...entitlementsFile ? [entitlementsFile] : [],
|
|
7098
|
-
...cocoapods ? [
|
|
7342
|
+
...cocoapods ? [
|
|
7343
|
+
cocoapods.podfileLock,
|
|
7344
|
+
cocoapods.manifestLock,
|
|
7345
|
+
...cocoapods.specificationFiles
|
|
7346
|
+
] : []
|
|
7099
7347
|
])
|
|
7100
7348
|
].sort(),
|
|
7101
7349
|
projectDirs: [...new Set(used.map((project) => project.projectDir))].sort(),
|
|
@@ -7128,16 +7376,16 @@ function nonEmptyString2(value) {
|
|
|
7128
7376
|
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
7129
7377
|
}
|
|
7130
7378
|
var SDK_BEFORE_SCENE_REQUIREMENT = "26.0";
|
|
7131
|
-
function stampNativeBuildSdk(
|
|
7132
|
-
const dtPlatformVersion =
|
|
7133
|
-
ios: () =>
|
|
7379
|
+
function stampNativeBuildSdk(identity2, buildSdkVersion = NATIVE_GRAPH_SDK_VERSION) {
|
|
7380
|
+
const dtPlatformVersion = identity2.dtPlatformVersion ?? selectNativeAppIdentityReader(identity2.platform, {
|
|
7381
|
+
ios: () => identity2.sceneManifest ? buildSdkVersion : SDK_BEFORE_SCENE_REQUIREMENT,
|
|
7134
7382
|
android: () => buildSdkVersion
|
|
7135
7383
|
})();
|
|
7136
7384
|
return {
|
|
7137
|
-
...
|
|
7385
|
+
...identity2,
|
|
7138
7386
|
dtPlatformVersion,
|
|
7139
7387
|
infoPlistStrings: {
|
|
7140
|
-
...
|
|
7388
|
+
...identity2.infoPlistStrings,
|
|
7141
7389
|
DTPlatformVersion: dtPlatformVersion
|
|
7142
7390
|
}
|
|
7143
7391
|
};
|
|
@@ -7216,7 +7464,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
7216
7464
|
const rootModuleName = readRootModuleName(
|
|
7217
7465
|
app.allSources.filter((file) => /Delegate\.(?:swift|mm|m)$/.test(file) && import_node_fs44.default.existsSync(file)).map((file) => import_node_fs44.default.readFileSync(file, "utf8"))
|
|
7218
7466
|
);
|
|
7219
|
-
const
|
|
7467
|
+
const identity2 = {
|
|
7220
7468
|
...app.keychainAccessGroups === void 0 ? {} : { keychainAccessGroups: app.keychainAccessGroups },
|
|
7221
7469
|
applicationName,
|
|
7222
7470
|
...applicationDisplayName ? { applicationDisplayName } : {},
|
|
@@ -7249,7 +7497,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
7249
7497
|
app.resources,
|
|
7250
7498
|
(file) => import_node_fs44.default.readFileSync(file, "utf8"),
|
|
7251
7499
|
(file) => {
|
|
7252
|
-
const extension =
|
|
7500
|
+
const extension = import_node_path45.default.extname(file).toLowerCase();
|
|
7253
7501
|
const contentType = extension === ".jpg" || extension === ".jpeg" ? "image/jpeg" : extension === ".webp" ? "image/webp" : "image/png";
|
|
7254
7502
|
return `data:${contentType};base64,${import_node_fs44.default.readFileSync(file).toString("base64")}`;
|
|
7255
7503
|
},
|
|
@@ -7269,7 +7517,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
7269
7517
|
backgroundModes,
|
|
7270
7518
|
appIntentIdentifiers
|
|
7271
7519
|
};
|
|
7272
|
-
return stampNativeBuildSdk(
|
|
7520
|
+
return stampNativeBuildSdk(identity2, buildSdkVersion);
|
|
7273
7521
|
}
|
|
7274
7522
|
function readNativeAppIdentityFromProject(projectRoot, platform, parseInfoPlist = parsePlistSource, iosTarget, androidMergedManifest, environment, buildSdkVersion) {
|
|
7275
7523
|
const read = selectNativeAppIdentityReader(platform, {
|
|
@@ -7288,7 +7536,7 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
|
|
|
7288
7536
|
const read = selectNativeAppIdentityReader(platform, {
|
|
7289
7537
|
android: () => null,
|
|
7290
7538
|
ios: () => {
|
|
7291
|
-
const nested =
|
|
7539
|
+
const nested = import_node_path45.default.join(projectRoot, "ios");
|
|
7292
7540
|
const iosRoot = import_node_fs44.default.existsSync(nested) ? nested : projectRoot;
|
|
7293
7541
|
const prefix = iosRoot === nested ? "ios/" : "";
|
|
7294
7542
|
const files = {};
|
|
@@ -7300,26 +7548,26 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
|
|
|
7300
7548
|
"AppDelegate.swift",
|
|
7301
7549
|
"AppDelegate.mm",
|
|
7302
7550
|
"AppDelegate.m",
|
|
7303
|
-
...import_node_fs44.default.readdirSync(
|
|
7551
|
+
...import_node_fs44.default.readdirSync(import_node_path45.default.join(iosRoot, entry.name)).filter((name) => name.endsWith(".entitlements"))
|
|
7304
7552
|
];
|
|
7305
7553
|
for (const name of names) {
|
|
7306
7554
|
const relative2 = `${prefix}${entry.name}/${name}`;
|
|
7307
|
-
const file =
|
|
7555
|
+
const file = import_node_path45.default.join(projectRoot, relative2);
|
|
7308
7556
|
if (import_node_fs44.default.existsSync(file)) files[relative2] = import_node_fs44.default.readFileSync(file, "utf8");
|
|
7309
7557
|
}
|
|
7310
7558
|
} else if (/AppDelegate\.(?:swift|mm|m)$|\.entitlements$/.test(entry.name)) {
|
|
7311
7559
|
const relative2 = `${prefix}${entry.name}`;
|
|
7312
|
-
const file =
|
|
7560
|
+
const file = import_node_path45.default.join(projectRoot, relative2);
|
|
7313
7561
|
if (import_node_fs44.default.existsSync(file)) files[relative2] = import_node_fs44.default.readFileSync(file, "utf8");
|
|
7314
7562
|
}
|
|
7315
7563
|
}
|
|
7316
|
-
const
|
|
7564
|
+
const identity2 = extractNativeAppIdentityFromFiles(
|
|
7317
7565
|
files,
|
|
7318
7566
|
"ios",
|
|
7319
7567
|
parseInfoPlist,
|
|
7320
7568
|
iosTarget
|
|
7321
7569
|
);
|
|
7322
|
-
return
|
|
7570
|
+
return identity2 ? stampNativeBuildSdk(identity2) : null;
|
|
7323
7571
|
}
|
|
7324
7572
|
});
|
|
7325
7573
|
return read ? read() : null;
|
|
@@ -7327,23 +7575,23 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
|
|
|
7327
7575
|
function readAndroidNativeAppIdentity(projectRoot, androidMergedManifest) {
|
|
7328
7576
|
const files = {};
|
|
7329
7577
|
if (androidMergedManifest) {
|
|
7330
|
-
const file =
|
|
7578
|
+
const file = import_node_path45.default.resolve(projectRoot, androidMergedManifest);
|
|
7331
7579
|
if (!import_node_fs44.default.existsSync(file)) return null;
|
|
7332
7580
|
files[androidMergedManifest] = import_node_fs44.default.readFileSync(file, "utf8");
|
|
7333
7581
|
} else {
|
|
7334
|
-
const androidRoot =
|
|
7582
|
+
const androidRoot = import_node_path45.default.join(projectRoot, "android");
|
|
7335
7583
|
if (!import_node_fs44.default.existsSync(androidRoot)) return null;
|
|
7336
7584
|
const collect = (directory) => {
|
|
7337
7585
|
for (const entry of import_node_fs44.default.readdirSync(directory, { withFileTypes: true })) {
|
|
7338
|
-
const file =
|
|
7586
|
+
const file = import_node_path45.default.join(directory, entry.name);
|
|
7339
7587
|
if (entry.isDirectory()) collect(file);
|
|
7340
7588
|
else if (entry.isFile() && entry.name === "AndroidManifest.xml")
|
|
7341
|
-
files[
|
|
7589
|
+
files[import_node_path45.default.relative(projectRoot, file).split(import_node_path45.default.sep).join("/")] = import_node_fs44.default.readFileSync(file, "utf8");
|
|
7342
7590
|
}
|
|
7343
7591
|
};
|
|
7344
7592
|
for (const module2 of import_node_fs44.default.readdirSync(androidRoot, { withFileTypes: true })) {
|
|
7345
7593
|
if (!module2.isDirectory()) continue;
|
|
7346
|
-
const outputs =
|
|
7594
|
+
const outputs = import_node_path45.default.join(
|
|
7347
7595
|
androidRoot,
|
|
7348
7596
|
module2.name,
|
|
7349
7597
|
"build/intermediates/merged_manifests"
|
|
@@ -7354,14 +7602,14 @@ function readAndroidNativeAppIdentity(projectRoot, androidMergedManifest) {
|
|
|
7354
7602
|
for (const manifest of Object.keys(files)) {
|
|
7355
7603
|
const resourceDirectory = androidMergedResourceValuesDirectory(manifest);
|
|
7356
7604
|
if (!resourceDirectory) continue;
|
|
7357
|
-
const absolute =
|
|
7605
|
+
const absolute = import_node_path45.default.resolve(projectRoot, resourceDirectory);
|
|
7358
7606
|
if (!import_node_fs44.default.existsSync(absolute)) continue;
|
|
7359
7607
|
for (const entry of import_node_fs44.default.readdirSync(absolute, { withFileTypes: true })) {
|
|
7360
7608
|
if (!entry.isDirectory() || !/^values(?:-|$)/.test(entry.name)) continue;
|
|
7361
|
-
for (const resource of import_node_fs44.default.readdirSync(
|
|
7609
|
+
for (const resource of import_node_fs44.default.readdirSync(import_node_path45.default.join(absolute, entry.name))) {
|
|
7362
7610
|
if (!resource.endsWith(".xml")) continue;
|
|
7363
7611
|
const file = `${resourceDirectory}/${entry.name}/${resource}`;
|
|
7364
|
-
files[file] = import_node_fs44.default.readFileSync(
|
|
7612
|
+
files[file] = import_node_fs44.default.readFileSync(import_node_path45.default.resolve(projectRoot, file), "utf8");
|
|
7365
7613
|
}
|
|
7366
7614
|
}
|
|
7367
7615
|
}
|
|
@@ -7377,12 +7625,12 @@ function readAndroidNativeAppIdentity(projectRoot, androidMergedManifest) {
|
|
|
7377
7625
|
function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget, environment, buildSdkVersion) {
|
|
7378
7626
|
const app = readIosAppTarget(projectRoot, iosTarget, environment);
|
|
7379
7627
|
if (!app) return null;
|
|
7380
|
-
const
|
|
7628
|
+
const identity2 = readNativeAppIdentityFromXcodeTarget(
|
|
7381
7629
|
app,
|
|
7382
7630
|
parseInfoPlist,
|
|
7383
7631
|
buildSdkVersion
|
|
7384
7632
|
);
|
|
7385
|
-
const projectManifestPath =
|
|
7633
|
+
const projectManifestPath = import_node_path45.default.join(projectRoot, "package.json");
|
|
7386
7634
|
const projectRequire = (0, import_node_module.createRequire)(projectManifestPath);
|
|
7387
7635
|
let reanimatedManifestPath;
|
|
7388
7636
|
try {
|
|
@@ -7391,7 +7639,7 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget, enviro
|
|
|
7391
7639
|
);
|
|
7392
7640
|
} catch (error) {
|
|
7393
7641
|
if (error instanceof Error && "code" in error && error.code === "MODULE_NOT_FOUND") {
|
|
7394
|
-
return
|
|
7642
|
+
return identity2;
|
|
7395
7643
|
}
|
|
7396
7644
|
throw error;
|
|
7397
7645
|
}
|
|
@@ -7400,11 +7648,11 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget, enviro
|
|
|
7400
7648
|
);
|
|
7401
7649
|
const installedVersion = isRecord(installedManifest) ? nonEmptyString2(installedManifest.version) : void 0;
|
|
7402
7650
|
if (!installedVersion) throw new Error("Reanimated package version is malformed");
|
|
7403
|
-
if (Number.parseInt(installedVersion, 10) < 4) return
|
|
7651
|
+
if (Number.parseInt(installedVersion, 10) < 4) return identity2;
|
|
7404
7652
|
const defaults = JSON.parse(
|
|
7405
7653
|
import_node_fs44.default.readFileSync(
|
|
7406
|
-
|
|
7407
|
-
|
|
7654
|
+
import_node_path45.default.join(
|
|
7655
|
+
import_node_path45.default.dirname(reanimatedManifestPath),
|
|
7408
7656
|
"src/featureFlags/staticFlags.json"
|
|
7409
7657
|
),
|
|
7410
7658
|
"utf8"
|
|
@@ -7431,7 +7679,7 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget, enviro
|
|
|
7431
7679
|
"Reanimated animation backend requires settled React renders to be disabled"
|
|
7432
7680
|
);
|
|
7433
7681
|
}
|
|
7434
|
-
return { ...
|
|
7682
|
+
return { ...identity2, reanimatedStaticFeatureFlags: flags };
|
|
7435
7683
|
}
|
|
7436
7684
|
function readIosAppTarget(projectRoot, iosTarget, environment) {
|
|
7437
7685
|
const selected = selectIosAppTarget(projectRoot, iosTarget);
|