peachsim 0.1.2438 → 0.1.2439
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/README.md +30 -98
- package/cli/app-catalog.ts +4 -73
- package/cli/catalog/content.ts +1 -1
- package/cli/cloud-box-artifact.ts +26 -39
- package/cli/cloud-client.ts +69 -117
- package/cli/cloud-session.ts +2 -9
- package/cli/commands/box.ts +6 -6
- package/cli/commands/control.ts +4 -11
- package/cli/commands/flow.ts +5 -9
- package/cli/commands/kotlin.ts +2 -1
- package/cli/commands/platform.ts +21 -39
- package/cli/commands/record-three.ts +1 -1
- package/cli/commands/shell-url.ts +29 -23
- package/cli/dev-build-freshness.ts +4 -3
- package/cli/native-input.ts +2 -2
- package/cli/outbound-endpoints.ts +20 -45
- package/cli/remote-project-bundle.ts +8 -14
- package/cli/remote-simulators.ts +1 -1
- package/cli/send-to-box.ts +2 -1
- package/detox/jest-preset.cjs +1 -1
- package/detox/jest-transform.cjs +40 -2
- package/dist-lib/agent-daemon-client.cjs +34 -24
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +19 -17
- package/dist-lib/auth/shared-session.cjs +18 -16
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +2 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +20 -583
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +17 -99
- package/dist-lib/bundle-channel.cjs +8718 -5552
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +13 -363
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +34 -155
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +2 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +26 -155
- package/dist-lib/config.cjs +1 -4
- package/dist-lib/config.mjs +11 -30
- package/dist-lib/detox/index.cjs +2554 -230
- package/dist-lib/detox/jest-preset.cjs +1 -1
- package/dist-lib/detox/jest-transform.cjs +40 -2
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/esm-chunks/acorn-FGE4PYDJ.mjs +50 -0
- package/dist-lib/esm-chunks/chunk-2EUHEBIJ.mjs +664 -0
- package/dist-lib/esm-chunks/chunk-2NPABFPN.mjs +5719 -0
- package/dist-lib/esm-chunks/chunk-4ZFNH7TU.mjs +10 -0
- package/dist-lib/esm-chunks/chunk-5T4XBUJP.mjs +1353 -0
- package/dist-lib/esm-chunks/chunk-6VY6HTJC.mjs +18951 -0
- package/dist-lib/esm-chunks/chunk-7HANEMO4.mjs +188 -0
- package/dist-lib/esm-chunks/chunk-C3WBGYP6.mjs +186 -0
- package/dist-lib/esm-chunks/chunk-CVGDRROP.mjs +57 -0
- package/dist-lib/esm-chunks/chunk-DADGQELM.mjs +375 -0
- package/dist-lib/esm-chunks/chunk-DEGYKHN7.mjs +12 -0
- package/dist-lib/esm-chunks/chunk-HIDNO3RP.mjs +10992 -0
- package/dist-lib/esm-chunks/chunk-HSADZOVN.mjs +30 -0
- package/dist-lib/esm-chunks/chunk-IWJUYJQO.mjs +42 -0
- package/dist-lib/esm-chunks/chunk-JCKI3VZ6.mjs +10 -0
- package/dist-lib/esm-chunks/chunk-KSQ5KM5Y.mjs +17 -0
- package/dist-lib/esm-chunks/chunk-KVTIDLBK.mjs +598 -0
- package/dist-lib/esm-chunks/chunk-MIQSRBVU.mjs +10 -0
- package/dist-lib/esm-chunks/chunk-YB27R6JG.mjs +115 -0
- package/dist-lib/esm-chunks/metro-layout-parser-MVUAXRUJ.mjs +58 -0
- package/dist-lib/expo-swift-bundle.cjs +7856 -4707
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +16 -165
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +15658 -11404
- package/dist-lib/host/fetch-proxy-handler.cjs +3927 -342
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +2 -1
- package/dist-lib/host/replacement-module-handler.cjs +4 -4
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +9145 -32150
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +2 -2
- package/dist-lib/kotlin-host.cjs +260 -253
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +5 -13
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +5 -6
- package/dist-lib/metro-production-bundle.cjs +22 -3
- package/dist-lib/metro-production-bundle.mjs +26 -92
- package/dist-lib/native-app-identity-project.cjs +663 -451
- package/dist-lib/native-app-identity-project.mjs +509 -2318
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +27 -1340
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +5 -18
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +2 -1
- package/dist-lib/plist.cjs +2 -2
- package/dist-lib/plist.mjs +5 -7
- package/dist-lib/profiles.cjs +2 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +246 -187
- package/dist-lib/public-origins-lib-static.json +1 -1
- package/dist-lib/public-origins-lib.json +1059 -1238
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +2 -1
- package/dist-lib/reap-browser.cjs +18 -7
- package/dist-lib/scripts/dev-server-scanner.cjs +6 -230
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +22 -78
- package/dist-lib/skills.cjs +21657 -17374
- package/dist-lib/swift-compile.cjs +1343 -1318
- package/dist-lib/swift-compile.mjs +68 -19013
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +35 -630
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +9 -24
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vendor/@peculiar/x509.cjs +18061 -0
- package/dist-lib/vendor/acorn.cjs +5699 -0
- package/dist-lib/vendor/bplist-parser.cjs +1589 -0
- package/dist-lib/vendor/ignore.cjs +455 -0
- package/dist-lib/vendor/magic-string.cjs +1693 -0
- package/dist-lib/vendor/plist.cjs +10978 -0
- package/dist-lib/vendor/smol-toml.cjs +768 -0
- package/dist-lib/vendor/stream-json.cjs +1997 -0
- package/dist-lib/vendor/sucrase/dist/index.js.cjs +23593 -0
- package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +15750 -0
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +11316 -0
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +482 -0
- package/dist-lib/vendor/sucrase.cjs +23593 -0
- package/dist-lib/vendor/terser.cjs +36874 -0
- package/dist-lib/vendor/valibot.cjs +6253 -0
- package/dist-lib/vendor/zod.cjs +23262 -0
- package/dist-lib/worklet-executable.cjs +3 -3
- package/dist-lib/worklet-executable.mjs +11 -16
- package/dist-types/packages/peach-engine/src/config.d.ts +1 -1
- package/kotlin/fork/NOTICE +3 -0
- package/kotlin/sdk.tar.gz +0 -0
- package/kotlin/toolchain.json +6 -6
- package/package.json +17 -121
- package/runtime-companion.json +1 -1
- package/scripts/dev-server-scanner.ts +13 -223
- package/src/android-autolinking.ts +2 -2
- package/src/bundle-channel.mjs +3 -15
- package/src/cloud-contract.ts +3 -4
- package/src/config.ts +0 -5
- package/src/host/bridge-host.ts +19 -1
- package/src/host/server-scan-handler.ts +1 -9
- package/src/index.ts +0 -2
- package/src/kotlin-host.ts +1 -2
- package/src/kotlinDiscoveryContract.ts +1 -0
- package/src/metro-production-bundle.ts +28 -6
- package/src/native-seam-manifest.ts +0 -13
- package/src/one-native-app-catalog.ts +8 -27
- package/src/one-native-app-config.ts +95 -0
- package/src/one-native-source.ts +250 -0
- package/src/one-widget-metadata.ts +45 -126
- package/src/oneWidgetContract.ts +80 -117
- package/src/serverDiscoveryContract.ts +0 -1
- package/src/simulator-route.ts +8 -0
- package/src/vite-plugin.ts +2 -2
- package/src/xcode-project.ts +1 -1
- package/dist-lib/metro.cjs +0 -27984
- package/dist-lib/vite-swift.cjs +0 -43376
- package/dist-lib/vite.cjs +0 -21456
- package/src/androidAutolinkingContract.ts +0 -48
- package/src/androidRootModuleContract.ts +0 -39
- package/src/dev-server-open.ts +0 -92
- package/src/metro-plugin.ts +0 -578
- package/src/one-widget-discovery.ts +0 -23
- package/src/swift-vite-lifetime.ts +0 -42
- package/src/vite-plugin-one.ts +0 -746
- package/src/vite-plugin-swift.ts +0 -225
- package/src/vite.d.ts +0 -10
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2439 | (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;
|
|
@@ -1154,9 +1154,9 @@ __export(native_app_identity_project_exports, {
|
|
|
1154
1154
|
readNativeAppIdentityFromXcodeTarget: () => readNativeAppIdentityFromXcodeTarget
|
|
1155
1155
|
});
|
|
1156
1156
|
module.exports = __toCommonJS(native_app_identity_project_exports);
|
|
1157
|
-
var
|
|
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_path46 = __toESM(require("node:path"), 1);
|
|
1160
1160
|
|
|
1161
1161
|
// src/android-string-value.ts
|
|
1162
1162
|
function compileAndroidStringValue(text2, where) {
|
|
@@ -1566,7 +1566,7 @@ function groupParentsOf(objects) {
|
|
|
1566
1566
|
groupParents.set(objects, parents);
|
|
1567
1567
|
return parents;
|
|
1568
1568
|
}
|
|
1569
|
-
function xcodePathResolver(objects, projectDir,
|
|
1569
|
+
function xcodePathResolver(objects, projectDir, join8, sourceTreeRoot) {
|
|
1570
1570
|
const parents = groupParentsOf(objects);
|
|
1571
1571
|
const paths = /* @__PURE__ */ new Map();
|
|
1572
1572
|
const resolve = (id) => {
|
|
@@ -1578,14 +1578,14 @@ function xcodePathResolver(objects, projectDir, join, sourceTreeRoot) {
|
|
|
1578
1578
|
const own = str(entry.path) ?? "";
|
|
1579
1579
|
const tree = str(entry.sourceTree) ?? "<group>";
|
|
1580
1580
|
if (tree === "<absolute>") result = own;
|
|
1581
|
-
else if (tree === "SOURCE_ROOT") result =
|
|
1581
|
+
else if (tree === "SOURCE_ROOT") result = join8(projectDir, own);
|
|
1582
1582
|
else if (tree === "<group>") {
|
|
1583
1583
|
const parent = parents.get(id);
|
|
1584
1584
|
const base = parent ? resolve(parent) : projectDir;
|
|
1585
|
-
if (base !== null) result =
|
|
1585
|
+
if (base !== null) result = join8(base, own);
|
|
1586
1586
|
} else {
|
|
1587
1587
|
const base = sourceTreeRoot?.(tree);
|
|
1588
|
-
if (base) result =
|
|
1588
|
+
if (base) result = join8(base, own);
|
|
1589
1589
|
}
|
|
1590
1590
|
}
|
|
1591
1591
|
paths.set(id, result);
|
|
@@ -1607,7 +1607,7 @@ function xcodeTargetMemberVisitor(objects) {
|
|
|
1607
1607
|
if (isDict(group) && group.isa === "PBXFileSystemSynchronizedRootGroup")
|
|
1608
1608
|
synchronizedGroups.push({ id, group });
|
|
1609
1609
|
}
|
|
1610
|
-
return (targetId, resolvePath, filesUnder,
|
|
1610
|
+
return (targetId, resolvePath, filesUnder, join8, visit) => {
|
|
1611
1611
|
const target = objects[targetId];
|
|
1612
1612
|
if (!isDict(target)) return;
|
|
1613
1613
|
for (const phaseId of list(target.buildPhases)) {
|
|
@@ -1651,23 +1651,23 @@ function xcodeTargetMemberVisitor(objects) {
|
|
|
1651
1651
|
for (const exceptionId of list(group.exceptions)) {
|
|
1652
1652
|
const exception = objects[exceptionId];
|
|
1653
1653
|
if (!isDict(exception) || exception.target !== targetId) continue;
|
|
1654
|
-
for (const
|
|
1655
|
-
exceptions.add(
|
|
1654
|
+
for (const relative2 of list(exception.membershipExceptions))
|
|
1655
|
+
exceptions.add(relative2);
|
|
1656
1656
|
}
|
|
1657
|
-
const members = owned.has(groupId) ? filesUnder(folder) : [...exceptions].flatMap((
|
|
1657
|
+
const members = owned.has(groupId) ? filesUnder(folder) : [...exceptions].flatMap((relative2) => filesUnder(join8(folder, relative2)));
|
|
1658
1658
|
for (const file of members) {
|
|
1659
|
-
const
|
|
1659
|
+
const relative2 = file.slice(prefix.length);
|
|
1660
1660
|
const excepted = [...exceptions].some(
|
|
1661
|
-
(exception) =>
|
|
1661
|
+
(exception) => relative2 === exception || relative2.startsWith(`${exception}/`)
|
|
1662
1662
|
);
|
|
1663
|
-
if (owned.has(groupId) === excepted || NEVER_MEMBER.test(
|
|
1663
|
+
if (owned.has(groupId) === excepted || NEVER_MEMBER.test(relative2)) continue;
|
|
1664
1664
|
if (file.endsWith(".swift")) {
|
|
1665
|
-
if (!
|
|
1665
|
+
if (!relative2.split("/").some((segment) => BUNDLE_DIR.test(segment)))
|
|
1666
1666
|
visit(file, "source");
|
|
1667
1667
|
} else if (/\.(h|hh|hpp|hxx|pch)$/.test(file)) {
|
|
1668
1668
|
visit(
|
|
1669
1669
|
file,
|
|
1670
|
-
|
|
1670
|
+
relative2.split("/").some((segment) => BUNDLE_DIR.test(segment)) ? "resource" : "header"
|
|
1671
1671
|
);
|
|
1672
1672
|
} else if (/\.(m|mm|c|cc|cpp|cxx|metal)$/.test(file)) {
|
|
1673
1673
|
visit(file, "source");
|
|
@@ -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
|
+
(path41) => /(?:^|\/)ios\/[^/]+\.xcodeproj\/project\.pbxproj$/.test(path41)
|
|
1813
1813
|
) ?? Object.keys(files).find(
|
|
1814
|
-
(
|
|
1815
|
-
) ?? Object.keys(files).find((
|
|
1814
|
+
(path41) => /(?:^|\/)[^/]+\.xcodeproj\/project\.pbxproj$/.test(path41)
|
|
1815
|
+
) ?? Object.keys(files).find((path41) => /(?:^|\/)project\.pbxproj$/.test(path41));
|
|
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((path41) => !path41.includes("/Pods/")).map((path41) => path41.match(APP_DELEGATE_PATH_RE)?.[1]).filter(
|
|
1858
1858
|
(name) => typeof name === "string" && applicationTargetNames.has(name)
|
|
1859
1859
|
);
|
|
1860
1860
|
if (delegateTargets.length === 1) {
|
|
@@ -2070,7 +2070,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
|
|
|
2070
2070
|
if (resourceUri) {
|
|
2071
2071
|
if (!selectedTarget)
|
|
2072
2072
|
throw new Error("native app icon target membership is unresolved");
|
|
2073
|
-
const
|
|
2073
|
+
const join8 = (base, own) => {
|
|
2074
2074
|
const segments = [];
|
|
2075
2075
|
for (const segment of `${base}/${own}`.split("/")) {
|
|
2076
2076
|
if (segment === "" || segment === ".") continue;
|
|
@@ -2083,22 +2083,22 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
|
|
|
2083
2083
|
const project = Object.values(objects).find(
|
|
2084
2084
|
(object3) => isRecord(object3) && object3.isa === "PBXProject"
|
|
2085
2085
|
);
|
|
2086
|
-
const projectDir =
|
|
2086
|
+
const projectDir = join8(
|
|
2087
2087
|
pbxprojPath.replace(/(?:^|\/)[^/]+\.xcodeproj\/project\.pbxproj$/, ""),
|
|
2088
2088
|
isRecord(project) && typeof project.projectDirPath === "string" ? project.projectDirPath : ""
|
|
2089
2089
|
);
|
|
2090
2090
|
const paths = Object.keys(files);
|
|
2091
2091
|
xcodeTargetMemberVisitor(objects)(
|
|
2092
2092
|
selectedTarget.id,
|
|
2093
|
-
xcodePathResolver(objects, projectDir,
|
|
2093
|
+
xcodePathResolver(objects, projectDir, join8),
|
|
2094
2094
|
(file) => {
|
|
2095
2095
|
if (Object.hasOwn(files, file)) return [file];
|
|
2096
2096
|
const prefix = file === "" ? "" : `${file.replace(/\/$/, "")}/`;
|
|
2097
2097
|
return paths.filter(
|
|
2098
|
-
(
|
|
2098
|
+
(path41) => path41.startsWith(prefix) && !/(?:^|\/)\./.test(path41.slice(prefix.length))
|
|
2099
2099
|
);
|
|
2100
2100
|
},
|
|
2101
|
-
|
|
2101
|
+
join8,
|
|
2102
2102
|
(file, kind) => {
|
|
2103
2103
|
if (kind === "resource") resources.add(file);
|
|
2104
2104
|
}
|
|
@@ -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
|
+
([path41]) => !path41.includes("/Pods/") && (/(?:^|\/)(?:ios\/)?AppDelegate\.(?:swift|mm|m)$/.test(path41) || path41.match(APP_DELEGATE_PATH_RE)?.[1] === targetName)
|
|
2110
2110
|
).map(([, source]) => source)
|
|
2111
2111
|
);
|
|
2112
2112
|
return {
|
|
@@ -2199,15 +2199,40 @@ function extractNativeAppIdentityFromFiles(files, platform, parseInfoPlist, iosT
|
|
|
2199
2199
|
}
|
|
2200
2200
|
|
|
2201
2201
|
// src/plist.ts
|
|
2202
|
-
var import_plist = __toESM(require("plist"), 1);
|
|
2202
|
+
var import_plist = __toESM(require("peachsim/vendor/plist"), 1);
|
|
2203
2203
|
function parsePlistSource(source) {
|
|
2204
2204
|
return import_plist.default.parse(source);
|
|
2205
2205
|
}
|
|
2206
2206
|
|
|
2207
2207
|
// src/swift-objc-standin.ts
|
|
2208
|
+
var import_node_child_process3 = require("node:child_process");
|
|
2209
|
+
var import_node_crypto3 = require("node:crypto");
|
|
2210
|
+
var import_node_fs5 = __toESM(require("node:fs"), 1);
|
|
2211
|
+
var import_node_path7 = __toESM(require("node:path"), 1);
|
|
2212
|
+
|
|
2213
|
+
// src/case-insensitive-header-overlay.ts
|
|
2208
2214
|
var import_node_crypto = require("node:crypto");
|
|
2215
|
+
var import_node_fs2 = __toESM(require("node:fs"), 1);
|
|
2216
|
+
var import_node_path2 = __toESM(require("node:path"), 1);
|
|
2217
|
+
|
|
2218
|
+
// src/write-build-file.ts
|
|
2219
|
+
var import_node_fs = require("node:fs");
|
|
2220
|
+
var import_node_path = __toESM(require("node:path"), 1);
|
|
2221
|
+
|
|
2222
|
+
// src/swift-objc-platform.ts
|
|
2223
|
+
var import_node_child_process2 = require("node:child_process");
|
|
2224
|
+
var import_node_path4 = __toESM(require("node:path"), 1);
|
|
2209
2225
|
|
|
2210
2226
|
// src/swift-toolchain.ts
|
|
2227
|
+
var import_node_child_process = require("node:child_process");
|
|
2228
|
+
var import_node_crypto2 = require("node:crypto");
|
|
2229
|
+
var import_node_fs3 = __toESM(require("node:fs"), 1);
|
|
2230
|
+
var import_node_os = __toESM(require("node:os"), 1);
|
|
2231
|
+
var import_node_path3 = __toESM(require("node:path"), 1);
|
|
2232
|
+
var import_promises = require("node:stream/promises");
|
|
2233
|
+
var import_node_url = require("node:url");
|
|
2234
|
+
var import_node_util = require("node:util");
|
|
2235
|
+
var import_node_zlib = __toESM(require("node:zlib"), 1);
|
|
2211
2236
|
var SWIFT_HOST_COMPILER_RELEASE = "swift-6.4.0-RELEASE-custom-81b2c791c27276bf";
|
|
2212
2237
|
var SWIFT_HOST_COMPILER_ID = "81b2c791c27276bf";
|
|
2213
2238
|
var compilerArchives = {
|
|
@@ -2285,6 +2310,13 @@ var compilerArchives = {
|
|
|
2285
2310
|
}
|
|
2286
2311
|
};
|
|
2287
2312
|
|
|
2313
|
+
// src/swift-objc-sdk.ts
|
|
2314
|
+
var import_node_path6 = __toESM(require("node:path"), 1);
|
|
2315
|
+
|
|
2316
|
+
// src/swift-objc-sdk-tree.ts
|
|
2317
|
+
var import_node_fs4 = require("node:fs");
|
|
2318
|
+
var import_node_path5 = __toESM(require("node:path"), 1);
|
|
2319
|
+
|
|
2288
2320
|
// src/swift-objc-sdk.ts
|
|
2289
2321
|
var IOS_SDK_TARGET = "arm64-apple-ios16.0-simulator";
|
|
2290
2322
|
|
|
@@ -2343,22 +2375,22 @@ var NATIVE_GRAPH_INPUTS = {
|
|
|
2343
2375
|
compiler: "Apple Swift version 6.4 (swiftlang-6.4.0.34.1 clang-2100.3.34.1)",
|
|
2344
2376
|
target: IOS_SDK_TARGET
|
|
2345
2377
|
};
|
|
2346
|
-
var NATIVE_GRAPH_ID = (0,
|
|
2378
|
+
var NATIVE_GRAPH_ID = (0, import_node_crypto3.createHash)("sha256").update(JSON.stringify(NATIVE_GRAPH_INPUTS)).digest("hex");
|
|
2347
2379
|
|
|
2348
2380
|
// src/xcode-project.ts
|
|
2349
|
-
var
|
|
2350
|
-
var
|
|
2351
|
-
var
|
|
2352
|
-
var
|
|
2353
|
-
var import_plist3 = __toESM(require("plist"), 1);
|
|
2381
|
+
var import_node_child_process24 = require("node:child_process");
|
|
2382
|
+
var import_node_crypto26 = require("node:crypto");
|
|
2383
|
+
var import_node_fs43 = __toESM(require("node:fs"), 1);
|
|
2384
|
+
var import_node_path45 = __toESM(require("node:path"), 1);
|
|
2385
|
+
var import_plist3 = __toESM(require("peachsim/vendor/plist"), 1);
|
|
2354
2386
|
|
|
2355
2387
|
// src/bazel-project.ts
|
|
2356
|
-
var
|
|
2357
|
-
var
|
|
2358
|
-
var
|
|
2359
|
-
var
|
|
2360
|
-
var
|
|
2361
|
-
var import_plist2 = __toESM(require("plist"), 1);
|
|
2388
|
+
var import_node_child_process4 = require("node:child_process");
|
|
2389
|
+
var import_node_crypto4 = require("node:crypto");
|
|
2390
|
+
var import_node_fs6 = __toESM(require("node:fs"), 1);
|
|
2391
|
+
var import_node_os2 = __toESM(require("node:os"), 1);
|
|
2392
|
+
var import_node_path8 = __toESM(require("node:path"), 1);
|
|
2393
|
+
var import_plist2 = __toESM(require("peachsim/vendor/plist"), 1);
|
|
2362
2394
|
var LIBRARY_RULES = /* @__PURE__ */ new Set(["swift_library", "objc_library", "cc_library"]);
|
|
2363
2395
|
var QUERIED_RULES = [
|
|
2364
2396
|
"swift_library",
|
|
@@ -2375,43 +2407,43 @@ var QUERIED_RULES = [
|
|
|
2375
2407
|
];
|
|
2376
2408
|
var NATIVE_SOURCE = /\.(?:m|mm|c|cc|cpp|cxx|S)$/;
|
|
2377
2409
|
var HEADER = /\.(?:h|hh|hpp|hxx|inc|inl|ipp)$/;
|
|
2378
|
-
var PRODUCTS =
|
|
2410
|
+
var PRODUCTS = import_node_path8.default.join(".build", "peach-bazel", "Products");
|
|
2379
2411
|
function isBazelPackage(input) {
|
|
2380
|
-
return /^BUILD(?:\.bazel)?$/.test(
|
|
2412
|
+
return /^BUILD(?:\.bazel)?$/.test(import_node_path8.default.basename(input)) && import_node_fs6.default.statSync(input).isFile();
|
|
2381
2413
|
}
|
|
2382
2414
|
function workspaceRoot(buildFile) {
|
|
2383
|
-
for (let dir =
|
|
2415
|
+
for (let dir = import_node_path8.default.dirname(buildFile); ; dir = import_node_path8.default.dirname(dir)) {
|
|
2384
2416
|
if (["MODULE.bazel", "WORKSPACE", "WORKSPACE.bazel"].some(
|
|
2385
|
-
(name) =>
|
|
2417
|
+
(name) => import_node_fs6.default.existsSync(import_node_path8.default.join(dir, name))
|
|
2386
2418
|
))
|
|
2387
2419
|
return dir;
|
|
2388
|
-
if (
|
|
2420
|
+
if (import_node_path8.default.dirname(dir) === dir)
|
|
2389
2421
|
throw new Error(`${buildFile} is not inside a bazel workspace`);
|
|
2390
2422
|
}
|
|
2391
2423
|
}
|
|
2392
2424
|
function bazelBinary(root) {
|
|
2393
|
-
const pinned =
|
|
2394
|
-
if (!
|
|
2395
|
-
const version =
|
|
2396
|
-
const platform =
|
|
2397
|
-
const arch =
|
|
2425
|
+
const pinned = import_node_path8.default.join(root, ".bazelversion");
|
|
2426
|
+
if (!import_node_fs6.default.existsSync(pinned)) return "bazel";
|
|
2427
|
+
const version = import_node_fs6.default.readFileSync(pinned, "utf8").trim();
|
|
2428
|
+
const platform = import_node_os2.default.platform() === "darwin" ? "darwin" : "linux";
|
|
2429
|
+
const arch = import_node_os2.default.arch() === "arm64" ? "arm64" : "x86_64";
|
|
2398
2430
|
const name = `bazel-${version}-${platform}-${arch}`;
|
|
2399
|
-
const binary =
|
|
2400
|
-
if (
|
|
2431
|
+
const binary = import_node_path8.default.join(import_node_os2.default.homedir(), ".peach", "cache", "bazel", name);
|
|
2432
|
+
if (import_node_fs6.default.existsSync(binary)) return binary;
|
|
2401
2433
|
const url = `https://github.com/bazelbuild/bazel/releases/download/${version}/${name}`;
|
|
2402
|
-
|
|
2434
|
+
import_node_fs6.default.mkdirSync(import_node_path8.default.dirname(binary), { recursive: true });
|
|
2403
2435
|
const partial = `${binary}.${process.pid}.partial`;
|
|
2404
|
-
(0,
|
|
2405
|
-
const expected = (0,
|
|
2436
|
+
(0, import_node_child_process4.execFileSync)("curl", ["-fsSL", "-o", partial, url]);
|
|
2437
|
+
const expected = (0, import_node_child_process4.execFileSync)("curl", ["-fsSL", `${url}.sha256`], {
|
|
2406
2438
|
encoding: "utf8"
|
|
2407
2439
|
}).split(/\s/)[0];
|
|
2408
|
-
const actual = (0,
|
|
2440
|
+
const actual = (0, import_node_crypto4.createHash)("sha256").update(import_node_fs6.default.readFileSync(partial)).digest("hex");
|
|
2409
2441
|
if (actual !== expected) {
|
|
2410
|
-
|
|
2442
|
+
import_node_fs6.default.rmSync(partial, { force: true });
|
|
2411
2443
|
throw new Error(`${url} digest ${actual} differs from its release ${expected}`);
|
|
2412
2444
|
}
|
|
2413
|
-
|
|
2414
|
-
|
|
2445
|
+
import_node_fs6.default.chmodSync(partial, 493);
|
|
2446
|
+
import_node_fs6.default.renameSync(partial, binary);
|
|
2415
2447
|
return binary;
|
|
2416
2448
|
}
|
|
2417
2449
|
function parseRule(raw) {
|
|
@@ -2435,22 +2467,22 @@ function parseRule(raw) {
|
|
|
2435
2467
|
};
|
|
2436
2468
|
}
|
|
2437
2469
|
function graphInputsDigest(root) {
|
|
2438
|
-
const hash = (0,
|
|
2470
|
+
const hash = (0, import_node_crypto4.createHash)("sha256");
|
|
2439
2471
|
const visit = (dir) => {
|
|
2440
|
-
for (const entry of
|
|
2472
|
+
for (const entry of import_node_fs6.default.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
|
|
2441
2473
|
if (entry.name.startsWith(".") || entry.name.startsWith("bazel-")) continue;
|
|
2442
|
-
const full =
|
|
2474
|
+
const full = import_node_path8.default.join(dir, entry.name);
|
|
2443
2475
|
if (entry.isDirectory()) visit(full);
|
|
2444
2476
|
else if (/^(?:BUILD(?:\.bazel)?|MODULE\.bazel(?:\.lock)?|WORKSPACE(?:\.bazel)?|\.bazelrc|\.bazelversion)$/.test(
|
|
2445
2477
|
entry.name
|
|
2446
2478
|
) || entry.name.endsWith(".bzl"))
|
|
2447
|
-
hash.update(
|
|
2479
|
+
hash.update(import_node_path8.default.relative(root, full)).update("\0").update(import_node_fs6.default.readFileSync(full));
|
|
2448
2480
|
}
|
|
2449
2481
|
};
|
|
2450
2482
|
visit(root);
|
|
2451
2483
|
for (const file of [".bazelrc", ".bazelversion"])
|
|
2452
|
-
if (
|
|
2453
|
-
hash.update(file).update(
|
|
2484
|
+
if (import_node_fs6.default.existsSync(import_node_path8.default.join(root, file)))
|
|
2485
|
+
hash.update(file).update(import_node_fs6.default.readFileSync(import_node_path8.default.join(root, file)));
|
|
2454
2486
|
return hash.digest("hex");
|
|
2455
2487
|
}
|
|
2456
2488
|
var graphs = /* @__PURE__ */ new Map();
|
|
@@ -2470,16 +2502,16 @@ function bazelGraph(root, label, configuration) {
|
|
|
2470
2502
|
const cached = graphs.get(key);
|
|
2471
2503
|
if (cached) return cached;
|
|
2472
2504
|
const flags = configurationFlags(configuration);
|
|
2473
|
-
const digest = (0,
|
|
2474
|
-
const file =
|
|
2505
|
+
const digest = (0, import_node_crypto4.createHash)("sha256").update(JSON.stringify([GRAPH_FORMAT, label, flags, QUERIED_RULES])).update(graphInputsDigest(root)).digest("hex").slice(0, 24);
|
|
2506
|
+
const file = import_node_path8.default.join(root, ".build", "peach-bazel", `graph-${digest}.json`);
|
|
2475
2507
|
const bazel = bazelBinary(root);
|
|
2476
|
-
const run2 = (args) => (0,
|
|
2508
|
+
const run2 = (args) => (0, import_node_child_process4.execFileSync)(bazel, args, {
|
|
2477
2509
|
cwd: root,
|
|
2478
2510
|
encoding: "utf8",
|
|
2479
2511
|
maxBuffer: 1 << 30,
|
|
2480
2512
|
stdio: ["ignore", "pipe", "pipe"]
|
|
2481
2513
|
});
|
|
2482
|
-
if (!
|
|
2514
|
+
if (!import_node_fs6.default.existsSync(file)) {
|
|
2483
2515
|
const application = run2(["query", label, "--output=streamed_jsonproto"]);
|
|
2484
2516
|
const app2 = parseRule({ target: JSON.parse(application.trim().split("\n")[0]) });
|
|
2485
2517
|
if (!app2?.ruleClass.endsWith("_application"))
|
|
@@ -2503,8 +2535,8 @@ function bazelGraph(root, label, configuration) {
|
|
|
2503
2535
|
const info2 = run2(["info", "output_base", "execution_root"]);
|
|
2504
2536
|
const bin = run2(["cquery", deps[0], ...flags, "--output=files"]).split("\n").find((line) => line.includes("/bin/"));
|
|
2505
2537
|
if (!bin) throw new Error(`bazel cquery names no output for ${deps[0]}`);
|
|
2506
|
-
|
|
2507
|
-
|
|
2538
|
+
import_node_fs6.default.mkdirSync(import_node_path8.default.dirname(file), { recursive: true });
|
|
2539
|
+
import_node_fs6.default.writeFileSync(
|
|
2508
2540
|
`${file}.partial`,
|
|
2509
2541
|
JSON.stringify({
|
|
2510
2542
|
application,
|
|
@@ -2514,9 +2546,9 @@ function bazelGraph(root, label, configuration) {
|
|
|
2514
2546
|
bin: bin.slice(0, bin.indexOf("/bin/") + 4)
|
|
2515
2547
|
})
|
|
2516
2548
|
);
|
|
2517
|
-
|
|
2549
|
+
import_node_fs6.default.renameSync(`${file}.partial`, file);
|
|
2518
2550
|
}
|
|
2519
|
-
const stored = JSON.parse(
|
|
2551
|
+
const stored = JSON.parse(import_node_fs6.default.readFileSync(file, "utf8"));
|
|
2520
2552
|
if (!isRecord(stored) || typeof stored.application !== "string" || typeof stored.cquery !== "string" || typeof stored.defaults !== "string" || typeof stored.info !== "string" || typeof stored.bin !== "string")
|
|
2521
2553
|
throw new Error(`${file} is not a bazel graph`);
|
|
2522
2554
|
const app = parseRule({
|
|
@@ -2557,8 +2589,8 @@ function bazelGraph(root, label, configuration) {
|
|
|
2557
2589
|
app,
|
|
2558
2590
|
appDeps,
|
|
2559
2591
|
outputBase: info.output_base ?? "",
|
|
2560
|
-
outputs:
|
|
2561
|
-
bin:
|
|
2592
|
+
outputs: import_node_path8.default.join(info.execution_root ?? "", stored.bin),
|
|
2593
|
+
bin: import_node_path8.default.join(root, ".build", "peach-bazel", "bin"),
|
|
2562
2594
|
minimumOS: app.attrs.get("minimum_os_version")?.value || null
|
|
2563
2595
|
};
|
|
2564
2596
|
graphs.set(key, graph);
|
|
@@ -2586,25 +2618,25 @@ var BazelFiles = class {
|
|
|
2586
2618
|
generated = /* @__PURE__ */ new Set();
|
|
2587
2619
|
repoDir(repo) {
|
|
2588
2620
|
if (repo === "") return this.root;
|
|
2589
|
-
const external =
|
|
2621
|
+
const external = import_node_path8.default.join(this.graph.outputBase, "external");
|
|
2590
2622
|
for (const name of [repo, `${repo}+`])
|
|
2591
|
-
if (
|
|
2623
|
+
if (import_node_fs6.default.existsSync(import_node_path8.default.join(external, name))) return import_node_path8.default.join(external, name);
|
|
2592
2624
|
throw new Error(`bazel external repository ${repo} is not fetched`);
|
|
2593
2625
|
}
|
|
2594
2626
|
/** the package directory in the source tree, or under bazel-bin for outputs. */
|
|
2595
2627
|
packageDirs(label) {
|
|
2596
2628
|
const { repo, pkg } = splitLabel(label);
|
|
2597
|
-
const source =
|
|
2598
|
-
const bin = repo ?
|
|
2629
|
+
const source = import_node_path8.default.join(this.repoDir(repo), pkg);
|
|
2630
|
+
const bin = repo ? import_node_path8.default.join(this.graph.bin, "external", import_node_path8.default.basename(this.repoDir(repo)), pkg) : import_node_path8.default.join(this.graph.bin, pkg);
|
|
2599
2631
|
return [source, bin];
|
|
2600
2632
|
}
|
|
2601
2633
|
path(label) {
|
|
2602
2634
|
const { repo, pkg, name } = splitLabel(label);
|
|
2603
2635
|
if (this.generated.has(label)) {
|
|
2604
2636
|
const [, bin] = this.packageDirs(label);
|
|
2605
|
-
return
|
|
2637
|
+
return import_node_path8.default.join(bin, name);
|
|
2606
2638
|
}
|
|
2607
|
-
return
|
|
2639
|
+
return import_node_path8.default.join(this.repoDir(repo), pkg, name);
|
|
2608
2640
|
}
|
|
2609
2641
|
/** files a label list names: filegroups, aliases and rule outputs expanded. */
|
|
2610
2642
|
expand(labels, from) {
|
|
@@ -2634,9 +2666,9 @@ function readBazelAppTarget(buildFile, targetName, configurationName, options =
|
|
|
2634
2666
|
throw new Error(
|
|
2635
2667
|
`${buildFile}: pass --target with the ios_application the bazel package builds`
|
|
2636
2668
|
);
|
|
2637
|
-
const root =
|
|
2638
|
-
const pkg =
|
|
2639
|
-
const label = `//${pkg.split(
|
|
2669
|
+
const root = import_node_fs6.default.realpathSync.native(workspaceRoot(import_node_fs6.default.realpathSync.native(buildFile)));
|
|
2670
|
+
const pkg = import_node_path8.default.relative(root, import_node_path8.default.dirname(import_node_fs6.default.realpathSync.native(buildFile)));
|
|
2671
|
+
const label = `//${pkg.split(import_node_path8.default.sep).join("/")}:${targetName}`;
|
|
2640
2672
|
const configuration = configurationName ?? "Debug";
|
|
2641
2673
|
const graph = bazelGraph(root, label, configuration);
|
|
2642
2674
|
const files = new BazelFiles(graph, root);
|
|
@@ -2668,7 +2700,7 @@ function readBazelAppTarget(buildFile, targetName, configurationName, options =
|
|
|
2668
2700
|
if (known) return known;
|
|
2669
2701
|
const own = {
|
|
2670
2702
|
includes: (rule.attrs.get("includes")?.list ?? []).flatMap(
|
|
2671
|
-
(include) => files.packageDirs(rule.label).map((dir) =>
|
|
2703
|
+
(include) => files.packageDirs(rule.label).map((dir) => import_node_path8.default.normalize(import_node_path8.default.join(dir, include)))
|
|
2672
2704
|
),
|
|
2673
2705
|
defines: rule.attrs.get("defines")?.list ?? [],
|
|
2674
2706
|
moduleMaps: ["objc_library", "cc_library"].includes(rule.ruleClass) ? [moduleMapOf(rule)] : []
|
|
@@ -2693,11 +2725,11 @@ function readBazelAppTarget(buildFile, targetName, configurationName, options =
|
|
|
2693
2725
|
return result;
|
|
2694
2726
|
};
|
|
2695
2727
|
const debug = configuration !== "Release";
|
|
2696
|
-
const products =
|
|
2728
|
+
const products = import_node_path8.default.join(root, PRODUCTS);
|
|
2697
2729
|
const resources = [];
|
|
2698
2730
|
const resourceNames = {};
|
|
2699
2731
|
const moduleNameOf = (rule) => rule.attrs.get("module_name")?.value || splitLabel(rule.label).pkg.concat("_", splitLabel(rule.label).name).replace(/[^A-Za-z0-9_]/g, "_");
|
|
2700
|
-
const moduleMapOf = (rule) =>
|
|
2732
|
+
const moduleMapOf = (rule) => import_node_path8.default.join(products, "modulemaps", moduleNameOf(rule), "module.modulemap");
|
|
2701
2733
|
const idOf = (rule) => `${root}/BUILD#${rule.label}`;
|
|
2702
2734
|
const collectData = (rule) => {
|
|
2703
2735
|
for (const raw of rule.attrs.get("data")?.list ?? []) {
|
|
@@ -2709,7 +2741,7 @@ function readBazelAppTarget(buildFile, targetName, configurationName, options =
|
|
|
2709
2741
|
target.label
|
|
2710
2742
|
)) {
|
|
2711
2743
|
resources.push(file);
|
|
2712
|
-
resourceNames[file] =
|
|
2744
|
+
resourceNames[file] = import_node_path8.default.posix.join(bundle, import_node_path8.default.basename(file));
|
|
2713
2745
|
}
|
|
2714
2746
|
continue;
|
|
2715
2747
|
}
|
|
@@ -2811,14 +2843,14 @@ function readBazelAppTarget(buildFile, targetName, configurationName, options =
|
|
|
2811
2843
|
);
|
|
2812
2844
|
const text2 = `module ${moduleName} {
|
|
2813
2845
|
${published.map(
|
|
2814
|
-
(file) => ` ${textual.has(file) ? "textual header" : "header"} "${
|
|
2846
|
+
(file) => ` ${textual.has(file) ? "textual header" : "header"} "${import_node_path8.default.relative(import_node_path8.default.dirname(moduleMap), file)}"
|
|
2815
2847
|
`
|
|
2816
2848
|
).join("")} export *
|
|
2817
2849
|
}
|
|
2818
2850
|
`;
|
|
2819
|
-
|
|
2820
|
-
if (!
|
|
2821
|
-
|
|
2851
|
+
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") !== text2)
|
|
2853
|
+
import_node_fs6.default.writeFileSync(moduleMap, text2);
|
|
2822
2854
|
const clangDefines = [...debug ? ["DEBUG=1"] : [], ...defines].map(
|
|
2823
2855
|
(define) => `-D${define}`
|
|
2824
2856
|
);
|
|
@@ -2889,7 +2921,7 @@ ${published.map(
|
|
|
2889
2921
|
const bundle = files.expand(dep.attrs.get("xcframework_imports")?.list ?? [], dep.label).map(
|
|
2890
2922
|
(file) => file.slice(0, file.indexOf(".xcframework/") + ".xcframework".length)
|
|
2891
2923
|
).find((file) => file.endsWith(".xcframework"));
|
|
2892
|
-
return bundle ? [[
|
|
2924
|
+
return bundle ? [[import_node_path8.default.basename(bundle, ".xcframework"), bundle]] : [];
|
|
2893
2925
|
})
|
|
2894
2926
|
)
|
|
2895
2927
|
].map(([name, file]) => ({
|
|
@@ -2901,11 +2933,11 @@ ${published.map(
|
|
|
2901
2933
|
[rule.attrs.get("crate_root")?.value ?? ""],
|
|
2902
2934
|
rule.label
|
|
2903
2935
|
)[0];
|
|
2904
|
-
let dir = crateRoot ?
|
|
2905
|
-
while (!
|
|
2906
|
-
dir =
|
|
2907
|
-
const manifest =
|
|
2908
|
-
if (!
|
|
2936
|
+
let dir = crateRoot ? import_node_path8.default.dirname(crateRoot) : root;
|
|
2937
|
+
while (!import_node_fs6.default.existsSync(import_node_path8.default.join(dir, "Cargo.toml")) && dir.startsWith(`${root}${import_node_path8.default.sep}`))
|
|
2938
|
+
dir = import_node_path8.default.dirname(dir);
|
|
2939
|
+
const manifest = import_node_path8.default.join(dir, "Cargo.toml");
|
|
2940
|
+
if (!import_node_fs6.default.existsSync(manifest))
|
|
2909
2941
|
throw new Error(`${rule.label} has no Cargo.toml around its crate root`);
|
|
2910
2942
|
return { manifest, features: rule.attrs.get("crate_features")?.list ?? [] };
|
|
2911
2943
|
};
|
|
@@ -2933,20 +2965,20 @@ ${published.map(
|
|
|
2933
2965
|
...module2.allSources,
|
|
2934
2966
|
...module2.objc?.headers ?? []
|
|
2935
2967
|
])
|
|
2936
|
-
].filter((file) => !
|
|
2968
|
+
].filter((file) => !import_node_fs6.default.existsSync(file));
|
|
2937
2969
|
const mirror = () => {
|
|
2938
2970
|
for (const rule of graph.rules.values())
|
|
2939
2971
|
for (const output2 of rule.outputs) {
|
|
2940
2972
|
const target = files.path(output2);
|
|
2941
2973
|
if (target.endsWith(".a")) continue;
|
|
2942
|
-
const source =
|
|
2943
|
-
if (!
|
|
2944
|
-
const from =
|
|
2945
|
-
const to =
|
|
2974
|
+
const source = import_node_path8.default.join(graph.outputs, import_node_path8.default.relative(graph.bin, target));
|
|
2975
|
+
if (!import_node_fs6.default.existsSync(source)) continue;
|
|
2976
|
+
const from = import_node_fs6.default.statSync(source);
|
|
2977
|
+
const to = import_node_fs6.default.existsSync(target) ? import_node_fs6.default.statSync(target) : null;
|
|
2946
2978
|
if (to && to.mtimeMs === from.mtimeMs && to.size === from.size) continue;
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2979
|
+
import_node_fs6.default.rmSync(target, { recursive: true, force: true });
|
|
2980
|
+
import_node_fs6.default.mkdirSync(import_node_path8.default.dirname(target), { recursive: true });
|
|
2981
|
+
import_node_fs6.default.cpSync(source, target, {
|
|
2950
2982
|
recursive: true,
|
|
2951
2983
|
dereference: true,
|
|
2952
2984
|
preserveTimestamps: true
|
|
@@ -2962,7 +2994,7 @@ ${published.map(
|
|
|
2962
2994
|
...new Set(absent().flatMap((file) => owners.get(file) ?? []))
|
|
2963
2995
|
].sort();
|
|
2964
2996
|
if (generators.length > 0)
|
|
2965
|
-
(0,
|
|
2997
|
+
(0, import_node_child_process4.execFileSync)(
|
|
2966
2998
|
bazelBinary(root),
|
|
2967
2999
|
["build", ...configurationFlags(configuration), ...generators],
|
|
2968
3000
|
{ cwd: root, stdio: ["ignore", "pipe", "pipe"], maxBuffer: 1 << 28 }
|
|
@@ -2972,7 +3004,7 @@ ${published.map(
|
|
|
2972
3004
|
const missing = options.requireSources === false ? [] : absent();
|
|
2973
3005
|
if (missing.length > 0)
|
|
2974
3006
|
throw new Error(
|
|
2975
|
-
`bazel application has ${missing.length} unbuilt inputs: ${missing.slice(0, 5).map((file) =>
|
|
3007
|
+
`bazel application has ${missing.length} unbuilt inputs: ${missing.slice(0, 5).map((file) => import_node_path8.default.relative(root, file)).join(", ")}`
|
|
2976
3008
|
);
|
|
2977
3009
|
const archives = /* @__PURE__ */ new Map();
|
|
2978
3010
|
for (const rule of order) {
|
|
@@ -2996,7 +3028,7 @@ ${published.map(
|
|
|
2996
3028
|
);
|
|
2997
3029
|
const key = owner?.label ?? label2;
|
|
2998
3030
|
const entry = archives.get(key) ?? {
|
|
2999
|
-
library:
|
|
3031
|
+
library: import_node_path8.default.basename(archive),
|
|
3000
3032
|
holders: []
|
|
3001
3033
|
};
|
|
3002
3034
|
if (!entry.holders.includes(rule)) entry.holders.push(rule);
|
|
@@ -3009,9 +3041,9 @@ ${published.map(
|
|
|
3009
3041
|
(module2) => [
|
|
3010
3042
|
...module2.allSources.filter((file) => !file.endsWith(".swift")),
|
|
3011
3043
|
...module2.objc?.headers ?? []
|
|
3012
|
-
].filter((file) =>
|
|
3044
|
+
].filter((file) => import_node_fs6.default.existsSync(file)).flatMap(
|
|
3013
3045
|
(file) => [
|
|
3014
|
-
...
|
|
3046
|
+
...import_node_fs6.default.readFileSync(file, "utf8").matchAll(/^\s*#\s*(?:include|import)\s*[<"]([^>"\n]+)[>"]/gm)
|
|
3015
3047
|
].map((match) => match[1])
|
|
3016
3048
|
)
|
|
3017
3049
|
)
|
|
@@ -3029,10 +3061,10 @@ ${published.map(
|
|
|
3029
3061
|
],
|
|
3030
3062
|
rule.label
|
|
3031
3063
|
).filter((file) => /\.(?:h|hh|hpp|hxx|inc)$/.test(file)).map((file) => {
|
|
3032
|
-
const include = includes.find((dir) => file.startsWith(`${dir}${
|
|
3064
|
+
const include = includes.find((dir) => file.startsWith(`${dir}${import_node_path8.default.sep}`));
|
|
3033
3065
|
return {
|
|
3034
3066
|
file,
|
|
3035
|
-
name: include ?
|
|
3067
|
+
name: include ? import_node_path8.default.relative(include, file) : import_node_path8.default.basename(file)
|
|
3036
3068
|
};
|
|
3037
3069
|
});
|
|
3038
3070
|
});
|
|
@@ -3045,8 +3077,8 @@ ${published.map(
|
|
|
3045
3077
|
(include) => header.name === include || header.name.endsWith(`/${include}`)
|
|
3046
3078
|
)
|
|
3047
3079
|
);
|
|
3048
|
-
const bundle =
|
|
3049
|
-
const slice =
|
|
3080
|
+
const bundle = import_node_path8.default.join(products, "archives", `${name}.xcframework`);
|
|
3081
|
+
const slice = import_node_path8.default.join(bundle, "ios-arm64-simulator");
|
|
3050
3082
|
const contents = new Map([
|
|
3051
3083
|
[
|
|
3052
3084
|
"Info.plist",
|
|
@@ -3067,7 +3099,7 @@ ${published.map(
|
|
|
3067
3099
|
],
|
|
3068
3100
|
// c library headers may lean on the standard ones their callers include first
|
|
3069
3101
|
[
|
|
3070
|
-
|
|
3102
|
+
import_node_path8.default.join("ios-arm64-simulator", "Headers", `${name}.h`),
|
|
3071
3103
|
[
|
|
3072
3104
|
"#include <stddef.h>",
|
|
3073
3105
|
"#include <stdio.h>",
|
|
@@ -3075,7 +3107,7 @@ ${published.map(
|
|
|
3075
3107
|
].join("\n") + "\n"
|
|
3076
3108
|
],
|
|
3077
3109
|
[
|
|
3078
|
-
|
|
3110
|
+
import_node_path8.default.join("ios-arm64-simulator", "Headers", "module.modulemap"),
|
|
3079
3111
|
`module ${name} {
|
|
3080
3112
|
header "${name}.h"
|
|
3081
3113
|
export *
|
|
@@ -3084,28 +3116,28 @@ ${published.map(
|
|
|
3084
3116
|
],
|
|
3085
3117
|
...headers.map(
|
|
3086
3118
|
(header) => [
|
|
3087
|
-
|
|
3088
|
-
|
|
3119
|
+
import_node_path8.default.join("ios-arm64-simulator", "Headers", header.name),
|
|
3120
|
+
import_node_fs6.default.readFileSync(header.file)
|
|
3089
3121
|
]
|
|
3090
3122
|
)
|
|
3091
3123
|
]);
|
|
3092
|
-
const digest = (0,
|
|
3124
|
+
const digest = (0, import_node_crypto4.createHash)("sha256").update(
|
|
3093
3125
|
JSON.stringify(
|
|
3094
3126
|
[...contents].map(([file, bytes]) => [
|
|
3095
3127
|
file,
|
|
3096
|
-
(0,
|
|
3128
|
+
(0, import_node_crypto4.createHash)("sha256").update(bytes).digest("hex")
|
|
3097
3129
|
])
|
|
3098
3130
|
)
|
|
3099
3131
|
).digest("hex");
|
|
3100
|
-
const stamp =
|
|
3101
|
-
if (!
|
|
3102
|
-
|
|
3132
|
+
const stamp = import_node_path8.default.join(bundle, ".peach-digest");
|
|
3133
|
+
if (!import_node_fs6.default.existsSync(stamp) || import_node_fs6.default.readFileSync(stamp, "utf8") !== digest) {
|
|
3134
|
+
import_node_fs6.default.rmSync(bundle, { recursive: true, force: true });
|
|
3103
3135
|
for (const [file, bytes] of contents) {
|
|
3104
|
-
|
|
3105
|
-
|
|
3136
|
+
import_node_fs6.default.mkdirSync(import_node_path8.default.dirname(import_node_path8.default.join(bundle, file)), { recursive: true });
|
|
3137
|
+
import_node_fs6.default.writeFileSync(import_node_path8.default.join(bundle, file), bytes);
|
|
3106
3138
|
}
|
|
3107
|
-
|
|
3108
|
-
|
|
3139
|
+
import_node_fs6.default.writeFileSync(import_node_path8.default.join(slice, library), "");
|
|
3140
|
+
import_node_fs6.default.writeFileSync(stamp, digest);
|
|
3109
3141
|
}
|
|
3110
3142
|
binaryFrameworks.push({ name, path: bundle, rustCrate });
|
|
3111
3143
|
}
|
|
@@ -3127,10 +3159,10 @@ ${published.map(
|
|
|
3127
3159
|
) : Array.isArray(value) ? value.map(substitute) : value && typeof value === "object" && !(value instanceof Date) && !Buffer.isBuffer(value) ? Object.fromEntries(
|
|
3128
3160
|
Object.entries(value).map(([key, item]) => [key, substitute(item)])
|
|
3129
3161
|
) : value;
|
|
3130
|
-
const infoPlistReady = infoPlistFiles.every((file) =>
|
|
3162
|
+
const infoPlistReady = infoPlistFiles.every((file) => import_node_fs6.default.existsSync(file));
|
|
3131
3163
|
const info = {};
|
|
3132
3164
|
for (const file of infoPlistReady ? infoPlistFiles : []) {
|
|
3133
|
-
const fragment = import_plist2.default.parse(
|
|
3165
|
+
const fragment = import_plist2.default.parse(import_node_fs6.default.readFileSync(file, "utf8"));
|
|
3134
3166
|
if (!fragment || typeof fragment !== "object" || Array.isArray(fragment) || fragment instanceof Date || Buffer.isBuffer(fragment))
|
|
3135
3167
|
throw new Error(`${file} is not a plist dictionary`);
|
|
3136
3168
|
for (const [key, value] of Object.entries(fragment)) {
|
|
@@ -3154,9 +3186,9 @@ ${published.map(
|
|
|
3154
3186
|
});
|
|
3155
3187
|
const buildFiles = [
|
|
3156
3188
|
...new Set(
|
|
3157
|
-
order.map((rule) =>
|
|
3189
|
+
order.map((rule) => import_node_path8.default.join(files.packageDirs(rule.label)[0], "BUILD"))
|
|
3158
3190
|
)
|
|
3159
|
-
].map((file) =>
|
|
3191
|
+
].map((file) => import_node_fs6.default.existsSync(file) ? file : `${file}.bazel`).filter((file) => import_node_fs6.default.existsSync(file));
|
|
3160
3192
|
return {
|
|
3161
3193
|
...appModule,
|
|
3162
3194
|
resources: [...new Set(resources)],
|
|
@@ -3545,26 +3577,26 @@ var ios_sdk_frameworks_default = {
|
|
|
3545
3577
|
};
|
|
3546
3578
|
|
|
3547
3579
|
// src/prepared-xcode-phases.ts
|
|
3548
|
-
var
|
|
3549
|
-
var
|
|
3550
|
-
var
|
|
3580
|
+
var import_node_crypto5 = require("node:crypto");
|
|
3581
|
+
var import_node_fs7 = __toESM(require("node:fs"), 1);
|
|
3582
|
+
var import_node_path9 = __toESM(require("node:path"), 1);
|
|
3551
3583
|
var workspaces = /* @__PURE__ */ new Map();
|
|
3552
3584
|
var recording;
|
|
3553
3585
|
function relativeFile(root, file) {
|
|
3554
|
-
const
|
|
3555
|
-
if (!
|
|
3586
|
+
const relative2 = import_node_path9.default.relative(root, file);
|
|
3587
|
+
if (!relative2 || relative2 === ".." || relative2.startsWith(`..${import_node_path9.default.sep}`) || import_node_path9.default.isAbsolute(relative2))
|
|
3556
3588
|
throw new Error(`prepared Xcode output is outside its workspace: ${file}`);
|
|
3557
|
-
return
|
|
3589
|
+
return relative2.split(import_node_path9.default.sep).join("/");
|
|
3558
3590
|
}
|
|
3559
3591
|
function output(root, file) {
|
|
3560
|
-
const
|
|
3561
|
-
const stat =
|
|
3562
|
-
if (!stat) return { path:
|
|
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 };
|
|
3563
3595
|
if (!stat.isFile()) throw new Error(`prepared Xcode output is not a file: ${file}`);
|
|
3564
|
-
relativeFile(root,
|
|
3565
|
-
const bytes =
|
|
3596
|
+
relativeFile(root, import_node_fs7.default.realpathSync(file));
|
|
3597
|
+
const bytes = import_node_fs7.default.readFileSync(file);
|
|
3566
3598
|
const prefix = Buffer.from(root);
|
|
3567
|
-
const hash = (0,
|
|
3599
|
+
const hash = (0, import_node_crypto5.createHash)("sha256");
|
|
3568
3600
|
let offset = 0;
|
|
3569
3601
|
for (let index = bytes.indexOf(prefix); index !== -1; index = bytes.indexOf(prefix, offset)) {
|
|
3570
3602
|
hash.update(bytes.subarray(offset, index)).update("\0workspace\0");
|
|
@@ -3572,14 +3604,14 @@ function output(root, file) {
|
|
|
3572
3604
|
}
|
|
3573
3605
|
hash.update(bytes.subarray(offset));
|
|
3574
3606
|
return {
|
|
3575
|
-
path:
|
|
3607
|
+
path: relative2,
|
|
3576
3608
|
sha256: hash.digest("hex")
|
|
3577
3609
|
};
|
|
3578
3610
|
}
|
|
3579
3611
|
function preparedXcodePhase(project, target, phase, configuration, outputs, recorded) {
|
|
3580
3612
|
const root = recording?.root ?? [...workspaces.keys()].find((root2) => {
|
|
3581
|
-
const
|
|
3582
|
-
return
|
|
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);
|
|
3583
3615
|
});
|
|
3584
3616
|
if (!root) return false;
|
|
3585
3617
|
const entry = {
|
|
@@ -3614,27 +3646,30 @@ function preparedXcodePhase(project, target, phase, configuration, outputs, reco
|
|
|
3614
3646
|
}
|
|
3615
3647
|
|
|
3616
3648
|
// src/swift-binary-modules.ts
|
|
3617
|
-
var
|
|
3618
|
-
var
|
|
3649
|
+
var import_node_crypto7 = require("node:crypto");
|
|
3650
|
+
var import_node_fs9 = __toESM(require("node:fs"), 1);
|
|
3651
|
+
var import_node_path11 = __toESM(require("node:path"), 1);
|
|
3619
3652
|
|
|
3620
3653
|
// src/home-paths.ts
|
|
3621
|
-
var
|
|
3622
|
-
var
|
|
3654
|
+
var import_node_crypto6 = require("node:crypto");
|
|
3655
|
+
var import_node_fs8 = __toESM(require("node:fs"), 1);
|
|
3656
|
+
var import_node_os3 = require("node:os");
|
|
3657
|
+
var import_node_path10 = __toESM(require("node:path"), 1);
|
|
3623
3658
|
var PEACH_HOME_ENV = "PEACH_HOME";
|
|
3624
3659
|
function ambientHomeDir() {
|
|
3625
|
-
return
|
|
3660
|
+
return import_node_path10.default.join((0, import_node_os3.homedir)(), ".peach");
|
|
3626
3661
|
}
|
|
3627
3662
|
function rnxHomeDir() {
|
|
3628
3663
|
const override = process.env[PEACH_HOME_ENV];
|
|
3629
|
-
return override && override.length > 0 ?
|
|
3664
|
+
return override && override.length > 0 ? import_node_path10.default.resolve(override) : ambientHomeDir();
|
|
3630
3665
|
}
|
|
3631
3666
|
function cacheDir() {
|
|
3632
|
-
return
|
|
3667
|
+
return import_node_path10.default.join(rnxHomeDir(), "cache");
|
|
3633
3668
|
}
|
|
3634
3669
|
var DAEMON_LOCKFILE_MAX_BYTES = 16 * 1024;
|
|
3635
3670
|
|
|
3636
3671
|
// src/swift-binary-modules.ts
|
|
3637
|
-
var cacheDir2 =
|
|
3672
|
+
var cacheDir2 = import_node_path11.default.join(cacheDir(), "swift-binary-modules");
|
|
3638
3673
|
function frameworkModules(paths) {
|
|
3639
3674
|
const modules = /* @__PURE__ */ new Set();
|
|
3640
3675
|
for (const file of paths) {
|
|
@@ -3644,31 +3679,41 @@ function frameworkModules(paths) {
|
|
|
3644
3679
|
return [...modules].sort();
|
|
3645
3680
|
}
|
|
3646
3681
|
function localSwiftBinaryModules(dir) {
|
|
3647
|
-
if (!
|
|
3648
|
-
const slices =
|
|
3682
|
+
if (!import_node_fs9.default.existsSync(dir)) return [];
|
|
3683
|
+
const slices = import_node_fs9.default.readdirSync(dir, { withFileTypes: true }).filter((slice) => slice.isDirectory());
|
|
3649
3684
|
const frameworks = frameworkModules(
|
|
3650
3685
|
slices.flatMap(
|
|
3651
|
-
(slice) =>
|
|
3686
|
+
(slice) => import_node_fs9.default.readdirSync(import_node_path11.default.join(dir, slice.name)).map((entry) => `${slice.name}/${entry}`)
|
|
3652
3687
|
)
|
|
3653
3688
|
);
|
|
3654
3689
|
if (frameworks.length > 0) return frameworks;
|
|
3655
3690
|
const modules = /* @__PURE__ */ new Set();
|
|
3656
3691
|
for (const slice of slices) {
|
|
3657
|
-
const headers =
|
|
3658
|
-
if (!
|
|
3659
|
-
for (const file of
|
|
3660
|
-
if (
|
|
3661
|
-
const module2 = moduleMapName(
|
|
3692
|
+
const headers = import_node_path11.default.join(dir, slice.name, "Headers");
|
|
3693
|
+
if (!import_node_fs9.default.existsSync(headers)) continue;
|
|
3694
|
+
for (const file of import_node_fs9.default.readdirSync(headers, { recursive: true, encoding: "utf8" })) {
|
|
3695
|
+
if (import_node_path11.default.basename(file) !== "module.modulemap") continue;
|
|
3696
|
+
const module2 = moduleMapName(import_node_fs9.default.readFileSync(import_node_path11.default.join(headers, file), "utf8"));
|
|
3662
3697
|
if (module2) modules.add(module2);
|
|
3663
3698
|
}
|
|
3664
3699
|
}
|
|
3665
3700
|
return [...modules].sort();
|
|
3666
3701
|
}
|
|
3667
3702
|
|
|
3703
|
+
// src/swift-coverage/xcode-assets.ts
|
|
3704
|
+
var import_node_crypto9 = require("node:crypto");
|
|
3705
|
+
var import_node_fs12 = require("node:fs");
|
|
3706
|
+
var import_node_path14 = require("node:path");
|
|
3707
|
+
|
|
3668
3708
|
// src/swift-coverage/provenance.ts
|
|
3669
|
-
var
|
|
3709
|
+
var import_node_crypto8 = require("node:crypto");
|
|
3710
|
+
var import_node_fs10 = require("node:fs");
|
|
3711
|
+
var import_node_path12 = require("node:path");
|
|
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":"a19fe4c5e2efe18bbc3ece544ff2c8be660170d63274cccb0ab58e53083050e4","swift-package.ts":"851417572ca9aff699ad368bdc3ff05309b0256e483d40812b9c0beb869d0a5b","swift-source-file.ts":"8becce5e73b76a61d9d202c1ecfb39b1238e9bbf0e77841f1c51c98fa9ac7bd3","swift-toolchain.ts":"a0ef7c20a2bc2b7dbd98b9006a8b000b9b4f9708f1bcf0adad8aaf79ef253022","home-paths.ts":"d1606390f0e8e50f0ff72544eadb3d49dfabf08e004c1218f2998c36fb8995dd","xcode-header-search.ts":"4a775ba92c7b23ce71dd6bb08c188c4bccd6e1ed500cc9fc7850030b945fc8d4","xcode-project.ts":"1eea444b8005e33de0a9987f184b183ba3fd49ab8af347a893383ec2e464cf4d","xcode-target-members.ts":"2f25aaf5a3aa34395983c75935491c06bd68554c47ff1cb06b49c79499c03db0","xcode-json-project.ts":"41990ebbe4b488eef34e74c4608b4b48e5a5b299ba98ca7fbcfdfa0e77be63b6","openstep-plist.ts":"74e6ce1dac80c9c318e0e9f5e3e8cd19a898a8820c36fc160609695bcb59dcd3"}') : swiftCoverageSourceDigests((0, import_node_path12.join)(__sootsim_import_meta_dirname, ".."));
|
|
3670
3713
|
|
|
3671
3714
|
// src/swift-coverage/xcode-asset-symbols.ts
|
|
3715
|
+
var import_node_fs11 = require("node:fs");
|
|
3716
|
+
var import_node_path13 = require("node:path");
|
|
3672
3717
|
var silentTypes = /* @__PURE__ */ new Set([
|
|
3673
3718
|
"appiconset",
|
|
3674
3719
|
"brandassets",
|
|
@@ -3850,9 +3895,12 @@ var assetSymbolSettingKeys = [
|
|
|
3850
3895
|
];
|
|
3851
3896
|
|
|
3852
3897
|
// src/swift-package-manifest.ts
|
|
3853
|
-
var
|
|
3854
|
-
var
|
|
3855
|
-
var
|
|
3898
|
+
var import_node_child_process23 = require("node:child_process");
|
|
3899
|
+
var import_node_crypto25 = require("node:crypto");
|
|
3900
|
+
var import_node_fs42 = __toESM(require("node:fs"), 1);
|
|
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");
|
|
3856
3904
|
|
|
3857
3905
|
// src/git-repo-env.ts
|
|
3858
3906
|
var UNATTENDED_GIT_ENV = {
|
|
@@ -3860,14 +3908,99 @@ var UNATTENDED_GIT_ENV = {
|
|
|
3860
3908
|
GIT_SSH_COMMAND: process.env.GIT_SSH_COMMAND ?? "ssh -o BatchMode=yes"
|
|
3861
3909
|
};
|
|
3862
3910
|
|
|
3911
|
+
// src/swift-distribution.ts
|
|
3912
|
+
var import_node_fs41 = __toESM(require("node:fs"), 1);
|
|
3913
|
+
var import_node_os12 = __toESM(require("node:os"), 1);
|
|
3914
|
+
var import_node_path42 = __toESM(require("node:path"), 1);
|
|
3915
|
+
|
|
3916
|
+
// ../contrast-runtime-delivery/src/index.ts
|
|
3917
|
+
var import_node_child_process7 = require("node:child_process");
|
|
3918
|
+
var import_node_crypto10 = __toESM(require("node:crypto"), 1);
|
|
3919
|
+
var import_node_fs16 = __toESM(require("node:fs"), 1);
|
|
3920
|
+
var import_node_os6 = __toESM(require("node:os"), 1);
|
|
3921
|
+
var import_node_path17 = __toESM(require("node:path"), 1);
|
|
3922
|
+
var import_promises3 = require("node:stream/promises");
|
|
3923
|
+
var import_node_zlib2 = __toESM(require("node:zlib"), 1);
|
|
3924
|
+
|
|
3925
|
+
// src/process-group.ts
|
|
3926
|
+
var import_node_child_process6 = require("node:child_process");
|
|
3927
|
+
var import_node_fs14 = require("node:fs");
|
|
3928
|
+
var import_node_os5 = require("node:os");
|
|
3929
|
+
var import_node_path15 = require("node:path");
|
|
3930
|
+
var import_node_stream = require("node:stream");
|
|
3931
|
+
var import_promises2 = require("node:timers/promises");
|
|
3932
|
+
|
|
3933
|
+
// src/process-table.ts
|
|
3934
|
+
var import_node_child_process5 = require("node:child_process");
|
|
3935
|
+
var import_node_fs13 = require("node:fs");
|
|
3936
|
+
var import_node_os4 = require("node:os");
|
|
3937
|
+
|
|
3938
|
+
// ../contrast-runtime-delivery/src/product.ts
|
|
3939
|
+
var import_node_fs15 = __toESM(require("node:fs"), 1);
|
|
3940
|
+
var import_node_path16 = __toESM(require("node:path"), 1);
|
|
3941
|
+
|
|
3942
|
+
// cli/drivers/linux-browser-libs.ts
|
|
3943
|
+
var import_node_child_process8 = require("node:child_process");
|
|
3944
|
+
var import_node_fs17 = require("node:fs");
|
|
3945
|
+
var import_node_path18 = require("node:path");
|
|
3946
|
+
|
|
3863
3947
|
// src/swift-compile.ts
|
|
3864
|
-
var
|
|
3948
|
+
var import_node_child_process22 = require("node:child_process");
|
|
3949
|
+
var import_node_crypto23 = require("node:crypto");
|
|
3950
|
+
var import_node_fs38 = require("node:fs");
|
|
3951
|
+
var import_node_os11 = __toESM(require("node:os"), 1);
|
|
3952
|
+
var import_node_path39 = __toESM(require("node:path"), 1);
|
|
3953
|
+
var v5 = __toESM(require("peachsim/vendor/valibot"), 1);
|
|
3954
|
+
|
|
3955
|
+
// src/admitted-mac-build.ts
|
|
3956
|
+
var import_node_child_process9 = require("node:child_process");
|
|
3957
|
+
|
|
3958
|
+
// src/retired-cache-directory.ts
|
|
3959
|
+
var import_node_crypto11 = require("node:crypto");
|
|
3960
|
+
var import_node_fs19 = require("node:fs");
|
|
3961
|
+
var import_promises4 = require("node:fs/promises");
|
|
3962
|
+
var import_node_path19 = __toESM(require("node:path"), 1);
|
|
3963
|
+
|
|
3964
|
+
// src/process-liveness.ts
|
|
3965
|
+
var import_node_fs18 = require("node:fs");
|
|
3966
|
+
|
|
3967
|
+
// src/swift-compiler-digest.ts
|
|
3968
|
+
var import_node_crypto12 = require("node:crypto");
|
|
3969
|
+
var import_node_fs20 = require("node:fs");
|
|
3970
|
+
var import_node_path20 = __toESM(require("node:path"), 1);
|
|
3971
|
+
|
|
3972
|
+
// src/swift-darwin-records.ts
|
|
3973
|
+
var import_node_child_process11 = require("node:child_process");
|
|
3974
|
+
var import_node_fs22 = require("node:fs");
|
|
3975
|
+
var import_node_os7 = require("node:os");
|
|
3976
|
+
var import_node_path22 = __toESM(require("node:path"), 1);
|
|
3977
|
+
|
|
3978
|
+
// src/swift-shared-sdk.ts
|
|
3979
|
+
var import_node_child_process10 = require("node:child_process");
|
|
3980
|
+
var import_node_crypto13 = require("node:crypto");
|
|
3981
|
+
var import_node_fs21 = __toESM(require("node:fs"), 1);
|
|
3982
|
+
var import_node_path21 = __toESM(require("node:path"), 1);
|
|
3983
|
+
|
|
3984
|
+
// src/swift-guest-compile.ts
|
|
3985
|
+
var import_node_child_process17 = require("node:child_process");
|
|
3986
|
+
var import_node_fs30 = require("node:fs");
|
|
3987
|
+
var import_node_path30 = __toESM(require("node:path"), 1);
|
|
3988
|
+
|
|
3989
|
+
// src/swift-guest-archive.ts
|
|
3990
|
+
var import_node_child_process13 = require("node:child_process");
|
|
3991
|
+
var import_node_crypto15 = require("node:crypto");
|
|
3992
|
+
var import_node_fs24 = require("node:fs");
|
|
3993
|
+
var import_node_path24 = __toESM(require("node:path"), 1);
|
|
3865
3994
|
|
|
3866
3995
|
// src/swift-wasm-prune.ts
|
|
3867
|
-
var
|
|
3996
|
+
var import_node_child_process12 = require("node:child_process");
|
|
3997
|
+
var import_node_crypto14 = require("node:crypto");
|
|
3998
|
+
var import_node_fs23 = __toESM(require("node:fs"), 1);
|
|
3999
|
+
var import_node_path23 = __toESM(require("node:path"), 1);
|
|
4000
|
+
var v2 = __toESM(require("peachsim/vendor/valibot"), 1);
|
|
3868
4001
|
|
|
3869
4002
|
// src/swiftRuntimeProductContract.ts
|
|
3870
|
-
var v = __toESM(require("valibot"), 1);
|
|
4003
|
+
var v = __toESM(require("peachsim/vendor/valibot"), 1);
|
|
3871
4004
|
var swiftFrameworkProductSchema = v.object({
|
|
3872
4005
|
version: v.literal(1),
|
|
3873
4006
|
packageName: v.string(),
|
|
@@ -4010,14 +4143,31 @@ var SWIFTUI_WRAPPER_HOST_PROTOCOLS = new Set(
|
|
|
4010
4143
|
].map((name) => `$s7SwiftUI${name.length}${name}Mp`)
|
|
4011
4144
|
);
|
|
4012
4145
|
|
|
4146
|
+
// src/swift-guest-link.ts
|
|
4147
|
+
var import_node_child_process14 = require("node:child_process");
|
|
4148
|
+
var import_node_fs27 = __toESM(require("node:fs"), 1);
|
|
4149
|
+
var import_node_path27 = __toESM(require("node:path"), 1);
|
|
4150
|
+
var import_node_string_decoder = require("node:string_decoder");
|
|
4151
|
+
|
|
4152
|
+
// src/swift-guest-manifest.ts
|
|
4153
|
+
var import_node_crypto16 = require("node:crypto");
|
|
4154
|
+
var import_node_fs25 = require("node:fs");
|
|
4155
|
+
|
|
4013
4156
|
// src/swift-guest-projection-storage.ts
|
|
4014
4157
|
var maxProjectionRegions = 1 << 20;
|
|
4015
4158
|
|
|
4016
4159
|
// src/swift-guest-runtime-plan.ts
|
|
4017
|
-
var
|
|
4160
|
+
var import_node_crypto18 = require("node:crypto");
|
|
4161
|
+
var import_node_fs26 = require("node:fs");
|
|
4162
|
+
var import_node_path26 = __toESM(require("node:path"), 1);
|
|
4163
|
+
var v4 = __toESM(require("peachsim/vendor/valibot"), 1);
|
|
4164
|
+
|
|
4165
|
+
// src/swift-guest-source-plan.ts
|
|
4166
|
+
var import_node_path25 = __toESM(require("node:path"), 1);
|
|
4018
4167
|
|
|
4019
4168
|
// src/swift-runtime-products.ts
|
|
4020
|
-
var
|
|
4169
|
+
var import_node_crypto17 = require("node:crypto");
|
|
4170
|
+
var v3 = __toESM(require("peachsim/vendor/valibot"), 1);
|
|
4021
4171
|
var packageSchema = v3.object({
|
|
4022
4172
|
name: v3.string(),
|
|
4023
4173
|
products: v3.array(
|
|
@@ -4037,9 +4187,17 @@ var packageSchema = v3.object({
|
|
|
4037
4187
|
)
|
|
4038
4188
|
});
|
|
4039
4189
|
|
|
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
|
+
|
|
4040
4196
|
// src/wasm-optimize.ts
|
|
4041
|
-
var
|
|
4042
|
-
var
|
|
4197
|
+
var import_node_child_process16 = require("node:child_process");
|
|
4198
|
+
var import_node_fs29 = require("node:fs");
|
|
4199
|
+
var import_node_path29 = require("node:path");
|
|
4200
|
+
var import_node_util2 = require("node:util");
|
|
4043
4201
|
|
|
4044
4202
|
// src/binaryen.lock.json
|
|
4045
4203
|
var binaryen_lock_default = {
|
|
@@ -4081,14 +4239,28 @@ var FEATURES = [
|
|
|
4081
4239
|
var KEEP_WASM_NAMES = process.env.PEACH_SWIFT_NAMES === "1";
|
|
4082
4240
|
var LOWERING = ["--memory64-lowering", "--table64-lowering"];
|
|
4083
4241
|
var BINARYEN_VERSION = binaryen_lock_default.version;
|
|
4084
|
-
var runBinaryen = (0,
|
|
4242
|
+
var runBinaryen = (0, import_node_util2.promisify)(import_node_child_process16.execFile);
|
|
4085
4243
|
var WASM_LOWER_IDENTITY = `binaryen ${BINARYEN_VERSION} narrow ${LOWERING.join(" ")} ${FEATURES.join(",")} unoptimized-names`;
|
|
4086
4244
|
var BINARYEN_RELEASES = new Map(Object.entries(binaryen_lock_default.platforms));
|
|
4087
4245
|
|
|
4246
|
+
// src/swift-header-compiler.ts
|
|
4247
|
+
var import_node_crypto20 = require("node:crypto");
|
|
4248
|
+
var import_node_fs31 = require("node:fs");
|
|
4249
|
+
var import_node_http = require("node:http");
|
|
4250
|
+
var import_node_path31 = __toESM(require("node:path"), 1);
|
|
4251
|
+
|
|
4252
|
+
// src/swift-header-dependencies.ts
|
|
4253
|
+
var import_node_path32 = __toESM(require("node:path"), 1);
|
|
4254
|
+
|
|
4088
4255
|
// src/swift-icu.ts
|
|
4089
|
-
var
|
|
4090
|
-
var
|
|
4091
|
-
var
|
|
4256
|
+
var import_node_child_process18 = require("node:child_process");
|
|
4257
|
+
var import_node_crypto21 = require("node:crypto");
|
|
4258
|
+
var import_node_fs32 = require("node:fs");
|
|
4259
|
+
var import_promises5 = require("node:fs/promises");
|
|
4260
|
+
var import_node_os8 = __toESM(require("node:os"), 1);
|
|
4261
|
+
var import_node_path33 = __toESM(require("node:path"), 1);
|
|
4262
|
+
var import_node_util3 = require("node:util");
|
|
4263
|
+
var import_node_zlib3 = require("node:zlib");
|
|
4092
4264
|
|
|
4093
4265
|
// ../sootsim-swift/src/icuData.ts
|
|
4094
4266
|
var PACK_BYTES = 64 * 1024;
|
|
@@ -4096,10 +4268,38 @@ var VERSION = 1;
|
|
|
4096
4268
|
var SWIFT_ICU_PACKED = `picu${VERSION}`;
|
|
4097
4269
|
|
|
4098
4270
|
// src/swift-icu.ts
|
|
4099
|
-
var run = (0,
|
|
4100
|
-
var deflate = (0,
|
|
4101
|
-
var compressBrotli = (0,
|
|
4102
|
-
var inflateGzip = (0,
|
|
4271
|
+
var run = (0, import_node_util3.promisify)(import_node_child_process18.execFile);
|
|
4272
|
+
var deflate = (0, import_node_util3.promisify)(import_node_zlib3.gzip);
|
|
4273
|
+
var compressBrotli = (0, import_node_util3.promisify)(import_node_zlib3.brotliCompress);
|
|
4274
|
+
var inflateGzip = (0, import_node_util3.promisify)(import_node_zlib3.gunzip);
|
|
4275
|
+
|
|
4276
|
+
// src/swift-link-roots.ts
|
|
4277
|
+
var import_node_fs33 = __toESM(require("node:fs"), 1);
|
|
4278
|
+
var import_node_path34 = __toESM(require("node:path"), 1);
|
|
4279
|
+
|
|
4280
|
+
// src/swift-project-user.ts
|
|
4281
|
+
var import_node_child_process19 = require("node:child_process");
|
|
4282
|
+
var import_node_fs34 = require("node:fs");
|
|
4283
|
+
var import_node_path35 = __toESM(require("node:path"), 1);
|
|
4284
|
+
|
|
4285
|
+
// src/swift-reproducible.ts
|
|
4286
|
+
var import_node_fs35 = require("node:fs");
|
|
4287
|
+
var import_node_os9 = __toESM(require("node:os"), 1);
|
|
4288
|
+
|
|
4289
|
+
// src/swift-root-lock.ts
|
|
4290
|
+
var import_node_child_process20 = require("node:child_process");
|
|
4291
|
+
var import_node_crypto22 = require("node:crypto");
|
|
4292
|
+
var import_node_fs36 = require("node:fs");
|
|
4293
|
+
var import_node_os10 = require("node:os");
|
|
4294
|
+
var import_node_path36 = __toESM(require("node:path"), 1);
|
|
4295
|
+
|
|
4296
|
+
// src/swift-uniform-type-constants.ts
|
|
4297
|
+
var import_node_child_process21 = require("node:child_process");
|
|
4298
|
+
var import_node_path37 = __toESM(require("node:path"), 1);
|
|
4299
|
+
|
|
4300
|
+
// src/xcode-header-search.ts
|
|
4301
|
+
var import_node_fs37 = __toESM(require("node:fs"), 1);
|
|
4302
|
+
var import_node_path38 = __toESM(require("node:path"), 1);
|
|
4103
4303
|
|
|
4104
4304
|
// src/swift-compile.ts
|
|
4105
4305
|
var OPTIONAL_FRAMEWORK_DEPENDENCIES = {
|
|
@@ -4222,6 +4422,8 @@ var SHARED_ARTIFACT_BUDGET_BYTES = 4 * 1024 ** 3;
|
|
|
4222
4422
|
|
|
4223
4423
|
// src/answeredNativePackages.ts
|
|
4224
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");
|
|
4225
4427
|
|
|
4226
4428
|
// src/launchMetadataContract.ts
|
|
4227
4429
|
var LAUNCH_METADATA_KEYS_PATH = "node/launch-metadata-keys.json";
|
|
@@ -4245,6 +4447,11 @@ var LAUNCH_METADATA_KEYS = [
|
|
|
4245
4447
|
];
|
|
4246
4448
|
var LAUNCH_METADATA_KEYS_BEFORE_RUNTIME_STATED_THEM = LAUNCH_METADATA_KEYS.filter((key) => key !== "widgetExtension");
|
|
4247
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
|
+
|
|
4248
4455
|
// src/answeredNativePackages.ts
|
|
4249
4456
|
var runtimeLaunchMetadataKeysFile = {
|
|
4250
4457
|
path: LAUNCH_METADATA_KEYS_PATH,
|
|
@@ -4254,12 +4461,17 @@ var runtimeLaunchMetadataKeysFile = {
|
|
|
4254
4461
|
var unansweredStore = new import_node_async_hooks.AsyncLocalStorage();
|
|
4255
4462
|
var answeredStore = new import_node_async_hooks.AsyncLocalStorage();
|
|
4256
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
|
+
|
|
4257
4469
|
// src/swift-package-manifest.ts
|
|
4258
|
-
var cacheDir3 =
|
|
4259
|
-
var execFileAsync = (0,
|
|
4470
|
+
var cacheDir3 = import_node_path43.default.join(cacheDir(), "swift-manifests");
|
|
4471
|
+
var execFileAsync = (0, import_node_util4.promisify)(import_node_child_process23.execFile);
|
|
4260
4472
|
|
|
4261
4473
|
// src/xcode-json-project.ts
|
|
4262
|
-
var
|
|
4474
|
+
var import_node_path44 = __toESM(require("node:path"), 1);
|
|
4263
4475
|
var import_json5 = __toESM(require_lib(), 1);
|
|
4264
4476
|
var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
4265
4477
|
var text = (value) => typeof value === "string" ? value : void 0;
|
|
@@ -4317,7 +4529,7 @@ var PHASE_ISA = {
|
|
|
4317
4529
|
function readXcodeJsonProject(xcodeproj, source) {
|
|
4318
4530
|
const json = import_json5.default.parse(source);
|
|
4319
4531
|
if (!isJsonObject(json)) throw new Error(`${xcodeproj}/project.xcproj is not an object`);
|
|
4320
|
-
const projectDir =
|
|
4532
|
+
const projectDir = import_node_path44.default.dirname(xcodeproj);
|
|
4321
4533
|
const objects = {};
|
|
4322
4534
|
let next = 0;
|
|
4323
4535
|
const add = (entry, id) => {
|
|
@@ -4330,7 +4542,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
4330
4542
|
const base = /^<([A-Z]+)>\/(.*)$/.exec(raw);
|
|
4331
4543
|
if (base) {
|
|
4332
4544
|
if (base[1] === "PROJECT")
|
|
4333
|
-
return { sourceTree: "<absolute>", path:
|
|
4545
|
+
return { sourceTree: "<absolute>", path: import_node_path44.default.join(projectDir, base[2]) };
|
|
4334
4546
|
if (base[1] === "PRODUCTS")
|
|
4335
4547
|
return { sourceTree: "BUILT_PRODUCTS_DIR", path: base[2] };
|
|
4336
4548
|
return null;
|
|
@@ -4338,7 +4550,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
4338
4550
|
const unescaped = raw.replaceAll("\\<", "<");
|
|
4339
4551
|
if (unescaped.startsWith("/")) return { sourceTree: "<absolute>", path: unescaped };
|
|
4340
4552
|
if (unescaped.startsWith("~")) return null;
|
|
4341
|
-
return groupDir === null ? null : { sourceTree: "<absolute>", path:
|
|
4553
|
+
return groupDir === null ? null : { sourceTree: "<absolute>", path: import_node_path44.default.join(groupDir, unescaped) };
|
|
4342
4554
|
};
|
|
4343
4555
|
const memberships = [];
|
|
4344
4556
|
const folders = [];
|
|
@@ -4349,7 +4561,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
4349
4561
|
const kind = text(entry.kind) ?? "file-reference";
|
|
4350
4562
|
const raw = text(entry.path) ?? "";
|
|
4351
4563
|
const located = raw === "" ? null : locate(raw, parent.dir);
|
|
4352
|
-
const name = text(entry.name) ??
|
|
4564
|
+
const name = text(entry.name) ?? import_node_path44.default.basename(raw);
|
|
4353
4565
|
const node = { id: "", name, dir: null, parent, children: [] };
|
|
4354
4566
|
if (kind === "group" || kind === "variant-group" || kind === "version-group") {
|
|
4355
4567
|
node.dir = raw === "" ? parent.dir : located?.sourceTree === "<absolute>" ? located.path : null;
|
|
@@ -4453,14 +4665,14 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
4453
4665
|
const reference = specialized.has(name) ? specialized.get(name) : file;
|
|
4454
4666
|
const base = lookup(reference);
|
|
4455
4667
|
const anchor = isObject(reference) ? lookupNode(reference.anchor, root)?.id : null;
|
|
4456
|
-
const
|
|
4668
|
+
const relative2 = isObject(reference) ? text(reference["relative-path"]) : null;
|
|
4457
4669
|
return add({
|
|
4458
4670
|
isa: "XCBuildConfiguration",
|
|
4459
4671
|
name,
|
|
4460
4672
|
buildSettings: settings,
|
|
4461
|
-
...base ? { baseConfigurationReference: base } : anchor &&
|
|
4673
|
+
...base ? { baseConfigurationReference: base } : anchor && relative2 ? {
|
|
4462
4674
|
baseConfigurationReferenceAnchor: anchor,
|
|
4463
|
-
baseConfigurationReferenceRelativePath:
|
|
4675
|
+
baseConfigurationReferenceRelativePath: relative2
|
|
4464
4676
|
} : {}
|
|
4465
4677
|
});
|
|
4466
4678
|
})
|
|
@@ -4470,7 +4682,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
4470
4682
|
if (!isObject(entry)) continue;
|
|
4471
4683
|
const repository = text(entry.repository);
|
|
4472
4684
|
const local = text(entry.path);
|
|
4473
|
-
const name = local !== void 0 ?
|
|
4685
|
+
const name = local !== void 0 ? import_node_path44.default.basename(import_node_path44.default.resolve(import_node_path44.default.dirname(xcodeproj), local)) : import_node_path44.default.basename(repository ?? "").replace(/\.git$/, "");
|
|
4474
4686
|
const id = text(entry.kind) === "local" && local !== void 0 ? add({ isa: "XCLocalSwiftPackageReference", relativePath: local }) : add({
|
|
4475
4687
|
isa: "XCRemoteSwiftPackageReference",
|
|
4476
4688
|
repositoryURL: repository ?? "",
|
|
@@ -4691,28 +4903,28 @@ var CONDITIONS = {
|
|
|
4691
4903
|
variant: "normal"
|
|
4692
4904
|
};
|
|
4693
4905
|
function walkFiles(dir) {
|
|
4694
|
-
if (!
|
|
4906
|
+
if (!import_node_fs43.default.existsSync(dir)) return [];
|
|
4695
4907
|
const out = [];
|
|
4696
|
-
for (const entry of
|
|
4908
|
+
for (const entry of import_node_fs43.default.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name))) {
|
|
4697
4909
|
if (entry.name.startsWith(".")) continue;
|
|
4698
|
-
const full =
|
|
4910
|
+
const full = import_node_path45.default.join(dir, entry.name);
|
|
4699
4911
|
if (entry.isDirectory()) out.push(...walkFiles(full));
|
|
4700
4912
|
else if (entry.isFile()) out.push(full);
|
|
4701
4913
|
}
|
|
4702
4914
|
return out;
|
|
4703
4915
|
}
|
|
4704
|
-
var isDirectory = (dir) =>
|
|
4916
|
+
var isDirectory = (dir) => import_node_fs43.default.existsSync(dir) && import_node_fs43.default.statSync(dir).isDirectory();
|
|
4705
4917
|
function readXcconfig(file, read) {
|
|
4706
|
-
if (read.includes(file) || !
|
|
4918
|
+
if (read.includes(file) || !import_node_fs43.default.existsSync(file)) return {};
|
|
4707
4919
|
read.push(file);
|
|
4708
4920
|
const settings = {};
|
|
4709
|
-
for (const raw of
|
|
4921
|
+
for (const raw of import_node_fs43.default.readFileSync(file, "utf8").split("\n")) {
|
|
4710
4922
|
const line = raw.replace(/\/\/.*$/, "").trim();
|
|
4711
4923
|
const include = /^#include\??\s+"([^"]+)"/.exec(line);
|
|
4712
4924
|
if (include) {
|
|
4713
4925
|
Object.assign(
|
|
4714
4926
|
settings,
|
|
4715
|
-
readXcconfig(
|
|
4927
|
+
readXcconfig(import_node_path45.default.resolve(import_node_path45.default.dirname(file), include[1]), read)
|
|
4716
4928
|
);
|
|
4717
4929
|
continue;
|
|
4718
4930
|
}
|
|
@@ -4757,8 +4969,8 @@ function applyOperator(value, operator) {
|
|
|
4757
4969
|
return value.replace(/[^A-Za-z0-9_]/g, "_").replace(/^[0-9]/, "_");
|
|
4758
4970
|
case "standardizepath":
|
|
4759
4971
|
if (value === ".") return value;
|
|
4760
|
-
if (
|
|
4761
|
-
return
|
|
4972
|
+
if (import_node_path45.default.posix.isAbsolute(value))
|
|
4973
|
+
return import_node_path45.default.posix.normalize(value).replace(/(?<=.)\/$/, "");
|
|
4762
4974
|
return value.split("/").filter((component) => component !== "" && component !== ".").join("/");
|
|
4763
4975
|
}
|
|
4764
4976
|
throw new Error(`unsupported build setting operator :${operator}`);
|
|
@@ -4767,22 +4979,22 @@ function decodeXml(text2) {
|
|
|
4767
4979
|
return text2.replaceAll(""", '"').replaceAll("'", "'").replaceAll("<", "<").replaceAll(">", ">").replaceAll("&", "&");
|
|
4768
4980
|
}
|
|
4769
4981
|
function workspaceReferences(workspace) {
|
|
4770
|
-
const data =
|
|
4771
|
-
if (!
|
|
4982
|
+
const data = import_node_path45.default.join(workspace, "contents.xcworkspacedata");
|
|
4983
|
+
if (!import_node_fs43.default.existsSync(data))
|
|
4772
4984
|
throw new Error(`${workspace} has no contents.xcworkspacedata`);
|
|
4773
|
-
const container =
|
|
4985
|
+
const container = import_node_path45.default.dirname(workspace);
|
|
4774
4986
|
const locate = (location, base) => {
|
|
4775
4987
|
const colon = location.indexOf(":");
|
|
4776
4988
|
const kind = location.slice(0, colon);
|
|
4777
4989
|
const rest = location.slice(colon + 1);
|
|
4778
|
-
if (kind === "group") return
|
|
4779
|
-
if (kind === "container" || kind === "self") return
|
|
4780
|
-
if (kind === "absolute") return
|
|
4781
|
-
throw new Error(`${
|
|
4990
|
+
if (kind === "group") return import_node_path45.default.resolve(base, rest);
|
|
4991
|
+
if (kind === "container" || kind === "self") return import_node_path45.default.resolve(container, rest);
|
|
4992
|
+
if (kind === "absolute") return import_node_path45.default.resolve(rest);
|
|
4993
|
+
throw new Error(`${import_node_path45.default.basename(workspace)} has an unsupported location ${location}`);
|
|
4782
4994
|
};
|
|
4783
4995
|
const groups = [container];
|
|
4784
4996
|
const references = [];
|
|
4785
|
-
for (const [, closing, tag, attributes, selfClosing] of
|
|
4997
|
+
for (const [, closing, tag, attributes, selfClosing] of import_node_fs43.default.readFileSync(data, "utf8").matchAll(/<(\/?)(Group|FileRef)\b([^>]*?)(\/?)>/g)) {
|
|
4786
4998
|
if (closing) {
|
|
4787
4999
|
if (tag === "Group") groups.pop();
|
|
4788
5000
|
continue;
|
|
@@ -4833,8 +5045,8 @@ function remotePackageRequirements(projects) {
|
|
|
4833
5045
|
var loaded = /* @__PURE__ */ new Map();
|
|
4834
5046
|
function xcodeProjectFile(xcodeproj) {
|
|
4835
5047
|
for (const name of ["project.pbxproj", "project.xcproj"]) {
|
|
4836
|
-
const file =
|
|
4837
|
-
if (
|
|
5048
|
+
const file = import_node_path45.default.join(xcodeproj, name);
|
|
5049
|
+
if (import_node_fs43.default.existsSync(file)) return file;
|
|
4838
5050
|
}
|
|
4839
5051
|
return null;
|
|
4840
5052
|
}
|
|
@@ -4842,8 +5054,8 @@ function loadProject(xcodeproj) {
|
|
|
4842
5054
|
const projectFile = xcodeProjectFile(xcodeproj);
|
|
4843
5055
|
if (!projectFile)
|
|
4844
5056
|
throw new Error(`${xcodeproj} has no project.pbxproj or project.xcproj`);
|
|
4845
|
-
const source =
|
|
4846
|
-
const digest = (0,
|
|
5057
|
+
const source = import_node_fs43.default.readFileSync(projectFile, "utf8");
|
|
5058
|
+
const digest = (0, import_node_crypto26.createHash)("sha256").update(source).digest("hex");
|
|
4847
5059
|
const cached = loaded.get(projectFile);
|
|
4848
5060
|
if (cached?.digest === digest) return cached.project;
|
|
4849
5061
|
const root = projectFile.endsWith(".xcproj") ? readXcodeJsonProject(xcodeproj, source) : parseOpenStepPlist(source);
|
|
@@ -4859,10 +5071,10 @@ function loadProject(xcodeproj) {
|
|
|
4859
5071
|
if (!project || project.isa !== "PBXProject") {
|
|
4860
5072
|
throw new Error(`${projectFile} has no PBXProject root`);
|
|
4861
5073
|
}
|
|
4862
|
-
const projectDir =
|
|
4863
|
-
|
|
5074
|
+
const projectDir = import_node_fs43.default.realpathSync.native(
|
|
5075
|
+
import_node_path45.default.resolve(import_node_path45.default.dirname(xcodeproj), str(project.projectDirPath) ?? "")
|
|
4864
5076
|
);
|
|
4865
|
-
const resolvePath = xcodePathResolver(objects, projectDir,
|
|
5077
|
+
const resolvePath = xcodePathResolver(objects, projectDir, import_node_path45.default.join);
|
|
4866
5078
|
const result = {
|
|
4867
5079
|
xcodeproj,
|
|
4868
5080
|
projectFile,
|
|
@@ -4880,7 +5092,7 @@ var developerDir;
|
|
|
4880
5092
|
function selectedDeveloperDir() {
|
|
4881
5093
|
developerDir ??= process.platform === "darwin" ? (
|
|
4882
5094
|
// runner-toolchain-platform: darwin
|
|
4883
|
-
(0,
|
|
5095
|
+
(0, import_node_child_process24.execFileSync)("xcode-select", ["-p"], {
|
|
4884
5096
|
encoding: "utf8",
|
|
4885
5097
|
stdio: ["ignore", "pipe", "pipe"]
|
|
4886
5098
|
}).trim()
|
|
@@ -4907,13 +5119,13 @@ function targetSettings(ref, configuration, builtins, options = {}, overrides =
|
|
|
4907
5119
|
const name = str(config.name) ?? configuration;
|
|
4908
5120
|
const base = str(config.baseConfigurationReference);
|
|
4909
5121
|
const anchor = str(config.baseConfigurationReferenceAnchor);
|
|
4910
|
-
const
|
|
5122
|
+
const relative2 = str(config.baseConfigurationReferenceRelativePath);
|
|
4911
5123
|
const own = isDict(config.buildSettings) ? config.buildSettings : {};
|
|
4912
5124
|
const directory = anchor ? project.resolvePath(anchor) : null;
|
|
4913
|
-
const baseFile = base ? project.resolvePath(base) : directory &&
|
|
4914
|
-
if (options.requireSources !== false && (base || anchor ||
|
|
5125
|
+
const baseFile = base ? project.resolvePath(base) : directory && relative2 ? import_node_path45.default.resolve(directory, relative2) : null;
|
|
5126
|
+
if (options.requireSources !== false && (base || anchor || relative2) && (!baseFile || !import_node_fs43.default.existsSync(baseFile)))
|
|
4915
5127
|
throw new Error(
|
|
4916
|
-
`Unable to open base configuration reference file '${baseFile ?? base ??
|
|
5128
|
+
`Unable to open base configuration reference file '${baseFile ?? base ?? relative2 ?? anchor}'`
|
|
4917
5129
|
);
|
|
4918
5130
|
const read = [];
|
|
4919
5131
|
const fromFile = baseFile ? readXcconfig(baseFile, read) : {};
|
|
@@ -5002,26 +5214,26 @@ function scriptCommand(shell, script) {
|
|
|
5002
5214
|
return [executable, ...args, "-c", script];
|
|
5003
5215
|
}
|
|
5004
5216
|
function expandSearchPath(directory, rules2) {
|
|
5005
|
-
if (
|
|
5217
|
+
if (import_node_path45.default.basename(directory) !== "**") return [directory];
|
|
5006
5218
|
const expanded = [];
|
|
5007
5219
|
const seen = /* @__PURE__ */ new Set();
|
|
5008
|
-
const queue = [
|
|
5220
|
+
const queue = [import_node_path45.default.dirname(directory)];
|
|
5009
5221
|
for (let at = 0; at < queue.length; at++) {
|
|
5010
5222
|
const current = queue[at];
|
|
5011
5223
|
let real;
|
|
5012
5224
|
try {
|
|
5013
|
-
real =
|
|
5225
|
+
real = import_node_fs43.default.realpathSync.native(current);
|
|
5014
5226
|
} catch {
|
|
5015
5227
|
continue;
|
|
5016
5228
|
}
|
|
5017
|
-
if (!
|
|
5229
|
+
if (!import_node_fs43.default.statSync(real).isDirectory() || seen.has(real)) continue;
|
|
5018
5230
|
seen.add(real);
|
|
5019
5231
|
expanded.push(current);
|
|
5020
|
-
for (const entry of
|
|
5232
|
+
for (const entry of import_node_fs43.default.readdirSync(real, { withFileTypes: true }).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
|
|
5021
5233
|
if (entry.isSymbolicLink() ? !rules2.followLinks : !entry.isDirectory()) continue;
|
|
5022
5234
|
if (rules2.excluded.some((pattern) => pattern.test(entry.name)) && !rules2.included.some((pattern) => pattern.test(entry.name)))
|
|
5023
5235
|
continue;
|
|
5024
|
-
queue.push(
|
|
5236
|
+
queue.push(import_node_path45.default.join(current, entry.name));
|
|
5025
5237
|
}
|
|
5026
5238
|
}
|
|
5027
5239
|
return expanded;
|
|
@@ -5112,7 +5324,7 @@ function shellAssetCatalogs(script, settings, projectDir) {
|
|
|
5112
5324
|
for (const token of tokens) {
|
|
5113
5325
|
if (token.startsWith("-")) break;
|
|
5114
5326
|
const file = resolve(token);
|
|
5115
|
-
if (file?.endsWith(".xcassets")) catalogs.push(
|
|
5327
|
+
if (file?.endsWith(".xcassets")) catalogs.push(import_node_path45.default.resolve(projectDir, file));
|
|
5116
5328
|
}
|
|
5117
5329
|
}
|
|
5118
5330
|
return catalogs;
|
|
@@ -5157,14 +5369,14 @@ function shellCopies(script, settings, projectDir) {
|
|
|
5157
5369
|
if (operands.length !== 2 || operands.some((operand) => operand.startsWith("-")))
|
|
5158
5370
|
return [];
|
|
5159
5371
|
copies.push({
|
|
5160
|
-
from:
|
|
5161
|
-
to:
|
|
5372
|
+
from: import_node_path45.default.resolve(projectDir, operands[0]),
|
|
5373
|
+
to: import_node_path45.default.resolve(projectDir, operands[1])
|
|
5162
5374
|
});
|
|
5163
5375
|
}
|
|
5164
5376
|
return copies;
|
|
5165
5377
|
}
|
|
5166
5378
|
function fileListEntries(file, absolute) {
|
|
5167
|
-
return
|
|
5379
|
+
return import_node_fs43.default.readFileSync(file, "utf8").split(/\r?\n/).map((line) => line.trim()).filter((line) => line !== "" && !line.startsWith("#")).map(absolute);
|
|
5168
5380
|
}
|
|
5169
5381
|
function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
5170
5382
|
const { project, target, id: targetId } = ref;
|
|
@@ -5178,7 +5390,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
5178
5390
|
const copiedFiles = [];
|
|
5179
5391
|
let generatedInfoPlist = false;
|
|
5180
5392
|
const declaredInfoPlist = settings("INFOPLIST_FILE");
|
|
5181
|
-
const infoPlistOutput = declaredInfoPlist ?
|
|
5393
|
+
const infoPlistOutput = declaredInfoPlist ? import_node_path45.default.resolve(project.projectDir, declaredInfoPlist) : null;
|
|
5182
5394
|
const isPreparedOutput = (file) => file === infoPlistOutput || options.requireSources !== false && file.endsWith(".swift");
|
|
5183
5395
|
for (const phaseId of list(target.buildPhases)) {
|
|
5184
5396
|
const phase = project.object(phaseId);
|
|
@@ -5193,7 +5405,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
5193
5405
|
copiedFiles.push(
|
|
5194
5406
|
...shellCopies(str(phase.shellScript) ?? "", settings, project.projectDir)
|
|
5195
5407
|
);
|
|
5196
|
-
const absolute = (raw) =>
|
|
5408
|
+
const absolute = (raw) => import_node_path45.default.resolve(project.projectDir, expand(raw, settings));
|
|
5197
5409
|
const inputs = list(phase.inputPaths).map(absolute);
|
|
5198
5410
|
const outputs = list(phase.outputPaths).map(absolute);
|
|
5199
5411
|
const fileLists = /* @__PURE__ */ new Map();
|
|
@@ -5202,7 +5414,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
5202
5414
|
kind === "INPUT" ? phase.inputFileListPaths : phase.outputFileListPaths
|
|
5203
5415
|
).map((raw) => {
|
|
5204
5416
|
const file = absolute(raw);
|
|
5205
|
-
if (!
|
|
5417
|
+
if (!import_node_fs43.default.existsSync(file)) {
|
|
5206
5418
|
return { file, entries: [] };
|
|
5207
5419
|
}
|
|
5208
5420
|
return { file, entries: fileListEntries(file, absolute) };
|
|
@@ -5223,7 +5435,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
5223
5435
|
...fileLists.get("OUTPUT").map((item) => item.file)
|
|
5224
5436
|
];
|
|
5225
5437
|
if (allOutputs.some((file) => file.endsWith(".swift") || file === infoPlistOutput)) {
|
|
5226
|
-
for (const file of inputFiles) if (
|
|
5438
|
+
for (const file of inputFiles) if (import_node_fs43.default.existsSync(file)) projectInputs.add(file);
|
|
5227
5439
|
}
|
|
5228
5440
|
if (options.prepareGeneratedSources === true && allOutputs.some(isPreparedOutput)) {
|
|
5229
5441
|
const configuration = settings("CONFIGURATION");
|
|
@@ -5236,10 +5448,10 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
5236
5448
|
false
|
|
5237
5449
|
))
|
|
5238
5450
|
continue;
|
|
5239
|
-
const phaseDir =
|
|
5451
|
+
const phaseDir = import_node_path45.default.join(settings("TARGET_TEMP_DIR"), `Script-${phaseId}`);
|
|
5240
5452
|
for (const lists of fileLists.values())
|
|
5241
5453
|
for (const { file } of lists)
|
|
5242
|
-
if (!
|
|
5454
|
+
if (!import_node_fs43.default.existsSync(file))
|
|
5243
5455
|
throw new Error(
|
|
5244
5456
|
`${targetName}: Run Script "${script}" missing file list ${file}`
|
|
5245
5457
|
);
|
|
@@ -5258,25 +5470,25 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
5258
5470
|
const lists = fileLists.get(kind);
|
|
5259
5471
|
env[`SCRIPT_${kind}_FILE_LIST_COUNT`] = String(lists.length);
|
|
5260
5472
|
lists.forEach((_item, index) => {
|
|
5261
|
-
env[`SCRIPT_${kind}_FILE_LIST_${index}`] =
|
|
5473
|
+
env[`SCRIPT_${kind}_FILE_LIST_${index}`] = import_node_path45.default.join(
|
|
5262
5474
|
phaseDir,
|
|
5263
5475
|
`${kind}-${index}.xcfilelist`
|
|
5264
5476
|
);
|
|
5265
5477
|
});
|
|
5266
5478
|
}
|
|
5267
|
-
const signature = (0,
|
|
5479
|
+
const signature = (0, import_node_crypto26.createHash)("sha256").update(
|
|
5268
5480
|
JSON.stringify([phase, [...settingKeys].map((key2) => [key2, settings(key2)])])
|
|
5269
5481
|
);
|
|
5270
5482
|
for (const file of inputFiles) {
|
|
5271
5483
|
signature.update(file);
|
|
5272
|
-
if (
|
|
5273
|
-
const stat =
|
|
5484
|
+
if (import_node_fs43.default.existsSync(file)) {
|
|
5485
|
+
const stat = import_node_fs43.default.statSync(file);
|
|
5274
5486
|
signature.update(`${stat.mtimeMs}:${stat.ctimeMs}:${stat.size}`);
|
|
5275
5487
|
} else signature.update("missing");
|
|
5276
5488
|
}
|
|
5277
5489
|
const stamp = signature.digest("hex");
|
|
5278
5490
|
const key = `${project.projectFile}:${targetId}:${phaseId}:${settings("CONFIGURATION")}`;
|
|
5279
|
-
if (preparedSourcePhases.get(key) === stamp && allOutputs.every((file) =>
|
|
5491
|
+
if (preparedSourcePhases.get(key) === stamp && allOutputs.every((file) => import_node_fs43.default.existsSync(file))) {
|
|
5280
5492
|
preparedXcodePhase(
|
|
5281
5493
|
project.projectFile,
|
|
5282
5494
|
targetId,
|
|
@@ -5287,14 +5499,14 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
5287
5499
|
);
|
|
5288
5500
|
continue;
|
|
5289
5501
|
}
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5502
|
+
import_node_fs43.default.mkdirSync(phaseDir, { recursive: true });
|
|
5503
|
+
import_node_fs43.default.mkdirSync(settings("BUILT_PRODUCTS_DIR"), { recursive: true });
|
|
5504
|
+
import_node_fs43.default.mkdirSync(settings("DERIVED_FILE_DIR"), { recursive: true });
|
|
5293
5505
|
for (const output2 of allOutputs)
|
|
5294
|
-
|
|
5506
|
+
import_node_fs43.default.mkdirSync(import_node_path45.default.dirname(output2), { recursive: true });
|
|
5295
5507
|
for (const [kind, lists] of fileLists)
|
|
5296
5508
|
lists.forEach((item, index) => {
|
|
5297
|
-
|
|
5509
|
+
import_node_fs43.default.writeFileSync(
|
|
5298
5510
|
env[`SCRIPT_${kind}_FILE_LIST_${index}`],
|
|
5299
5511
|
`${item.entries.join("\n")}
|
|
5300
5512
|
`
|
|
@@ -5302,9 +5514,9 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
5302
5514
|
});
|
|
5303
5515
|
const rawScript = str(phase.shellScript) ?? "";
|
|
5304
5516
|
if (rawScript.includes("generate-modules-provider")) {
|
|
5305
|
-
const preloadPath =
|
|
5306
|
-
|
|
5307
|
-
|
|
5517
|
+
const preloadPath = import_node_path45.default.join(phaseDir, "expo-scan-timeout.cjs");
|
|
5518
|
+
import_node_fs43.default.mkdirSync(phaseDir, { recursive: true });
|
|
5519
|
+
import_node_fs43.default.writeFileSync(
|
|
5308
5520
|
preloadPath,
|
|
5309
5521
|
[
|
|
5310
5522
|
"const cp = require('node:child_process');",
|
|
@@ -5326,7 +5538,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
5326
5538
|
str(phase.shellPath) ?? "/bin/sh",
|
|
5327
5539
|
rawScript
|
|
5328
5540
|
);
|
|
5329
|
-
(0,
|
|
5541
|
+
(0, import_node_child_process24.execFileSync)(shell, args, {
|
|
5330
5542
|
cwd: project.projectDir,
|
|
5331
5543
|
env,
|
|
5332
5544
|
stdio: ["ignore", "pipe", "pipe"],
|
|
@@ -5342,7 +5554,7 @@ ${output2}`
|
|
|
5342
5554
|
);
|
|
5343
5555
|
}
|
|
5344
5556
|
const missing = allOutputs.filter(
|
|
5345
|
-
(file) => file === infoPlistOutput && !
|
|
5557
|
+
(file) => file === infoPlistOutput && !import_node_fs43.default.existsSync(file)
|
|
5346
5558
|
);
|
|
5347
5559
|
if (missing.length > 0)
|
|
5348
5560
|
throw new Error(
|
|
@@ -5361,9 +5573,9 @@ ${output2}`
|
|
|
5361
5573
|
}
|
|
5362
5574
|
project.visitMembers(
|
|
5363
5575
|
targetId,
|
|
5364
|
-
xcodePathResolver(project.objects, project.projectDir,
|
|
5365
|
-
(file) => isDirectory(file) ? walkFiles(file) :
|
|
5366
|
-
|
|
5576
|
+
xcodePathResolver(project.objects, project.projectDir, import_node_path45.default.join, settings),
|
|
5577
|
+
(file) => isDirectory(file) ? walkFiles(file) : import_node_fs43.default.existsSync(file) ? [file] : [],
|
|
5578
|
+
import_node_path45.default.join,
|
|
5367
5579
|
(file, kind, bundleName) => {
|
|
5368
5580
|
if (kind === "header") {
|
|
5369
5581
|
headers.add(file);
|
|
@@ -5374,9 +5586,9 @@ ${output2}`
|
|
|
5374
5586
|
if (bundleName) resourceNames[file] = bundleName;
|
|
5375
5587
|
return;
|
|
5376
5588
|
}
|
|
5377
|
-
if (!
|
|
5589
|
+
if (!import_node_fs43.default.existsSync(file)) {
|
|
5378
5590
|
if (options.requireSources === false) return;
|
|
5379
|
-
const script = scriptForOutput.get(
|
|
5591
|
+
const script = scriptForOutput.get(import_node_path45.default.normalize(file));
|
|
5380
5592
|
throw new Error(
|
|
5381
5593
|
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}`
|
|
5382
5594
|
);
|
|
@@ -5387,17 +5599,17 @@ ${output2}`
|
|
|
5387
5599
|
);
|
|
5388
5600
|
if (options.prepareGeneratedSources && options.requireSources !== false) {
|
|
5389
5601
|
const interfaceFiles = [...resources].filter(
|
|
5390
|
-
(file) => /\.(storyboard|xib)$/.test(file) && !file.split(
|
|
5602
|
+
(file) => /\.(storyboard|xib)$/.test(file) && !file.split(import_node_path45.default.sep).some((part) => part.endsWith(".bundle"))
|
|
5391
5603
|
);
|
|
5392
5604
|
if (process.platform !== "darwin") {
|
|
5393
5605
|
let launchName = settings("INFOPLIST_KEY_UILaunchStoryboardName");
|
|
5394
|
-
if (!launchName && infoPlistOutput &&
|
|
5395
|
-
const info = import_plist3.default.parse(
|
|
5606
|
+
if (!launchName && infoPlistOutput && import_node_fs43.default.existsSync(infoPlistOutput)) {
|
|
5607
|
+
const info = import_plist3.default.parse(import_node_fs43.default.readFileSync(infoPlistOutput, "utf8"));
|
|
5396
5608
|
const declared = isRecord(info) ? info.UILaunchStoryboardName : void 0;
|
|
5397
5609
|
if (typeof declared === "string") launchName = expand(declared, settings);
|
|
5398
5610
|
}
|
|
5399
5611
|
const runtimeInterfaceFiles = interfaceFiles.filter(
|
|
5400
|
-
(file) =>
|
|
5612
|
+
(file) => import_node_path45.default.basename(file, import_node_path45.default.extname(file)) !== launchName
|
|
5401
5613
|
);
|
|
5402
5614
|
if (runtimeInterfaceFiles.length > 0)
|
|
5403
5615
|
throw new Error(
|
|
@@ -5408,13 +5620,13 @@ ${output2}`
|
|
|
5408
5620
|
}
|
|
5409
5621
|
const interfaceOutputs = /* @__PURE__ */ new Set();
|
|
5410
5622
|
for (const file of interfaceFiles) {
|
|
5411
|
-
const localization = file.split(
|
|
5623
|
+
const localization = file.split(import_node_path45.default.sep).findLast((part) => part.endsWith(".lproj")) ?? "";
|
|
5412
5624
|
const extension = file.endsWith(".storyboard") ? ".storyboardc" : ".nib";
|
|
5413
|
-
const output2 =
|
|
5625
|
+
const output2 = import_node_path45.default.join(
|
|
5414
5626
|
settings("DERIVED_FILE_DIR"),
|
|
5415
5627
|
"InterfaceBuilder",
|
|
5416
5628
|
localization,
|
|
5417
|
-
|
|
5629
|
+
import_node_path45.default.basename(file, import_node_path45.default.extname(file)) + extension
|
|
5418
5630
|
);
|
|
5419
5631
|
if (interfaceOutputs.has(output2))
|
|
5420
5632
|
throw new Error(`${targetName}: duplicate Interface Builder output ${output2}`);
|
|
@@ -5436,18 +5648,18 @@ ${output2}`
|
|
|
5436
5648
|
const inputs = JSON.stringify({
|
|
5437
5649
|
args,
|
|
5438
5650
|
developer: settings("DEVELOPER_DIR"),
|
|
5439
|
-
source: (0,
|
|
5651
|
+
source: (0, import_node_crypto26.createHash)("sha256").update(import_node_fs43.default.readFileSync(file)).digest("hex")
|
|
5440
5652
|
});
|
|
5441
|
-
if (!
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
(0,
|
|
5653
|
+
if (!import_node_fs43.default.existsSync(output2) || !import_node_fs43.default.existsSync(stamp) || import_node_fs43.default.readFileSync(stamp, "utf8") !== inputs) {
|
|
5654
|
+
import_node_fs43.default.rmSync(output2, { recursive: true, force: true });
|
|
5655
|
+
import_node_fs43.default.rmSync(stamp, { force: true });
|
|
5656
|
+
import_node_fs43.default.mkdirSync(import_node_path45.default.dirname(output2), { recursive: true });
|
|
5657
|
+
(0, import_node_child_process24.execFileSync)("xcrun", args, {
|
|
5446
5658
|
cwd: project.projectDir,
|
|
5447
5659
|
stdio: ["ignore", "pipe", "pipe"],
|
|
5448
5660
|
timeout: runScriptTimeoutMs
|
|
5449
5661
|
});
|
|
5450
|
-
|
|
5662
|
+
import_node_fs43.default.writeFileSync(stamp, inputs);
|
|
5451
5663
|
}
|
|
5452
5664
|
projectInputs.add(file);
|
|
5453
5665
|
resources.delete(file);
|
|
@@ -5464,13 +5676,13 @@ ${output2}`
|
|
|
5464
5676
|
for (const definition of definitions) {
|
|
5465
5677
|
const configuredLanguage = settings("INTENTS_CODEGEN_LANGUAGE");
|
|
5466
5678
|
const language = !configuredLanguage || configuredLanguage === "Automatic" ? sources.size > 0 ? "Swift" : "Objective-C" : configuredLanguage;
|
|
5467
|
-
const output2 =
|
|
5679
|
+
const output2 = import_node_path45.default.join(
|
|
5468
5680
|
settings("DERIVED_FILE_DIR"),
|
|
5469
5681
|
"IntentDefinitionGenerated",
|
|
5470
|
-
|
|
5682
|
+
import_node_path45.default.basename(definition, ".intentdefinition")
|
|
5471
5683
|
);
|
|
5472
|
-
|
|
5473
|
-
|
|
5684
|
+
import_node_fs43.default.rmSync(output2, { recursive: true, force: true });
|
|
5685
|
+
import_node_fs43.default.mkdirSync(output2, { recursive: true });
|
|
5474
5686
|
const args = [
|
|
5475
5687
|
"intentbuilderc",
|
|
5476
5688
|
"generate",
|
|
@@ -5489,20 +5701,20 @@ ${output2}`
|
|
|
5489
5701
|
args.push("-swiftVersion", settings("SWIFT_VERSION") || "5.0");
|
|
5490
5702
|
if (settings("DEFINES_MODULE") === "YES")
|
|
5491
5703
|
args.push("-moduleName", settings("PRODUCT_MODULE_NAME"));
|
|
5492
|
-
(0,
|
|
5704
|
+
(0, import_node_child_process24.execFileSync)("xcrun", args, {
|
|
5493
5705
|
cwd: project.projectDir,
|
|
5494
5706
|
stdio: ["ignore", "pipe", "pipe"],
|
|
5495
5707
|
timeout: runScriptTimeoutMs
|
|
5496
5708
|
});
|
|
5497
|
-
const compiled =
|
|
5709
|
+
const compiled = import_node_path45.default.join(
|
|
5498
5710
|
settings("DERIVED_FILE_DIR"),
|
|
5499
5711
|
"IntentDefinitionCompiled",
|
|
5500
|
-
definition.split(
|
|
5712
|
+
definition.split(import_node_path45.default.sep).findLast((part) => part.endsWith(".lproj")) ?? ""
|
|
5501
5713
|
);
|
|
5502
|
-
const compiledDefinition =
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
(0,
|
|
5714
|
+
const compiledDefinition = import_node_path45.default.join(compiled, import_node_path45.default.basename(definition));
|
|
5715
|
+
import_node_fs43.default.rmSync(compiledDefinition, { force: true });
|
|
5716
|
+
import_node_fs43.default.mkdirSync(compiled, { recursive: true });
|
|
5717
|
+
(0, import_node_child_process24.execFileSync)(
|
|
5506
5718
|
"xcrun",
|
|
5507
5719
|
[
|
|
5508
5720
|
"intentbuilderc",
|
|
@@ -5542,37 +5754,37 @@ ${output2}`
|
|
|
5542
5754
|
function commonAncestor(dirs) {
|
|
5543
5755
|
let common = dirs[0];
|
|
5544
5756
|
for (const dir of dirs) {
|
|
5545
|
-
while (common !==
|
|
5546
|
-
common =
|
|
5757
|
+
while (common !== import_node_path45.default.dirname(common) && import_node_path45.default.relative(common, dir).startsWith(".."))
|
|
5758
|
+
common = import_node_path45.default.dirname(common);
|
|
5547
5759
|
}
|
|
5548
5760
|
return common;
|
|
5549
5761
|
}
|
|
5550
|
-
var isPodsProject = (xcodeproj) =>
|
|
5762
|
+
var isPodsProject = (xcodeproj) => import_node_path45.default.basename(xcodeproj) === "Pods.xcodeproj" && import_node_path45.default.basename(import_node_path45.default.dirname(xcodeproj)) === "Pods";
|
|
5551
5763
|
function installedPodsSandbox(pods) {
|
|
5552
|
-
const podfileLock =
|
|
5553
|
-
const manifestLock =
|
|
5554
|
-
if (!
|
|
5764
|
+
const podfileLock = import_node_path45.default.join(import_node_path45.default.dirname(pods), "Podfile.lock");
|
|
5765
|
+
const manifestLock = import_node_path45.default.join(pods, "Manifest.lock");
|
|
5766
|
+
if (!import_node_fs43.default.existsSync(podfileLock))
|
|
5555
5767
|
throw new Error(
|
|
5556
|
-
`${pods} has no ${podfileLock}: run \`pod install\` in ${
|
|
5768
|
+
`${pods} has no ${podfileLock}: run \`pod install\` in ${import_node_path45.default.dirname(pods)}`
|
|
5557
5769
|
);
|
|
5558
|
-
if (!
|
|
5770
|
+
if (!import_node_fs43.default.existsSync(manifestLock) || !import_node_fs43.default.readFileSync(manifestLock).equals(import_node_fs43.default.readFileSync(podfileLock)))
|
|
5559
5771
|
throw new Error(
|
|
5560
|
-
`The sandbox is not in sync with the Podfile.lock: ${manifestLock} differs from ${podfileLock}. Run \`pod install\` in ${
|
|
5772
|
+
`The sandbox is not in sync with the Podfile.lock: ${manifestLock} differs from ${podfileLock}. Run \`pod install\` in ${import_node_path45.default.dirname(pods)}`
|
|
5561
5773
|
);
|
|
5562
5774
|
const specChecksums = {};
|
|
5563
|
-
const lines =
|
|
5775
|
+
const lines = import_node_fs43.default.readFileSync(manifestLock, "utf8").split("\n");
|
|
5564
5776
|
const start = lines.indexOf("SPEC CHECKSUMS:");
|
|
5565
5777
|
for (const line of start === -1 ? [] : lines.slice(start + 1)) {
|
|
5566
5778
|
const entry = /^ {2}"?([^":]+)"?: ([0-9a-f]+)$/.exec(line);
|
|
5567
5779
|
if (!entry) break;
|
|
5568
5780
|
specChecksums[entry[1]] = entry[2];
|
|
5569
5781
|
}
|
|
5570
|
-
const specs =
|
|
5782
|
+
const specs = import_node_path45.default.join(pods, "Local Podspecs");
|
|
5571
5783
|
return {
|
|
5572
5784
|
podfileLock,
|
|
5573
5785
|
manifestLock,
|
|
5574
5786
|
specChecksums,
|
|
5575
|
-
localPodspecs: isDirectory(specs) ?
|
|
5787
|
+
localPodspecs: isDirectory(specs) ? import_node_fs43.default.readdirSync(specs).filter((name) => name.endsWith(".podspec.json")).sort().map((name) => import_node_path45.default.join(specs, name)) : []
|
|
5576
5788
|
};
|
|
5577
5789
|
}
|
|
5578
5790
|
function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
|
|
@@ -5584,14 +5796,14 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
|
|
|
5584
5796
|
if (!xcodeProjectFile(xcodeproj)) {
|
|
5585
5797
|
if (installedPods && isPodsProject(xcodeproj))
|
|
5586
5798
|
throw new Error(
|
|
5587
|
-
`${
|
|
5799
|
+
`${import_node_path45.default.basename(xcodeprojOrWorkspace)} builds ${xcodeproj}, which is not installed: run \`pod install\` in ${import_node_path45.default.dirname(import_node_path45.default.dirname(xcodeproj))}`
|
|
5588
5800
|
);
|
|
5589
5801
|
return;
|
|
5590
5802
|
}
|
|
5591
|
-
const key =
|
|
5592
|
-
if (projectAt.has(key) || !installedPods && key.split(
|
|
5803
|
+
const key = import_node_fs43.default.realpathSync.native(xcodeproj);
|
|
5804
|
+
if (projectAt.has(key) || !installedPods && key.split(import_node_path45.default.sep).includes("Pods"))
|
|
5593
5805
|
return;
|
|
5594
|
-
if (isPodsProject(key)) cocoapods = installedPodsSandbox(
|
|
5806
|
+
if (isPodsProject(key)) cocoapods = installedPodsSandbox(import_node_path45.default.dirname(key));
|
|
5595
5807
|
const project = loadProject(key);
|
|
5596
5808
|
projectAt.set(key, project);
|
|
5597
5809
|
projects.push(project);
|
|
@@ -5607,12 +5819,12 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
|
|
|
5607
5819
|
for (const reference of listed)
|
|
5608
5820
|
if (reference.endsWith(".xcodeproj")) addProject(reference);
|
|
5609
5821
|
if (projects.length === 0) {
|
|
5610
|
-
throw new Error(`${
|
|
5822
|
+
throw new Error(`${import_node_path45.default.basename(xcodeprojOrWorkspace)} lists no Xcode project`);
|
|
5611
5823
|
}
|
|
5612
|
-
const podfile =
|
|
5613
|
-
if (installedPods && !cocoapods &&
|
|
5824
|
+
const podfile = import_node_path45.default.join(import_node_path45.default.dirname(xcodeprojOrWorkspace), "Podfile");
|
|
5825
|
+
if (installedPods && !cocoapods && import_node_fs43.default.existsSync(podfile))
|
|
5614
5826
|
throw new Error(
|
|
5615
|
-
`${podfile} is not installed into ${
|
|
5827
|
+
`${podfile} is not installed into ${import_node_path45.default.basename(xcodeprojOrWorkspace)}: run \`pod install\` in ${import_node_path45.default.dirname(podfile)} and open the workspace it writes`
|
|
5616
5828
|
);
|
|
5617
5829
|
return { listed, projects, projectAt, cocoapods };
|
|
5618
5830
|
}
|
|
@@ -5650,7 +5862,7 @@ function listXcodeAppTargets(xcodeprojOrWorkspace, options = {}) {
|
|
|
5650
5862
|
return workspaceProjects(xcodeprojOrWorkspace).projects.flatMap(projectTargets).filter((ref) => isIosAppTarget(ref, options)).map((ref) => str(ref.target.name) ?? ref.id);
|
|
5651
5863
|
}
|
|
5652
5864
|
function defaultXcodeAppTarget(xcodeproj) {
|
|
5653
|
-
const project = loadProject(
|
|
5865
|
+
const project = loadProject(import_node_fs43.default.realpathSync.native(xcodeproj));
|
|
5654
5866
|
for (const [id, target] of Object.entries(project.objects)) {
|
|
5655
5867
|
if (!isDict(target) || target.isa !== "PBXNativeTarget") continue;
|
|
5656
5868
|
if (isIosAppTarget({ project, id, target }, { requireSources: false }))
|
|
@@ -5658,30 +5870,30 @@ function defaultXcodeAppTarget(xcodeproj) {
|
|
|
5658
5870
|
}
|
|
5659
5871
|
}
|
|
5660
5872
|
function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
5661
|
-
const container =
|
|
5873
|
+
const container = import_node_fs43.default.realpathSync.native(xcodeprojOrWorkspace);
|
|
5662
5874
|
const { projects } = workspaceProjects(container);
|
|
5663
5875
|
const containers = [
|
|
5664
5876
|
.../* @__PURE__ */ new Set([container, ...projects.map((project2) => project2.xcodeproj)])
|
|
5665
5877
|
];
|
|
5666
5878
|
const found = containers.flatMap(
|
|
5667
5879
|
(dir) => [
|
|
5668
|
-
|
|
5669
|
-
...isDirectory(
|
|
5880
|
+
import_node_path45.default.join(dir, "xcshareddata"),
|
|
5881
|
+
...isDirectory(import_node_path45.default.join(dir, "xcuserdata")) ? import_node_fs43.default.readdirSync(import_node_path45.default.join(dir, "xcuserdata")).sort().map((user) => import_node_path45.default.join(dir, "xcuserdata", user)) : []
|
|
5670
5882
|
].map((data) => ({
|
|
5671
5883
|
dir,
|
|
5672
|
-
file:
|
|
5884
|
+
file: import_node_path45.default.join(data, "xcschemes", `${scheme}.xcscheme`)
|
|
5673
5885
|
}))
|
|
5674
|
-
).find((candidate) =>
|
|
5886
|
+
).find((candidate) => import_node_fs43.default.existsSync(candidate.file));
|
|
5675
5887
|
if (!found) {
|
|
5676
5888
|
const known = containers.flatMap(
|
|
5677
|
-
(dir) =>
|
|
5889
|
+
(dir) => import_node_fs43.default.existsSync(import_node_path45.default.join(dir, "xcshareddata", "xcschemes")) ? import_node_fs43.default.readdirSync(import_node_path45.default.join(dir, "xcshareddata", "xcschemes")).filter((name2) => name2.endsWith(".xcscheme")).map((name2) => name2.slice(0, -".xcscheme".length)).sort() : []
|
|
5678
5890
|
);
|
|
5679
5891
|
throw new Error(
|
|
5680
|
-
`${
|
|
5892
|
+
`${import_node_path45.default.basename(container)} has no scheme ${scheme}; it shares ${known.join(", ") || "none"}`
|
|
5681
5893
|
);
|
|
5682
5894
|
}
|
|
5683
5895
|
const launch = /<LaunchAction\b([^>]*)>([\s\S]*?)<\/LaunchAction>/.exec(
|
|
5684
|
-
|
|
5896
|
+
import_node_fs43.default.readFileSync(found.file, "utf8")
|
|
5685
5897
|
);
|
|
5686
5898
|
const attribute = (text2, name2) => {
|
|
5687
5899
|
const value = new RegExp(`\\b${name2}\\s*=\\s*"([^"]*)"`).exec(text2)?.[1];
|
|
@@ -5694,12 +5906,12 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
|
5694
5906
|
if (!configuration || !blueprint || !referenced?.startsWith("container:")) {
|
|
5695
5907
|
throw new Error(`scheme ${scheme} runs no application target`);
|
|
5696
5908
|
}
|
|
5697
|
-
const projectPath =
|
|
5698
|
-
|
|
5909
|
+
const projectPath = import_node_path45.default.resolve(
|
|
5910
|
+
import_node_path45.default.dirname(found.dir),
|
|
5699
5911
|
referenced.slice("container:".length)
|
|
5700
5912
|
);
|
|
5701
5913
|
const project = projects.find(
|
|
5702
|
-
(candidate) =>
|
|
5914
|
+
(candidate) => import_node_fs43.default.existsSync(projectPath) && candidate.xcodeproj === import_node_fs43.default.realpathSync.native(projectPath)
|
|
5703
5915
|
);
|
|
5704
5916
|
const target = project && projectTargets(project).find((ref) => ref.id === blueprint);
|
|
5705
5917
|
const name = target && str(target.target.name);
|
|
@@ -5719,31 +5931,31 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
|
5719
5931
|
var NativeAppTargetSelectionError = class extends Error {
|
|
5720
5932
|
};
|
|
5721
5933
|
function selectIosAppTarget(projectRoot, iosTarget) {
|
|
5722
|
-
const nested =
|
|
5723
|
-
const iosRoot =
|
|
5724
|
-
const entries =
|
|
5934
|
+
const nested = import_node_path45.default.join(projectRoot, "ios");
|
|
5935
|
+
const iosRoot = import_node_fs43.default.existsSync(nested) ? nested : projectRoot;
|
|
5936
|
+
const entries = import_node_fs43.default.readdirSync(iosRoot, { withFileTypes: true });
|
|
5725
5937
|
const projects = (entries.some((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj")) ? entries.filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj")).map((entry) => ({
|
|
5726
|
-
xcodeproj:
|
|
5938
|
+
xcodeproj: import_node_path45.default.join(iosRoot, entry.name),
|
|
5727
5939
|
workspace: null
|
|
5728
5940
|
})) : entries.filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcworkspace")).flatMap((entry) => {
|
|
5729
|
-
const workspace =
|
|
5941
|
+
const workspace = import_node_path45.default.join(iosRoot, entry.name);
|
|
5730
5942
|
return workspaceReferences(workspace).map((xcodeproj2) => ({
|
|
5731
5943
|
xcodeproj: xcodeproj2,
|
|
5732
5944
|
workspace
|
|
5733
5945
|
}));
|
|
5734
5946
|
}).filter(
|
|
5735
|
-
({ xcodeproj: xcodeproj2 }) => xcodeproj2.endsWith(".xcodeproj") && !xcodeproj2.split(
|
|
5947
|
+
({ xcodeproj: xcodeproj2 }) => xcodeproj2.endsWith(".xcodeproj") && !xcodeproj2.split(import_node_path45.default.sep).includes("Pods") && import_node_fs43.default.existsSync(xcodeproj2)
|
|
5736
5948
|
).filter(
|
|
5737
5949
|
({ xcodeproj: xcodeproj2 }) => listXcodeAppTargets(xcodeproj2, { requireSources: false }).length > 0
|
|
5738
5950
|
)).map(({ xcodeproj: xcodeproj2, workspace }) => ({
|
|
5739
5951
|
xcodeproj: xcodeproj2,
|
|
5740
5952
|
workspace,
|
|
5741
|
-
name:
|
|
5953
|
+
name: import_node_path45.default.basename(xcodeproj2)
|
|
5742
5954
|
}));
|
|
5743
5955
|
if (projects.length === 0) return null;
|
|
5744
5956
|
if (projects.length > 1 && !iosTarget) {
|
|
5745
5957
|
throw new NativeAppTargetSelectionError(
|
|
5746
|
-
`native app identity requires a selected Xcode project;
|
|
5958
|
+
`native app identity requires a selected Xcode project; pass --ios-target with an app target in one of: ${projects.map((entry) => entry.name).join(", ")}`
|
|
5747
5959
|
);
|
|
5748
5960
|
}
|
|
5749
5961
|
let project = projects[0];
|
|
@@ -5777,13 +5989,13 @@ function selectIosAppTarget(projectRoot, iosTarget) {
|
|
|
5777
5989
|
if (!target) throw new Error("native app identity has no iOS application target");
|
|
5778
5990
|
if (!iosTarget) {
|
|
5779
5991
|
const workspace = xcodeproj.replace(/\.xcodeproj$/, ".xcworkspace");
|
|
5780
|
-
const container =
|
|
5992
|
+
const container = import_node_fs43.default.existsSync(workspace) ? workspace : xcodeproj;
|
|
5781
5993
|
const hasScheme = [container, xcodeproj].some((dir) => {
|
|
5782
|
-
if (
|
|
5994
|
+
if (import_node_fs43.default.existsSync(import_node_path45.default.join(dir, "xcshareddata", "xcschemes", `${target}.xcscheme`)))
|
|
5783
5995
|
return true;
|
|
5784
|
-
const users =
|
|
5785
|
-
return
|
|
5786
|
-
(user) =>
|
|
5996
|
+
const users = import_node_path45.default.join(dir, "xcuserdata");
|
|
5997
|
+
return import_node_fs43.default.existsSync(users) && import_node_fs43.default.readdirSync(users).some(
|
|
5998
|
+
(user) => import_node_fs43.default.existsSync(import_node_path45.default.join(users, user, "xcschemes", `${target}.xcscheme`))
|
|
5787
5999
|
);
|
|
5788
6000
|
});
|
|
5789
6001
|
if (hasScheme) target = readXcodeScheme(container, target).target;
|
|
@@ -5794,8 +6006,8 @@ function selectIosAppTarget(projectRoot, iosTarget) {
|
|
|
5794
6006
|
);
|
|
5795
6007
|
return { xcodeproj, target, workspace: project.workspace };
|
|
5796
6008
|
}
|
|
5797
|
-
var workspaceResolvedFile = (xcodeprojOrWorkspace) =>
|
|
5798
|
-
xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace :
|
|
6009
|
+
var workspaceResolvedFile = (xcodeprojOrWorkspace) => import_node_path45.default.join(
|
|
6010
|
+
xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : import_node_path45.default.join(xcodeprojOrWorkspace, "project.xcworkspace"),
|
|
5799
6011
|
"xcshareddata",
|
|
5800
6012
|
"swiftpm",
|
|
5801
6013
|
"Package.resolved"
|
|
@@ -5812,7 +6024,7 @@ var SwiftPackageResolutionRequired = class extends Error {
|
|
|
5812
6024
|
function readXcodeAppTarget(input, targetName, configurationName, options = {}) {
|
|
5813
6025
|
if (isBazelPackage(input))
|
|
5814
6026
|
return readBazelAppTarget(input, targetName, configurationName, options);
|
|
5815
|
-
const xcodeprojOrWorkspace =
|
|
6027
|
+
const xcodeprojOrWorkspace = import_node_fs43.default.realpathSync.native(input);
|
|
5816
6028
|
const workspace = xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : null;
|
|
5817
6029
|
const { listed, projects, projectAt, cocoapods } = workspaceProjects(
|
|
5818
6030
|
xcodeprojOrWorkspace,
|
|
@@ -5823,7 +6035,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5823
6035
|
(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
|
|
5824
6036
|
);
|
|
5825
6037
|
const appTargetNames = appTargets.map((ref) => str(ref.target.name) ?? ref.id);
|
|
5826
|
-
const container =
|
|
6038
|
+
const container = import_node_path45.default.basename(xcodeprojOrWorkspace);
|
|
5827
6039
|
const named = targetName ? appTargets.filter((ref) => ref.target.name === targetName) : appTargets;
|
|
5828
6040
|
if (named.length !== 1) {
|
|
5829
6041
|
if (options.frameworkMachOType)
|
|
@@ -5848,15 +6060,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5848
6060
|
for (const ref of allTargets) {
|
|
5849
6061
|
const product = ref.project.object(str(ref.target.productReference));
|
|
5850
6062
|
const file = str(product?.path);
|
|
5851
|
-
if (file && !byProduct.has(
|
|
5852
|
-
byProduct.set(
|
|
6063
|
+
if (file && !byProduct.has(import_node_path45.default.basename(file)))
|
|
6064
|
+
byProduct.set(import_node_path45.default.basename(file), ref);
|
|
5853
6065
|
}
|
|
5854
6066
|
const proxied = (project, proxyId) => {
|
|
5855
6067
|
const proxy = project.object(proxyId);
|
|
5856
6068
|
if (proxy?.isa !== "PBXContainerItemProxy") return void 0;
|
|
5857
6069
|
const portal = str(proxy.containerPortal);
|
|
5858
6070
|
const portalPath = project.resolvePath(portal ?? "");
|
|
5859
|
-
const owner = project.object(portal)?.isa === "PBXProject" ? project : portalPath &&
|
|
6071
|
+
const owner = project.object(portal)?.isa === "PBXProject" ? project : portalPath && import_node_fs43.default.existsSync(portalPath) ? projectAt.get(import_node_fs43.default.realpathSync.native(portalPath)) : void 0;
|
|
5860
6072
|
const remote = str(proxy.remoteGlobalIDString);
|
|
5861
6073
|
if (!owner || !remote) return void 0;
|
|
5862
6074
|
return projectTargets(owner).find(
|
|
@@ -5873,7 +6085,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5873
6085
|
const buildFile = project.object(buildFileId);
|
|
5874
6086
|
if (!buildFile || !xcodeBuildFileBuildsForIos(buildFile)) continue;
|
|
5875
6087
|
const file = project.object(str(buildFile.fileRef));
|
|
5876
|
-
const resolved = file?.isa === "PBXReferenceProxy" ? proxied(project, str(file.remoteRef)) : file && str(file.sourceTree) === "BUILT_PRODUCTS_DIR" ? byProduct.get(
|
|
6088
|
+
const resolved = file?.isa === "PBXReferenceProxy" ? proxied(project, str(file.remoteRef)) : file && str(file.sourceTree) === "BUILT_PRODUCTS_DIR" ? byProduct.get(import_node_path45.default.basename(str(file.path) ?? "")) : void 0;
|
|
5877
6089
|
if (resolved)
|
|
5878
6090
|
found.push({
|
|
5879
6091
|
target: resolved,
|
|
@@ -5954,7 +6166,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5954
6166
|
const otherProduct = productName(other);
|
|
5955
6167
|
for (const { file, visibility } of headerPhase(other)) {
|
|
5956
6168
|
if (visibility === "Project") continue;
|
|
5957
|
-
const key = `${otherProduct}/${
|
|
6169
|
+
const key = `${otherProduct}/${import_node_path45.default.basename(file)}`;
|
|
5958
6170
|
if (!headers.has(key)) headers.set(key, file);
|
|
5959
6171
|
}
|
|
5960
6172
|
}
|
|
@@ -5984,8 +6196,8 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5984
6196
|
ref.project.visitMembers(
|
|
5985
6197
|
ref.id,
|
|
5986
6198
|
ref.project.resolvePath,
|
|
5987
|
-
(file) => isDirectory(file) ? walkFiles(file) :
|
|
5988
|
-
|
|
6199
|
+
(file) => isDirectory(file) ? walkFiles(file) : import_node_fs43.default.existsSync(file) ? [file] : [],
|
|
6200
|
+
import_node_path45.default.join,
|
|
5989
6201
|
(file, kind) => {
|
|
5990
6202
|
if (kind === "header") found.push(file);
|
|
5991
6203
|
}
|
|
@@ -6001,12 +6213,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6001
6213
|
for (const ref of projectTargets(project)) {
|
|
6002
6214
|
const product = productName(ref);
|
|
6003
6215
|
for (const { file, visibility } of headerPhase(ref)) {
|
|
6004
|
-
const name =
|
|
6216
|
+
const name = import_node_path45.default.basename(file);
|
|
6005
6217
|
if (!entries.has(name))
|
|
6006
6218
|
entries.set(name, visibility !== "Project" ? `${product}/${name}` : file);
|
|
6007
6219
|
}
|
|
6008
6220
|
for (const file of synchronizedHeaders(ref)) {
|
|
6009
|
-
const name =
|
|
6221
|
+
const name = import_node_path45.default.basename(file);
|
|
6010
6222
|
if (!entries.has(name)) entries.set(name, file);
|
|
6011
6223
|
}
|
|
6012
6224
|
}
|
|
@@ -6016,7 +6228,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6016
6228
|
if (folder === null) continue;
|
|
6017
6229
|
for (const file of walkFiles(folder)) {
|
|
6018
6230
|
if (!HEADER_FILE.test(file)) continue;
|
|
6019
|
-
const name =
|
|
6231
|
+
const name = import_node_path45.default.basename(file);
|
|
6020
6232
|
if (!entries.has(name)) entries.set(name, file);
|
|
6021
6233
|
}
|
|
6022
6234
|
}
|
|
@@ -6024,18 +6236,18 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6024
6236
|
for (const id of Object.keys(project.objects)) {
|
|
6025
6237
|
if (project.object(id)?.isa !== "PBXFileReference") continue;
|
|
6026
6238
|
const file = project.resolvePath(id);
|
|
6027
|
-
if (file && HEADER_FILE.test(file) && !entries.has(
|
|
6028
|
-
entries.set(
|
|
6239
|
+
if (file && HEADER_FILE.test(file) && !entries.has(import_node_path45.default.basename(file)))
|
|
6240
|
+
entries.set(import_node_path45.default.basename(file), file);
|
|
6029
6241
|
}
|
|
6030
6242
|
const map = [...entries];
|
|
6031
6243
|
projectHeaderMaps.set(project, map);
|
|
6032
6244
|
return map;
|
|
6033
6245
|
};
|
|
6034
6246
|
const xcconfigs = /* @__PURE__ */ new Set();
|
|
6035
|
-
const buildDir = (project) =>
|
|
6247
|
+
const buildDir = (project) => import_node_path45.default.join(project.projectDir, ".build/peach-xcode/Build");
|
|
6036
6248
|
const workspaceBuild = {
|
|
6037
|
-
SYMROOT:
|
|
6038
|
-
OBJROOT:
|
|
6249
|
+
SYMROOT: import_node_path45.default.join(buildDir(app.project), "Products"),
|
|
6250
|
+
OBJROOT: import_node_path45.default.join(buildDir(app.project), "Intermediates.noindex")
|
|
6039
6251
|
};
|
|
6040
6252
|
const moduleTarget = (ref) => {
|
|
6041
6253
|
const name = str(ref.target.name) ?? ref.id;
|
|
@@ -6050,16 +6262,16 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6050
6262
|
TARGET_NAME: name,
|
|
6051
6263
|
TARGETNAME: "$(TARGET_NAME)",
|
|
6052
6264
|
PROJECT: "$(PROJECT_NAME)",
|
|
6053
|
-
PROJECT_NAME:
|
|
6265
|
+
PROJECT_NAME: import_node_path45.default.basename(ref.project.xcodeproj, ".xcodeproj"),
|
|
6054
6266
|
PROJECT_CLASS_PREFIX: isDict(ref.project.project.attributes) ? str(ref.project.project.attributes.CLASSPREFIX) ?? "" : "",
|
|
6055
6267
|
PROJECT_FILE_PATH: ref.project.xcodeproj,
|
|
6056
6268
|
SRCROOT: ref.project.projectDir,
|
|
6057
6269
|
SOURCE_ROOT: ref.project.projectDir,
|
|
6058
6270
|
PROJECT_DIR: ref.project.projectDir,
|
|
6059
|
-
SYMROOT:
|
|
6271
|
+
SYMROOT: import_node_path45.default.join(buildDir(ref.project), "Products"),
|
|
6060
6272
|
BUILD_DIR: "$(SYMROOT)",
|
|
6061
6273
|
BUILD_ROOT: "$(SYMROOT)",
|
|
6062
|
-
OBJROOT:
|
|
6274
|
+
OBJROOT: import_node_path45.default.join(buildDir(ref.project), "Intermediates.noindex"),
|
|
6063
6275
|
CONFIGURATION_BUILD_DIR: "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)",
|
|
6064
6276
|
BUILT_PRODUCTS_DIR: "$(CONFIGURATION_BUILD_DIR)",
|
|
6065
6277
|
TARGET_BUILD_DIR: "$(CONFIGURATION_BUILD_DIR)",
|
|
@@ -6108,7 +6320,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6108
6320
|
xcconfigs
|
|
6109
6321
|
);
|
|
6110
6322
|
const searchRules = recursiveSearchRules(settings2);
|
|
6111
|
-
const absolute = (file) =>
|
|
6323
|
+
const absolute = (file) => import_node_path45.default.resolve(ref.project.projectDir, file);
|
|
6112
6324
|
const framework = FRAMEWORK_PRODUCTS.has(str(ref.target.productType) ?? "");
|
|
6113
6325
|
const product = settings2("PRODUCT_NAME");
|
|
6114
6326
|
const moduleName = applyOperator(settings2("PRODUCT_MODULE_NAME"), "c99extidentifier");
|
|
@@ -6139,7 +6351,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6139
6351
|
`${name}: Swift compatibility header phase has no Swift producer sources`
|
|
6140
6352
|
);
|
|
6141
6353
|
const building = options.prepareGeneratedSources && options.requireSources !== false;
|
|
6142
|
-
const versioning = building && allSources.length > 0 && settings2("VERSIONING_SYSTEM") === "apple-generic" ?
|
|
6354
|
+
const versioning = building && allSources.length > 0 && settings2("VERSIONING_SYSTEM") === "apple-generic" ? import_node_path45.default.join(settings2("DERIVED_FILE_DIR"), `${product}_vers.c`) : null;
|
|
6143
6355
|
if (versioning) {
|
|
6144
6356
|
const version = settings2("CURRENT_PROJECT_VERSION");
|
|
6145
6357
|
const custom = [
|
|
@@ -6152,7 +6364,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6152
6364
|
].filter((key) => settings2(key));
|
|
6153
6365
|
if (custom.length)
|
|
6154
6366
|
throw new Error(
|
|
6155
|
-
`${name}: Xcode generates ${
|
|
6367
|
+
`${name}: Xcode generates ${import_node_path45.default.basename(versioning)} with ${custom.join(", ")}; peach does not model VERSION_INFO_* overrides`
|
|
6156
6368
|
);
|
|
6157
6369
|
const symbol = product.replace(/^[^A-Za-z_]/, "_").replace(/[^A-Za-z0-9_]/g, "_");
|
|
6158
6370
|
const [major, minor] = version.split(".");
|
|
@@ -6165,9 +6377,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6165
6377
|
` const double ${symbol}VersionNumber __attribute__ ((used)) = (double)${number2};`,
|
|
6166
6378
|
""
|
|
6167
6379
|
].join("\n");
|
|
6168
|
-
if (!
|
|
6169
|
-
|
|
6170
|
-
|
|
6380
|
+
if (!import_node_fs43.default.existsSync(versioning) || import_node_fs43.default.readFileSync(versioning, "utf8") !== unit) {
|
|
6381
|
+
import_node_fs43.default.mkdirSync(import_node_path45.default.dirname(versioning), { recursive: true });
|
|
6382
|
+
import_node_fs43.default.writeFileSync(versioning, unit);
|
|
6171
6383
|
}
|
|
6172
6384
|
allSources.push(versioning);
|
|
6173
6385
|
}
|
|
@@ -6186,7 +6398,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6186
6398
|
const headerFiles = headerPhase(ref);
|
|
6187
6399
|
const ownHeaders = /* @__PURE__ */ new Map();
|
|
6188
6400
|
for (const { file, visibility } of headerFiles) {
|
|
6189
|
-
const name2 =
|
|
6401
|
+
const name2 = import_node_path45.default.basename(file);
|
|
6190
6402
|
const published = visibility !== "Project";
|
|
6191
6403
|
if (!ownHeaders.has(name2))
|
|
6192
6404
|
ownHeaders.set(name2, published ? `${product}/${name2}` : file);
|
|
@@ -6194,27 +6406,27 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6194
6406
|
ownHeaders.set(`${product}/${name2}`, file);
|
|
6195
6407
|
}
|
|
6196
6408
|
for (const file of synchronizedHeaders(ref)) {
|
|
6197
|
-
const name2 =
|
|
6409
|
+
const name2 = import_node_path45.default.basename(file);
|
|
6198
6410
|
if (ownHeaders.has(name2)) continue;
|
|
6199
6411
|
ownHeaders.set(name2, file);
|
|
6200
6412
|
const qualified = `${product}/${name2}`;
|
|
6201
6413
|
if (!ownHeaders.has(qualified)) ownHeaders.set(qualified, file);
|
|
6202
6414
|
}
|
|
6203
6415
|
const nonFrameworkHeaders = nonFrameworkHeadersOf(ref.project);
|
|
6204
|
-
const wrapper =
|
|
6416
|
+
const wrapper = import_node_path45.default.join(settings2("BUILT_PRODUCTS_DIR"), `${product}.framework`);
|
|
6205
6417
|
const moduleMap = (settings2("DEFINES_MODULE") === "YES" || !framework) && settings2("MODULEMAP_FILE") ? absolute(settings2("MODULEMAP_FILE")) : null;
|
|
6206
|
-
const frameworkUmbrella = !compatibility && framework && members.sources.length > 0 && moduleMap ?
|
|
6207
|
-
const frameworkCompatibility = frameworkUmbrella && moduleMap &&
|
|
6418
|
+
const frameworkUmbrella = !compatibility && framework && members.sources.length > 0 && moduleMap ? import_node_path45.default.join(import_node_path45.default.dirname(moduleMap), `${moduleName}-umbrella.h`) : null;
|
|
6419
|
+
const frameworkCompatibility = frameworkUmbrella && moduleMap && import_node_fs43.default.existsSync(moduleMap) && import_node_fs43.default.existsSync(frameworkUmbrella) ? {
|
|
6208
6420
|
framework: true,
|
|
6209
6421
|
moduleMap,
|
|
6210
6422
|
umbrella: frameworkUmbrella,
|
|
6211
|
-
outputModuleMap:
|
|
6212
|
-
outputUmbrella:
|
|
6423
|
+
outputModuleMap: import_node_path45.default.join(wrapper, "Modules", "module.modulemap"),
|
|
6424
|
+
outputUmbrella: import_node_path45.default.join(
|
|
6213
6425
|
wrapper,
|
|
6214
6426
|
"Headers",
|
|
6215
|
-
|
|
6427
|
+
import_node_path45.default.basename(frameworkUmbrella)
|
|
6216
6428
|
),
|
|
6217
|
-
outputHeader:
|
|
6429
|
+
outputHeader: import_node_path45.default.join(
|
|
6218
6430
|
wrapper,
|
|
6219
6431
|
"Headers",
|
|
6220
6432
|
settings2("SWIFT_OBJC_INTERFACE_HEADER_NAME") || `${moduleName}-Swift.h`
|
|
@@ -6228,10 +6440,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6228
6440
|
outputUmbrella: compatibility.outputUmbrella,
|
|
6229
6441
|
outputHeader: compatibility.outputHeader
|
|
6230
6442
|
} : frameworkCompatibility;
|
|
6231
|
-
const podHeaders = !framework && isPodsProject(ref.project.xcodeproj) && moduleMap &&
|
|
6443
|
+
const podHeaders = !framework && isPodsProject(ref.project.xcodeproj) && moduleMap && import_node_path45.default.relative(import_node_path45.default.join(ref.project.projectDir, "Headers", "Public"), moduleMap).split(import_node_path45.default.sep)[0] !== ".." && import_node_fs43.default.existsSync(moduleMap) ? import_node_fs43.default.readdirSync(import_node_path45.default.dirname(moduleMap)).flatMap((entry) => {
|
|
6232
6444
|
if (!/\.(h|hh|hpp|hxx|modulemap)$/.test(entry)) return [];
|
|
6233
|
-
const file =
|
|
6234
|
-
return
|
|
6445
|
+
const file = import_node_path45.default.join(import_node_path45.default.dirname(moduleMap), entry);
|
|
6446
|
+
return import_node_fs43.default.existsSync(file) ? [file] : [];
|
|
6235
6447
|
}) : [];
|
|
6236
6448
|
const fileFlags = {};
|
|
6237
6449
|
for (const phaseId of list(ref.target.buildPhases)) {
|
|
@@ -6312,15 +6524,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6312
6524
|
// xcode searches its products' include directory before
|
|
6313
6525
|
// HEADER_SEARCH_PATHS and the target's derived sources after.
|
|
6314
6526
|
headerSearchPaths: [
|
|
6315
|
-
|
|
6527
|
+
import_node_path45.default.join(settings2("BUILT_PRODUCTS_DIR"), "include"),
|
|
6316
6528
|
...settingList(settings2("HEADER_SEARCH_PATHS")).flatMap(
|
|
6317
6529
|
(raw) => expandSearchPath(absolute(raw), searchRules)
|
|
6318
6530
|
),
|
|
6319
|
-
|
|
6531
|
+
import_node_path45.default.join(
|
|
6320
6532
|
`${settings2("DERIVED_FILE_DIR")}-normal`,
|
|
6321
6533
|
settings2("CURRENT_ARCH")
|
|
6322
6534
|
),
|
|
6323
|
-
|
|
6535
|
+
import_node_path45.default.join(settings2("DERIVED_FILE_DIR"), settings2("CURRENT_ARCH")),
|
|
6324
6536
|
settings2("DERIVED_FILE_DIR")
|
|
6325
6537
|
],
|
|
6326
6538
|
userHeaderSearchPaths: settingList(
|
|
@@ -6370,10 +6582,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6370
6582
|
...headerFiles.flatMap(
|
|
6371
6583
|
({ file, visibility }) => visibility === "Project" ? [] : [
|
|
6372
6584
|
[
|
|
6373
|
-
|
|
6585
|
+
import_node_path45.default.join(
|
|
6374
6586
|
wrapper,
|
|
6375
6587
|
visibility === "Public" ? "Headers" : "PrivateHeaders",
|
|
6376
|
-
|
|
6588
|
+
import_node_path45.default.basename(file)
|
|
6377
6589
|
),
|
|
6378
6590
|
file
|
|
6379
6591
|
]
|
|
@@ -6387,7 +6599,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6387
6599
|
return [];
|
|
6388
6600
|
const destination = expand(
|
|
6389
6601
|
str(phase.dstPath) ?? "",
|
|
6390
|
-
(name2) => name2 === "PUBLIC_HEADERS_FOLDER_PATH" ?
|
|
6602
|
+
(name2) => name2 === "PUBLIC_HEADERS_FOLDER_PATH" ? import_node_path45.default.join(wrapper, "Headers") : name2 === "PRIVATE_HEADERS_FOLDER_PATH" ? import_node_path45.default.join(wrapper, "PrivateHeaders") : settings2(name2)
|
|
6391
6603
|
);
|
|
6392
6604
|
return list(phase.files).flatMap((id) => {
|
|
6393
6605
|
const file = ref.project.resolvePath(
|
|
@@ -6395,17 +6607,17 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6395
6607
|
);
|
|
6396
6608
|
return file && HEADER_FILE.test(file) ? [
|
|
6397
6609
|
[
|
|
6398
|
-
|
|
6610
|
+
import_node_path45.default.resolve(
|
|
6399
6611
|
settings2("BUILT_PRODUCTS_DIR"),
|
|
6400
6612
|
destination,
|
|
6401
|
-
|
|
6613
|
+
import_node_path45.default.basename(file)
|
|
6402
6614
|
),
|
|
6403
6615
|
file
|
|
6404
6616
|
]
|
|
6405
6617
|
] : [];
|
|
6406
6618
|
});
|
|
6407
6619
|
}),
|
|
6408
|
-
...moduleMap ? [[
|
|
6620
|
+
...moduleMap ? [[import_node_path45.default.join(wrapper, "Modules", "module.modulemap"), moduleMap]] : []
|
|
6409
6621
|
]) : Object.fromEntries([
|
|
6410
6622
|
...podHeaders.map((file) => [file, file]),
|
|
6411
6623
|
...moduleMap ? [[moduleMap, moduleMap]] : []
|
|
@@ -6442,7 +6654,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6442
6654
|
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 }));
|
|
6443
6655
|
const frameworks = frameworkTargets.map(({ framework }) => framework);
|
|
6444
6656
|
const podSourceDirs = builtTargets.slice(0, -1).flatMap(
|
|
6445
|
-
({ ref, module: module3 }) => isPodsProject(ref.project.xcodeproj) ? [...module3.allSources, ...module3.objc?.headers ?? []].map((file) =>
|
|
6657
|
+
({ ref, module: module3 }) => isPodsProject(ref.project.xcodeproj) ? [...module3.allSources, ...module3.objc?.headers ?? []].map((file) => import_node_path45.default.dirname(file)).filter((dir) => import_node_fs43.default.existsSync(dir)) : []
|
|
6446
6658
|
);
|
|
6447
6659
|
const expandValue = (value, settings2) => {
|
|
6448
6660
|
if (typeof value === "string") return expand(value, settings2);
|
|
@@ -6463,7 +6675,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6463
6675
|
const phase = owner.ref.project.object(phaseId);
|
|
6464
6676
|
if (phase?.isa !== "PBXShellScriptBuildPhase" || str(phase.name) !== "[CP] Copy Pods Resources")
|
|
6465
6677
|
continue;
|
|
6466
|
-
const absolute = (raw) =>
|
|
6678
|
+
const absolute = (raw) => import_node_path45.default.resolve(owner.ref.project.projectDir, expand(raw, owner.settings));
|
|
6467
6679
|
const entries = (paths) => paths.flatMap((raw) => {
|
|
6468
6680
|
const file = absolute(raw);
|
|
6469
6681
|
xcconfigs.add(file);
|
|
@@ -6479,7 +6691,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6479
6691
|
].filter((file) => file.endsWith(".bundle"));
|
|
6480
6692
|
if (inputs.length !== outputs.length)
|
|
6481
6693
|
throw new Error(`${owner.module.name}: resource bundle copy lists differ`);
|
|
6482
|
-
const destinationRoot =
|
|
6694
|
+
const destinationRoot = import_node_path45.default.join(
|
|
6483
6695
|
owner.settings("TARGET_BUILD_DIR"),
|
|
6484
6696
|
owner.settings("UNLOCALIZED_RESOURCES_FOLDER_PATH")
|
|
6485
6697
|
);
|
|
@@ -6488,24 +6700,24 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6488
6700
|
const file = str(
|
|
6489
6701
|
target.ref.project.object(str(target.ref.target.productReference))?.path
|
|
6490
6702
|
);
|
|
6491
|
-
return file &&
|
|
6703
|
+
return file && import_node_path45.default.join(target.settings("TARGET_BUILD_DIR"), file) === input2;
|
|
6492
6704
|
});
|
|
6493
6705
|
if (!product && !isDirectory(input2))
|
|
6494
6706
|
throw new Error(
|
|
6495
6707
|
`${owner.module.name}: resource bundle input has no selected producer: ${input2}`
|
|
6496
6708
|
);
|
|
6497
|
-
const destination =
|
|
6498
|
-
if (destination === ".." || destination.startsWith(`..${
|
|
6709
|
+
const destination = import_node_path45.default.relative(destinationRoot, outputs[index]);
|
|
6710
|
+
if (destination === ".." || destination.startsWith(`..${import_node_path45.default.sep}`) || import_node_path45.default.isAbsolute(destination) || import_node_path45.default.basename(input2) !== import_node_path45.default.basename(destination))
|
|
6499
6711
|
throw new Error(
|
|
6500
6712
|
`${owner.module.name}: invalid resource bundle copy destination`
|
|
6501
6713
|
);
|
|
6502
|
-
const infoFile = product ?
|
|
6714
|
+
const infoFile = product ? import_node_path45.default.resolve(
|
|
6503
6715
|
product.ref.project.projectDir,
|
|
6504
6716
|
product.settings("INFOPLIST_FILE")
|
|
6505
6717
|
) : null;
|
|
6506
6718
|
if (infoFile) xcconfigs.add(infoFile);
|
|
6507
6719
|
const prefix = owner.ref === app ? "" : `Frameworks/${owner.module.moduleName}.framework/`;
|
|
6508
|
-
const bundlePath = prefix + destination.split(
|
|
6720
|
+
const bundlePath = prefix + destination.split(import_node_path45.default.sep).join("/");
|
|
6509
6721
|
if (resourceProducts.some((resource) => resource.path === bundlePath))
|
|
6510
6722
|
throw new Error(
|
|
6511
6723
|
`${owner.module.name}: duplicate resource bundle destination ${bundlePath}`
|
|
@@ -6516,22 +6728,22 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6516
6728
|
resources: product.module.resources,
|
|
6517
6729
|
infoPlist: import_plist3.default.build(
|
|
6518
6730
|
expandValue(
|
|
6519
|
-
import_plist3.default.parse(
|
|
6731
|
+
import_plist3.default.parse(import_node_fs43.default.readFileSync(infoFile, "utf8")),
|
|
6520
6732
|
product.settings
|
|
6521
6733
|
)
|
|
6522
6734
|
)
|
|
6523
6735
|
} : {
|
|
6524
|
-
resources:
|
|
6736
|
+
resources: import_node_fs43.default.readdirSync(input2, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => import_node_path45.default.join(entry.parentPath, entry.name)).sort(),
|
|
6525
6737
|
sourceRoot: input2
|
|
6526
6738
|
}
|
|
6527
6739
|
});
|
|
6528
6740
|
}
|
|
6529
6741
|
}
|
|
6530
6742
|
}
|
|
6531
|
-
const infoPlistFile = settings("INFOPLIST_FILE") ?
|
|
6532
|
-
const entitlementsFile = settings("CODE_SIGN_ENTITLEMENTS") ?
|
|
6743
|
+
const infoPlistFile = settings("INFOPLIST_FILE") ? import_node_path45.default.resolve(app.project.projectDir, settings("INFOPLIST_FILE")) : null;
|
|
6744
|
+
const entitlementsFile = settings("CODE_SIGN_ENTITLEMENTS") ? import_node_path45.default.resolve(app.project.projectDir, settings("CODE_SIGN_ENTITLEMENTS")) : null;
|
|
6533
6745
|
const infoPlistPending = module2.generatedInfoPlist && !options.prepareGeneratedSources;
|
|
6534
|
-
const sourceInfo = infoPlistFile && !infoPlistPending ? import_plist3.default.parse(
|
|
6746
|
+
const sourceInfo = infoPlistFile && !infoPlistPending ? import_plist3.default.parse(import_node_fs43.default.readFileSync(infoPlistFile, "utf8")) : {};
|
|
6535
6747
|
if (!sourceInfo || typeof sourceInfo !== "object" || Array.isArray(sourceInfo) || sourceInfo instanceof Date || Buffer.isBuffer(sourceInfo)) {
|
|
6536
6748
|
throw new Error(`${module2.name} Info.plist must contain a dictionary`);
|
|
6537
6749
|
}
|
|
@@ -6556,7 +6768,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6556
6768
|
}
|
|
6557
6769
|
const bundleIdentifier = settings("PRODUCT_BUNDLE_IDENTIFIER") || (typeof info.CFBundleIdentifier === "string" ? info.CFBundleIdentifier : "");
|
|
6558
6770
|
const keychainAccessGroups = entitlementsFile ? readKeychainAccessGroups(
|
|
6559
|
-
import_plist3.default.parse(
|
|
6771
|
+
import_plist3.default.parse(import_node_fs43.default.readFileSync(entitlementsFile, "utf8")),
|
|
6560
6772
|
(value) => expand(value, (key) => {
|
|
6561
6773
|
if (key === "AppIdentifierPrefix") return "FAKETEAMID.";
|
|
6562
6774
|
if (key === "TeamIdentifierPrefix") return "";
|
|
@@ -6594,7 +6806,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6594
6806
|
};
|
|
6595
6807
|
}
|
|
6596
6808
|
const localPackageDirs = [
|
|
6597
|
-
...listed.filter((reference) =>
|
|
6809
|
+
...listed.filter((reference) => import_node_fs43.default.existsSync(import_node_path45.default.join(reference, "Package.swift"))),
|
|
6598
6810
|
...projects.flatMap(
|
|
6599
6811
|
(project) => Object.entries(project.objects).flatMap(([id, entry]) => {
|
|
6600
6812
|
if (!isDict(entry)) return [];
|
|
@@ -6604,19 +6816,19 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6604
6816
|
const packages = [];
|
|
6605
6817
|
while (pending.length > 0) {
|
|
6606
6818
|
const dir = pending.pop();
|
|
6607
|
-
if (
|
|
6819
|
+
if (import_node_fs43.default.existsSync(import_node_path45.default.join(dir, "Package.swift"))) {
|
|
6608
6820
|
packages.push(dir);
|
|
6609
6821
|
continue;
|
|
6610
6822
|
}
|
|
6611
6823
|
if (!isDirectory(dir)) continue;
|
|
6612
|
-
for (const child of
|
|
6824
|
+
for (const child of import_node_fs43.default.readdirSync(dir, { withFileTypes: true }))
|
|
6613
6825
|
if (child.isDirectory() && !child.name.startsWith("."))
|
|
6614
|
-
pending.push(
|
|
6826
|
+
pending.push(import_node_path45.default.join(dir, child.name));
|
|
6615
6827
|
}
|
|
6616
6828
|
return packages;
|
|
6617
6829
|
}
|
|
6618
|
-
const candidate = entry.isa === "XCLocalSwiftPackageReference" ?
|
|
6619
|
-
return candidate &&
|
|
6830
|
+
const candidate = entry.isa === "XCLocalSwiftPackageReference" ? import_node_path45.default.resolve(project.projectDir, str(entry.relativePath) ?? "") : entry.isa === "PBXFileReference" ? project.resolvePath(id) : null;
|
|
6831
|
+
return candidate && import_node_fs43.default.existsSync(import_node_path45.default.join(candidate, "Package.swift")) ? [candidate] : [];
|
|
6620
6832
|
})
|
|
6621
6833
|
)
|
|
6622
6834
|
];
|
|
@@ -6646,7 +6858,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6646
6858
|
if ((flag === "-framework" || flag === "-weak_framework") && name)
|
|
6647
6859
|
sdkFrameworks.add(name);
|
|
6648
6860
|
});
|
|
6649
|
-
const absolute = (raw) =>
|
|
6861
|
+
const absolute = (raw) => import_node_path45.default.resolve(ref.project.projectDir, expand(raw, settings2));
|
|
6650
6862
|
const requested = options.nativeModules;
|
|
6651
6863
|
const includeBinary = (name, dir) => {
|
|
6652
6864
|
if (!requested || nativeTargets.has(ref) || requested.includes(name) || dir.endsWith(".xcframework") && localSwiftBinaryModules(dir).some((module3) => requested.includes(module3)))
|
|
@@ -6658,14 +6870,14 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6658
6870
|
for (const directory of expandSearchPath(absolute(raw), searchRules)) {
|
|
6659
6871
|
if (frameworkSearchDirectories.has(directory)) continue;
|
|
6660
6872
|
frameworkSearchDirectories.add(directory);
|
|
6661
|
-
if (!
|
|
6873
|
+
if (!import_node_fs43.default.statSync(directory, { throwIfNoEntry: false })?.isDirectory() || /\.sdk\/(?:System|Developer)\/Library\/Frameworks\/?$/.test(directory))
|
|
6662
6874
|
continue;
|
|
6663
|
-
for (const entry of
|
|
6875
|
+
for (const entry of import_node_fs43.default.readdirSync(directory, { withFileTypes: true })) {
|
|
6664
6876
|
const name = /^(.+)\.framework$/.exec(entry.name)?.[1];
|
|
6665
6877
|
if (!name || byProduct.has(entry.name) || searchedFrameworks.has(name))
|
|
6666
6878
|
continue;
|
|
6667
|
-
const file =
|
|
6668
|
-
if (
|
|
6879
|
+
const file = import_node_path45.default.join(directory, entry.name);
|
|
6880
|
+
if (import_node_fs43.default.statSync(file, { throwIfNoEntry: false })?.isDirectory())
|
|
6669
6881
|
searchedFrameworks.set(name, file);
|
|
6670
6882
|
}
|
|
6671
6883
|
}
|
|
@@ -6673,9 +6885,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6673
6885
|
}
|
|
6674
6886
|
for (const raw of settingList(settings2("SWIFT_INCLUDE_PATHS"))) {
|
|
6675
6887
|
const dir = absolute(raw);
|
|
6676
|
-
const modulemap =
|
|
6677
|
-
if (!
|
|
6678
|
-
const name = moduleMapName(
|
|
6888
|
+
const modulemap = import_node_path45.default.join(dir, "module.modulemap");
|
|
6889
|
+
if (!import_node_fs43.default.existsSync(modulemap)) continue;
|
|
6890
|
+
const name = moduleMapName(import_node_fs43.default.readFileSync(modulemap, "utf8"));
|
|
6679
6891
|
if (name && !binaryFrameworks.has(name)) includeBinary(name, dir);
|
|
6680
6892
|
}
|
|
6681
6893
|
for (const phaseId of list(ref.target.buildPhases)) {
|
|
@@ -6684,7 +6896,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6684
6896
|
const inputs = list(phase.inputPaths).map(absolute);
|
|
6685
6897
|
for (const raw of list(phase.inputFileListPaths)) {
|
|
6686
6898
|
const file = absolute(raw);
|
|
6687
|
-
if (!
|
|
6899
|
+
if (!import_node_fs43.default.existsSync(file)) continue;
|
|
6688
6900
|
xcconfigs.add(file);
|
|
6689
6901
|
inputs.push(...fileListEntries(file, absolute));
|
|
6690
6902
|
}
|
|
@@ -6749,7 +6961,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6749
6961
|
...productAttributes.get(dependencyId)?.length ? { attributes: productAttributes.get(dependencyId) } : {},
|
|
6750
6962
|
source: reference?.isa === "XCRemoteSwiftPackageReference" ? { kind: "remote", url: str(reference.repositoryURL) ?? "" } : reference?.isa === "XCLocalSwiftPackageReference" ? {
|
|
6751
6963
|
kind: "local",
|
|
6752
|
-
dir:
|
|
6964
|
+
dir: import_node_path45.default.resolve(
|
|
6753
6965
|
project.projectDir,
|
|
6754
6966
|
str(reference.relativePath) ?? ""
|
|
6755
6967
|
)
|
|
@@ -6783,10 +6995,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6783
6995
|
continue;
|
|
6784
6996
|
}
|
|
6785
6997
|
if (tree === "BUILT_PRODUCTS_DIR" || tree === "DEVELOPER_DIR" || // a target in the workspace builds it, so it exists only after that build
|
|
6786
|
-
byProduct.has(
|
|
6998
|
+
byProduct.has(import_node_path45.default.basename(rawPath)))
|
|
6787
6999
|
continue;
|
|
6788
7000
|
const resolved = fileId ? project.resolvePath(fileId) : null;
|
|
6789
|
-
if (fileId && resolved !== null && !
|
|
7001
|
+
if (fileId && resolved !== null && !import_node_fs43.default.existsSync(resolved)) {
|
|
6790
7002
|
if (!ios_sdk_frameworks_default.frameworks.includes(name))
|
|
6791
7003
|
throw new Error(
|
|
6792
7004
|
`${str(target.name) ?? "target"}: linked framework ${name} (${fileId}) points at missing ${resolved} in ${project.projectFile}`
|
|
@@ -6813,7 +7025,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6813
7025
|
({ product }) => !options.nativeModules || nativeTargets.has(built.ref) || options.nativeModules.includes(product)
|
|
6814
7026
|
);
|
|
6815
7027
|
const resolvedFile = workspaceResolvedFile(xcodeprojOrWorkspace);
|
|
6816
|
-
let packageResolved =
|
|
7028
|
+
let packageResolved = import_node_fs43.default.existsSync(resolvedFile) ? [import_node_fs43.default.realpathSync.native(resolvedFile)] : [...new Set(localPackageDirs.map((dir) => import_node_path45.default.join(dir, "Package.resolved")))].filter((file) => import_node_fs43.default.existsSync(file)).map((file) => import_node_fs43.default.realpathSync.native(file)).sort();
|
|
6817
7029
|
if (packageResolved.length === 0) {
|
|
6818
7030
|
const requirements = remotePackageRequirements(projects);
|
|
6819
7031
|
if (requirements.length > 0) {
|
|
@@ -6864,19 +7076,19 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6864
7076
|
} : {},
|
|
6865
7077
|
rootDir: commonAncestor(
|
|
6866
7078
|
[
|
|
6867
|
-
workspace ?
|
|
7079
|
+
workspace ? import_node_path45.default.dirname(workspace) : app.project.projectDir,
|
|
6868
7080
|
...used.map((project) => project.projectDir),
|
|
6869
7081
|
...localPackageDirs,
|
|
6870
7082
|
...linkedProducts.flatMap(
|
|
6871
|
-
({ source }) => source.kind === "local" &&
|
|
7083
|
+
({ source }) => source.kind === "local" && import_node_fs43.default.existsSync(source.dir) ? [source.dir] : []
|
|
6872
7084
|
),
|
|
6873
7085
|
...new Set(podSourceDirs),
|
|
6874
7086
|
// a target's own files may sit beside the project, such as an asset
|
|
6875
7087
|
// catalog one folder up, and xcode builds them from there
|
|
6876
7088
|
...new Set(
|
|
6877
|
-
[...module2.allSources, ...module2.resources].filter((file) =>
|
|
7089
|
+
[...module2.allSources, ...module2.resources].filter((file) => import_node_fs43.default.existsSync(file)).map((file) => import_node_path45.default.dirname(file))
|
|
6878
7090
|
)
|
|
6879
|
-
].map((dir) =>
|
|
7091
|
+
].map((dir) => import_node_fs43.default.realpathSync.native(dir))
|
|
6880
7092
|
),
|
|
6881
7093
|
projectFiles: [
|
|
6882
7094
|
.../* @__PURE__ */ new Set([
|
|
@@ -6897,7 +7109,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6897
7109
|
resourceProducts,
|
|
6898
7110
|
linkedProducts,
|
|
6899
7111
|
localPackageDirs: [
|
|
6900
|
-
...new Set(localPackageDirs.map((dir) =>
|
|
7112
|
+
...new Set(localPackageDirs.map((dir) => import_node_fs43.default.realpathSync.native(dir)))
|
|
6901
7113
|
].sort(),
|
|
6902
7114
|
binaryFrameworks: [...binaryFrameworks].map(([name, file]) => ({ name, path: file })).sort((left, right) => left.name.localeCompare(right.name)),
|
|
6903
7115
|
sdkFrameworks: [...sdkFrameworks].filter(
|
|
@@ -7002,7 +7214,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
7002
7214
|
const rtcAppGroupIdentifier = nonEmptyString2(dictionary.RTCAppGroupIdentifier);
|
|
7003
7215
|
const screenShareExtensionBundleId = typeof dictionary.ScreenShareExtensionBundleId === "string" ? dictionary.ScreenShareExtensionBundleId : void 0;
|
|
7004
7216
|
const rootModuleName = readRootModuleName(
|
|
7005
|
-
app.allSources.filter((file) => /Delegate\.(?:swift|mm|m)$/.test(file) &&
|
|
7217
|
+
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"))
|
|
7006
7218
|
);
|
|
7007
7219
|
const identity = {
|
|
7008
7220
|
...app.keychainAccessGroups === void 0 ? {} : { keychainAccessGroups: app.keychainAccessGroups },
|
|
@@ -7025,7 +7237,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
7025
7237
|
googleSignIn: readGoogleSignInConfiguration(
|
|
7026
7238
|
dictionary,
|
|
7027
7239
|
Object.fromEntries(
|
|
7028
|
-
app.resources.filter((file) => file.endsWith(".plist")).map((file) => [file, parseInfoPlist(
|
|
7240
|
+
app.resources.filter((file) => file.endsWith(".plist")).map((file) => [file, parseInfoPlist(import_node_fs44.default.readFileSync(file, "utf8"))])
|
|
7029
7241
|
)
|
|
7030
7242
|
),
|
|
7031
7243
|
supportedInterfaceOrientations,
|
|
@@ -7035,11 +7247,11 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
7035
7247
|
bundleIcons: resolveNativeBundleIcons(icons, catalogAlternateNames, (value) => value),
|
|
7036
7248
|
appIconArtwork: resolveNativeAppIconArtwork(
|
|
7037
7249
|
app.resources,
|
|
7038
|
-
(file) =>
|
|
7250
|
+
(file) => import_node_fs44.default.readFileSync(file, "utf8"),
|
|
7039
7251
|
(file) => {
|
|
7040
|
-
const extension =
|
|
7252
|
+
const extension = import_node_path46.default.extname(file).toLowerCase();
|
|
7041
7253
|
const contentType = extension === ".jpg" || extension === ".jpeg" ? "image/jpeg" : extension === ".webp" ? "image/webp" : "image/png";
|
|
7042
|
-
return `data:${contentType};base64,${
|
|
7254
|
+
return `data:${contentType};base64,${import_node_fs44.default.readFileSync(file).toString("base64")}`;
|
|
7043
7255
|
},
|
|
7044
7256
|
icons,
|
|
7045
7257
|
app.appIconName,
|
|
@@ -7076,11 +7288,11 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
|
|
|
7076
7288
|
const read = selectNativeAppIdentityReader(platform, {
|
|
7077
7289
|
android: () => null,
|
|
7078
7290
|
ios: () => {
|
|
7079
|
-
const nested =
|
|
7080
|
-
const iosRoot =
|
|
7291
|
+
const nested = import_node_path46.default.join(projectRoot, "ios");
|
|
7292
|
+
const iosRoot = import_node_fs44.default.existsSync(nested) ? nested : projectRoot;
|
|
7081
7293
|
const prefix = iosRoot === nested ? "ios/" : "";
|
|
7082
7294
|
const files = {};
|
|
7083
|
-
for (const entry of
|
|
7295
|
+
for (const entry of import_node_fs44.default.readdirSync(iosRoot, { withFileTypes: true })) {
|
|
7084
7296
|
if (entry.name === "Pods") continue;
|
|
7085
7297
|
if (entry.isDirectory()) {
|
|
7086
7298
|
const names = entry.name.endsWith(".xcodeproj") ? ["project.pbxproj"] : [
|
|
@@ -7088,17 +7300,17 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
|
|
|
7088
7300
|
"AppDelegate.swift",
|
|
7089
7301
|
"AppDelegate.mm",
|
|
7090
7302
|
"AppDelegate.m",
|
|
7091
|
-
...
|
|
7303
|
+
...import_node_fs44.default.readdirSync(import_node_path46.default.join(iosRoot, entry.name)).filter((name) => name.endsWith(".entitlements"))
|
|
7092
7304
|
];
|
|
7093
7305
|
for (const name of names) {
|
|
7094
|
-
const
|
|
7095
|
-
const file =
|
|
7096
|
-
if (
|
|
7306
|
+
const relative2 = `${prefix}${entry.name}/${name}`;
|
|
7307
|
+
const file = import_node_path46.default.join(projectRoot, relative2);
|
|
7308
|
+
if (import_node_fs44.default.existsSync(file)) files[relative2] = import_node_fs44.default.readFileSync(file, "utf8");
|
|
7097
7309
|
}
|
|
7098
7310
|
} else if (/AppDelegate\.(?:swift|mm|m)$|\.entitlements$/.test(entry.name)) {
|
|
7099
|
-
const
|
|
7100
|
-
const file =
|
|
7101
|
-
if (
|
|
7311
|
+
const relative2 = `${prefix}${entry.name}`;
|
|
7312
|
+
const file = import_node_path46.default.join(projectRoot, relative2);
|
|
7313
|
+
if (import_node_fs44.default.existsSync(file)) files[relative2] = import_node_fs44.default.readFileSync(file, "utf8");
|
|
7102
7314
|
}
|
|
7103
7315
|
}
|
|
7104
7316
|
const identity = extractNativeAppIdentityFromFiles(
|
|
@@ -7115,41 +7327,41 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
|
|
|
7115
7327
|
function readAndroidNativeAppIdentity(projectRoot, androidMergedManifest) {
|
|
7116
7328
|
const files = {};
|
|
7117
7329
|
if (androidMergedManifest) {
|
|
7118
|
-
const file =
|
|
7119
|
-
if (!
|
|
7120
|
-
files[androidMergedManifest] =
|
|
7330
|
+
const file = import_node_path46.default.resolve(projectRoot, androidMergedManifest);
|
|
7331
|
+
if (!import_node_fs44.default.existsSync(file)) return null;
|
|
7332
|
+
files[androidMergedManifest] = import_node_fs44.default.readFileSync(file, "utf8");
|
|
7121
7333
|
} else {
|
|
7122
|
-
const androidRoot =
|
|
7123
|
-
if (!
|
|
7334
|
+
const androidRoot = import_node_path46.default.join(projectRoot, "android");
|
|
7335
|
+
if (!import_node_fs44.default.existsSync(androidRoot)) return null;
|
|
7124
7336
|
const collect = (directory) => {
|
|
7125
|
-
for (const entry of
|
|
7126
|
-
const file =
|
|
7337
|
+
for (const entry of import_node_fs44.default.readdirSync(directory, { withFileTypes: true })) {
|
|
7338
|
+
const file = import_node_path46.default.join(directory, entry.name);
|
|
7127
7339
|
if (entry.isDirectory()) collect(file);
|
|
7128
7340
|
else if (entry.isFile() && entry.name === "AndroidManifest.xml")
|
|
7129
|
-
files[
|
|
7341
|
+
files[import_node_path46.default.relative(projectRoot, file).split(import_node_path46.default.sep).join("/")] = import_node_fs44.default.readFileSync(file, "utf8");
|
|
7130
7342
|
}
|
|
7131
7343
|
};
|
|
7132
|
-
for (const module2 of
|
|
7344
|
+
for (const module2 of import_node_fs44.default.readdirSync(androidRoot, { withFileTypes: true })) {
|
|
7133
7345
|
if (!module2.isDirectory()) continue;
|
|
7134
|
-
const outputs =
|
|
7346
|
+
const outputs = import_node_path46.default.join(
|
|
7135
7347
|
androidRoot,
|
|
7136
7348
|
module2.name,
|
|
7137
7349
|
"build/intermediates/merged_manifests"
|
|
7138
7350
|
);
|
|
7139
|
-
if (
|
|
7351
|
+
if (import_node_fs44.default.existsSync(outputs)) collect(outputs);
|
|
7140
7352
|
}
|
|
7141
7353
|
}
|
|
7142
7354
|
for (const manifest of Object.keys(files)) {
|
|
7143
7355
|
const resourceDirectory = androidMergedResourceValuesDirectory(manifest);
|
|
7144
7356
|
if (!resourceDirectory) continue;
|
|
7145
|
-
const absolute =
|
|
7146
|
-
if (!
|
|
7147
|
-
for (const entry of
|
|
7357
|
+
const absolute = import_node_path46.default.resolve(projectRoot, resourceDirectory);
|
|
7358
|
+
if (!import_node_fs44.default.existsSync(absolute)) continue;
|
|
7359
|
+
for (const entry of import_node_fs44.default.readdirSync(absolute, { withFileTypes: true })) {
|
|
7148
7360
|
if (!entry.isDirectory() || !/^values(?:-|$)/.test(entry.name)) continue;
|
|
7149
|
-
for (const resource of
|
|
7361
|
+
for (const resource of import_node_fs44.default.readdirSync(import_node_path46.default.join(absolute, entry.name))) {
|
|
7150
7362
|
if (!resource.endsWith(".xml")) continue;
|
|
7151
7363
|
const file = `${resourceDirectory}/${entry.name}/${resource}`;
|
|
7152
|
-
files[file] =
|
|
7364
|
+
files[file] = import_node_fs44.default.readFileSync(import_node_path46.default.resolve(projectRoot, file), "utf8");
|
|
7153
7365
|
}
|
|
7154
7366
|
}
|
|
7155
7367
|
}
|
|
@@ -7170,7 +7382,7 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget, enviro
|
|
|
7170
7382
|
parseInfoPlist,
|
|
7171
7383
|
buildSdkVersion
|
|
7172
7384
|
);
|
|
7173
|
-
const projectManifestPath =
|
|
7385
|
+
const projectManifestPath = import_node_path46.default.join(projectRoot, "package.json");
|
|
7174
7386
|
const projectRequire = (0, import_node_module.createRequire)(projectManifestPath);
|
|
7175
7387
|
let reanimatedManifestPath;
|
|
7176
7388
|
try {
|
|
@@ -7184,22 +7396,22 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget, enviro
|
|
|
7184
7396
|
throw error;
|
|
7185
7397
|
}
|
|
7186
7398
|
const installedManifest = JSON.parse(
|
|
7187
|
-
|
|
7399
|
+
import_node_fs44.default.readFileSync(reanimatedManifestPath, "utf8")
|
|
7188
7400
|
);
|
|
7189
7401
|
const installedVersion = isRecord(installedManifest) ? nonEmptyString2(installedManifest.version) : void 0;
|
|
7190
7402
|
if (!installedVersion) throw new Error("Reanimated package version is malformed");
|
|
7191
7403
|
if (Number.parseInt(installedVersion, 10) < 4) return identity;
|
|
7192
7404
|
const defaults = JSON.parse(
|
|
7193
|
-
|
|
7194
|
-
|
|
7195
|
-
|
|
7405
|
+
import_node_fs44.default.readFileSync(
|
|
7406
|
+
import_node_path46.default.join(
|
|
7407
|
+
import_node_path46.default.dirname(reanimatedManifestPath),
|
|
7196
7408
|
"src/featureFlags/staticFlags.json"
|
|
7197
7409
|
),
|
|
7198
7410
|
"utf8"
|
|
7199
7411
|
)
|
|
7200
7412
|
);
|
|
7201
7413
|
if (!isRecord(defaults)) throw new Error("Reanimated static flags are malformed");
|
|
7202
|
-
const manifest = JSON.parse(
|
|
7414
|
+
const manifest = JSON.parse(import_node_fs44.default.readFileSync(projectManifestPath, "utf8"));
|
|
7203
7415
|
const reanimated = isRecord(manifest) ? manifest.reanimated : void 0;
|
|
7204
7416
|
const overrides = isRecord(reanimated) ? reanimated.staticFeatureFlags : void 0;
|
|
7205
7417
|
if (overrides !== void 0 && !isRecord(overrides)) {
|