peachsim 0.1.2129 → 0.1.2155
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 +1 -1
- package/cli/app-fonts.ts +1 -1
- package/cli/app-stubs.ts +1 -1
- package/cli/cli-release-origin.ts +1 -0
- package/cli/cli-update.ts +1 -1
- package/cli/cloud-box-artifact.ts +1 -1
- package/cli/cloud-test-tunnel.ts +1 -1
- package/cli/commands/compat.ts +1 -1
- package/cli/commands/control.ts +2 -0
- package/cli/commands/coverage.ts +1 -1
- package/cli/commands/flow.ts +8 -1
- package/cli/commands/inspect/core.ts +25 -4
- package/cli/commands/package.ts +21 -12
- package/cli/commands/shell-url.ts +8 -3
- package/cli/commands/upgrade.ts +1 -1
- package/cli/drivers/linux-browser-libs.ts +1 -1
- package/cli/outbound-endpoints.ts +4 -0
- package/cli/remote-project-bundle.ts +2 -2
- package/detox/index.ts +12 -5
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -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 +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +1795 -1801
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +2 -2
- package/dist-lib/config.mjs +2 -2
- package/dist-lib/detox/index.cjs +31 -8
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +41 -33
- package/dist-lib/expo-swift-metadata.cjs +10 -2
- package/dist-lib/expo-swift-metadata.mjs +9 -2
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +276 -243
- package/dist-lib/host/fetch-proxy-handler.cjs +459 -484
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +266 -266
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +2 -2
- package/dist-lib/metro-production-bundle.mjs +2 -2
- package/dist-lib/metro.cjs +320 -336
- package/dist-lib/native-app-identity-project.cjs +134 -159
- package/dist-lib/native-app-identity-project.mjs +428 -459
- package/dist-lib/native-app-identity.cjs +18 -18
- package/dist-lib/native-app-identity.mjs +18 -18
- package/dist-lib/native-firebase-metadata.cjs +2 -2
- package/dist-lib/native-firebase-metadata.mjs +2 -2
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +32 -36
- package/dist-lib/public-origins-lib.json +135 -161
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +2 -2
- package/dist-lib/sdk.cjs +20 -2
- package/dist-lib/sdk.mjs +20 -2
- package/dist-lib/skills.cjs +587 -531
- package/dist-lib/swift-compile.cjs +23 -8
- package/dist-lib/swift-compile.mjs +23 -8
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +41 -39
- package/dist-lib/vite.cjs +745 -768
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-cookies.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/engine/secureItemHostContract.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/expo-widgets-activityContract.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/map-command-channel.d.ts +2 -0
- package/dist-types/packages/peach-engine/src/render-worker/metro-bundle-metadata.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/native-ui-protocol.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/one-native-contentContract.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +2 -2
- package/dist-types/packages/peach-engine/src/render-worker/worklet-serialize.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/worklet-wire.d.ts +1 -1
- package/dist-types/packages/peach-globals/src/globalsContract.d.ts +1 -1
- package/dist-types/packages/peach-globals/src/package-versions.d.ts +16 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/src/androidAutolinkingContract.ts +1 -1
- package/src/androidRootModuleContract.ts +1 -1
- package/src/bundle-channel.mjs +1 -1
- package/src/config.ts +1 -1
- package/src/configured-bundle-producer.ts +1 -1
- package/src/expo-swift-host.ts +34 -4
- package/src/expoKotlinContract.ts +4 -1
- package/src/expoSwiftContract.ts +18 -4
- package/src/guest-bundle.ts +1 -1
- package/src/host/dev-server-package-versions.ts +1 -1
- package/src/host/fetch-proxy-handler.ts +1 -1
- package/src/installed-native-build-options.ts +2 -2
- package/src/installed-package-versions.ts +7 -7
- package/src/metro-plugin.ts +1 -1
- package/src/metro-production-bundle.ts +1 -1
- package/src/native-app-identity.ts +1 -1
- package/src/native-firebase-metadata.ts +1 -1
- package/src/nitro-adapter.lock.json +244 -244
- package/src/nitro-superset.lock.json +4 -4
- package/src/nitroContract.ts +1 -1
- package/src/oneSdkContract.ts +1 -1
- package/src/react-native-coverage/capability-reference-resolution.ts +4 -4
- package/src/storageSnapshotContract.ts +2 -2
- package/src/swift-compile.ts +24 -7
- package/src/swift-coverage/source.ts +1 -1
- package/src/swift-distribution.lock.json +8 -8
- package/src/turbo-runtime.lock.json +18 -18
- package/src/vite-plugin-one.ts +4 -4
- package/src/vite-plugin.ts +6 -6
- package/src/bundleGlobalFooter.ts +0 -137
- package/src/packageVersionsContract.ts +0 -131
- /package/dist-types/packages/{peach-compat/src/stubs → peach-engine/src/guest}/native-evaluation-lease.d.ts +0 -0
- /package/dist-types/packages/{peach-compat → peach-globals}/src/secure-item-store.d.ts +0 -0
- /package/dist-types/packages/{peach-compat/src/stubs → peach-kit/src}/ring-mode-state.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2155 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -32,7 +32,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
32
32
|
var define_SWIFT_COVERAGE_SOURCE_DIGESTS_default;
|
|
33
33
|
var init_define_SWIFT_COVERAGE_SOURCE_DIGESTS = __esm({
|
|
34
34
|
"<define:__SWIFT_COVERAGE_SOURCE_DIGESTS__>"() {
|
|
35
|
-
define_SWIFT_COVERAGE_SOURCE_DIGESTS_default = { "swift-coverage/indexdump.ts": "0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412", "swift-coverage/indexing.ts": "633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272", "swift-coverage/types.ts": "5bd72edc235189d69835155cb0367a1aee14332405896366af3be606dbe8cce8", "swift-coverage/source.ts": "
|
|
35
|
+
define_SWIFT_COVERAGE_SOURCE_DIGESTS_default = { "swift-coverage/indexdump.ts": "0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412", "swift-coverage/indexing.ts": "633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272", "swift-coverage/types.ts": "5bd72edc235189d69835155cb0367a1aee14332405896366af3be606dbe8cce8", "swift-coverage/source.ts": "c151758a9f67631bc61473c375df0dc017da6902a34533b2cf4fc4fd7d19b6ee", "swift-coverage/package.ts": "1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b", "swift-coverage/xcode.ts": "65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa", "swift-coverage/xcode-assets.ts": "99e03b74c961d2449afd58c2cbc415ba91d1d469a4f89e461c137fd6c305b27c", "swift-coverage/xcode-asset-symbols.ts": "1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671", "swift-coverage/xcode-bridging.ts": "33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11", "swift-coverage/xcode-packages.ts": "8e6020d17d24474150a5a50d042aca6261819ef75c79680a287a66f395909915", "swift-coverage/xcode-strings.ts": "f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c", "swift-coverage/reader.ts": "da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c", "swift-coverage/provenance.ts": "eb3b41ae8b58b48f6758f084800f188dfb1edb227e483abdd6b80cde66e849b9", "swift-package-manifest.ts": "4b7d4a715cdaf57468ead23f2ff9dce76d02c6a888d73d144d4baa2ae571ba3c", "swift-package.ts": "0b82b3773f9c0b27636f277d9c123b3e631b9c9980995d67d67efa6b3176df4a", "swift-source-file.ts": "93fd659ed63a27b67f54a7c229a7ceb636dc9c59e68414920ba36cff1eda1f94", "swift-toolchain.ts": "65a0698bf022ace2f4254f3f891828dedf403d61c102238e242084a2279e04eb", "home-paths.ts": "783c20faf3235e3fc1846b056d788f29d9bfdfc946822b62acf722341b3a10fd", "xcode-header-search.ts": "f8c3d557b4eca5ddad32907545353eb7ad53b2ebd0969d9ed8f7275e109a13b1", "xcode-project.ts": "5f41cd0bd86cb0cffbfb0047348b963f81d5e51cb0e8dd574c739b1a27aa56de", "xcode-target-members.ts": "ad7589132bffab265e8a10b64e24484fe88b4a2b1cc0ee19a97f151a002eca77", "xcode-json-project.ts": "41990ebbe4b488eef34e74c4608b4b48e5a5b299ba98ca7fbcfdfa0e77be63b6", "openstep-plist.ts": "74e6ce1dac80c9c318e0e9f5e3e8cd19a898a8820c36fc160609695bcb59dcd3" };
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
|
|
@@ -104,8 +104,8 @@ var require_parse = __commonJS({
|
|
|
104
104
|
}
|
|
105
105
|
return root;
|
|
106
106
|
};
|
|
107
|
-
function internalize(holder,
|
|
108
|
-
const value = holder[
|
|
107
|
+
function internalize(holder, name, reviver) {
|
|
108
|
+
const value = holder[name];
|
|
109
109
|
if (value != null && typeof value === "object") {
|
|
110
110
|
if (Array.isArray(value)) {
|
|
111
111
|
for (let i = 0; i < value.length; i++) {
|
|
@@ -138,7 +138,7 @@ var require_parse = __commonJS({
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
return reviver.call(holder,
|
|
141
|
+
return reviver.call(holder, name, value);
|
|
142
142
|
}
|
|
143
143
|
var lexState;
|
|
144
144
|
var buffer;
|
|
@@ -1155,9 +1155,9 @@ var require_lib = __commonJS({
|
|
|
1155
1155
|
|
|
1156
1156
|
// src/native-app-identity-project.ts
|
|
1157
1157
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
1158
|
-
import
|
|
1158
|
+
import fs17 from "node:fs";
|
|
1159
1159
|
import { createRequire } from "node:module";
|
|
1160
|
-
import
|
|
1160
|
+
import path36 from "node:path";
|
|
1161
1161
|
|
|
1162
1162
|
// src/android-app-identity.ts
|
|
1163
1163
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -1234,18 +1234,18 @@ function parseXml(text2, file) {
|
|
|
1234
1234
|
if (!match)
|
|
1235
1235
|
throw new Error(`${file}: unreadable markup at ${body.slice(open, open + 40)}`);
|
|
1236
1236
|
index = TAG.lastIndex;
|
|
1237
|
-
const [, closing,
|
|
1238
|
-
if (!
|
|
1237
|
+
const [, closing, name, rawAttributes, selfClosing] = match;
|
|
1238
|
+
if (!name) continue;
|
|
1239
1239
|
if (closing) {
|
|
1240
1240
|
const element2 = stack.pop();
|
|
1241
|
-
if (element2?.name !==
|
|
1242
|
-
throw new Error(`${file}: </${
|
|
1241
|
+
if (element2?.name !== name)
|
|
1242
|
+
throw new Error(`${file}: </${name}> closes <${element2?.name}>`);
|
|
1243
1243
|
continue;
|
|
1244
1244
|
}
|
|
1245
1245
|
const attributes = {};
|
|
1246
1246
|
for (const [, key, double, single] of (rawAttributes ?? "").matchAll(ATTRIBUTE))
|
|
1247
1247
|
if (key) attributes[key] = decodeXmlText(double ?? single ?? "", file);
|
|
1248
|
-
const element = { name
|
|
1248
|
+
const element = { name, attributes, children: [], text: "" };
|
|
1249
1249
|
stack.at(-1)?.children.push(element);
|
|
1250
1250
|
if (!selfClosing) stack.push(element);
|
|
1251
1251
|
}
|
|
@@ -1261,7 +1261,7 @@ function nativeAppIdentityFromAndroidManifest(source, file, files = {}) {
|
|
|
1261
1261
|
const manifest = document.children[0];
|
|
1262
1262
|
if (manifest.name !== "manifest") return null;
|
|
1263
1263
|
const androidPrefix = Object.entries(manifest.attributes).find(
|
|
1264
|
-
([
|
|
1264
|
+
([name, value]) => name.startsWith("xmlns:") && value === "http://schemas.android.com/apk/res/android"
|
|
1265
1265
|
)?.[0].slice("xmlns:".length);
|
|
1266
1266
|
if (!androidPrefix) return null;
|
|
1267
1267
|
const attribute = `${androidPrefix}:`;
|
|
@@ -1272,8 +1272,8 @@ function nativeAppIdentityFromAndroidManifest(source, file, files = {}) {
|
|
|
1272
1272
|
if (!application || !bundleIdentifier || !appVersion || !buildVersion || !/^[1-9][0-9]*$/.test(buildVersion) || [bundleIdentifier, appVersion].some((value) => /\$\{|^[@?]/.test(value)))
|
|
1273
1273
|
return null;
|
|
1274
1274
|
const toolsPrefixes = Object.entries(manifest.attributes).filter(
|
|
1275
|
-
([
|
|
1276
|
-
).map(([
|
|
1275
|
+
([name, value]) => name.startsWith("xmlns:") && value === "http://schemas.android.com/tools"
|
|
1276
|
+
).map(([name]) => `${name.slice("xmlns:".length)}:`);
|
|
1277
1277
|
const androidManifestPermissions = [];
|
|
1278
1278
|
for (const element of manifest.children) {
|
|
1279
1279
|
if (!["uses-permission", "uses-permission-sdk-23", "uses-permission-sdk-m"].includes(
|
|
@@ -1284,12 +1284,12 @@ function nativeAppIdentityFromAndroidManifest(source, file, files = {}) {
|
|
|
1284
1284
|
(key) => toolsPrefixes.some((prefix) => key.startsWith(prefix))
|
|
1285
1285
|
))
|
|
1286
1286
|
return null;
|
|
1287
|
-
const
|
|
1287
|
+
const name = element.attributes[`${attribute}name`];
|
|
1288
1288
|
const max = element.attributes[`${attribute}maxSdkVersion`];
|
|
1289
|
-
if (!
|
|
1289
|
+
if (!name || /\$\{|^[@?]/.test(name) || element.attributes[`${attribute}requiredFeature`] !== void 0 || element.attributes[`${attribute}requiredNotFeature`] !== void 0 || max !== void 0 && !/^\d+$/.test(max))
|
|
1290
1290
|
return null;
|
|
1291
1291
|
androidManifestPermissions.push({
|
|
1292
|
-
name
|
|
1292
|
+
name,
|
|
1293
1293
|
minSdkVersion: element.name === "uses-permission" ? 1 : 23,
|
|
1294
1294
|
...max === void 0 ? {} : { maxSdkVersion: Number(max) }
|
|
1295
1295
|
});
|
|
@@ -1313,15 +1313,15 @@ function nativeAppIdentityFromAndroidManifest(source, file, files = {}) {
|
|
|
1313
1313
|
const root = document2.children[0];
|
|
1314
1314
|
if (document2.children.length === 1 && root?.name === "resources") {
|
|
1315
1315
|
const qualified = Object.entries(files).filter(
|
|
1316
|
-
([
|
|
1317
|
-
).flatMap(([
|
|
1316
|
+
([name]) => name.startsWith(`${resourceDirectory}/values-`) && name.endsWith(".xml")
|
|
1317
|
+
).flatMap(([name, source2]) => parseXml(source2, name).children).flatMap((root2) => root2.children);
|
|
1318
1318
|
const visited = /* @__PURE__ */ new Set();
|
|
1319
1319
|
while (label?.startsWith("@string/") && !visited.has(label)) {
|
|
1320
1320
|
visited.add(label);
|
|
1321
|
-
const
|
|
1322
|
-
if (qualified.some((element) => element.attributes.name ===
|
|
1321
|
+
const name = label.slice("@string/".length);
|
|
1322
|
+
if (qualified.some((element) => element.attributes.name === name)) break;
|
|
1323
1323
|
const matches = root.children.filter(
|
|
1324
|
-
(element) => (element.name === "string" || element.name === "item" && element.attributes.type === "string") && element.attributes.name ===
|
|
1324
|
+
(element) => (element.name === "string" || element.name === "item" && element.attributes.type === "string") && element.attributes.name === name
|
|
1325
1325
|
);
|
|
1326
1326
|
const value = matches.length === 1 ? matches[0] : void 0;
|
|
1327
1327
|
if (!value || value.children.length) break;
|
|
@@ -1363,7 +1363,7 @@ function isRecord(value) {
|
|
|
1363
1363
|
// src/native-app-identity.ts
|
|
1364
1364
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
1365
1365
|
|
|
1366
|
-
// src/
|
|
1366
|
+
// ../peach-globals/src/bundle-global-footer.ts
|
|
1367
1367
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
1368
1368
|
|
|
1369
1369
|
// src/nativeAppIconContract.ts
|
|
@@ -1379,13 +1379,13 @@ function resolveNativeAppIconArtwork(resources, readText, resourceUri, icons, pr
|
|
|
1379
1379
|
const alternates = Object.fromEntries(
|
|
1380
1380
|
Object.entries(
|
|
1381
1381
|
isRecord(dictionary.CFBundleAlternateIcons) ? dictionary.CFBundleAlternateIcons : {}
|
|
1382
|
-
).map(([
|
|
1382
|
+
).map(([name, declaration]) => [resolveReference(name), declaration])
|
|
1383
1383
|
);
|
|
1384
1384
|
const resolve = (declaration, defaultName) => {
|
|
1385
1385
|
const entry = isRecord(declaration) ? declaration : {};
|
|
1386
|
-
const
|
|
1386
|
+
const name = typeof entry.CFBundleIconName === "string" ? resolveReference(entry.CFBundleIconName) : resolveReference(defaultName);
|
|
1387
1387
|
const catalogs = resources.filter(
|
|
1388
|
-
(file) => file.endsWith(`/${
|
|
1388
|
+
(file) => file.endsWith(`/${name}.appiconset/Contents.json`)
|
|
1389
1389
|
);
|
|
1390
1390
|
const populatedCatalogs = [];
|
|
1391
1391
|
for (const catalog of catalogs) {
|
|
@@ -1406,7 +1406,7 @@ function resolveNativeAppIconArtwork(resources, readText, resourceUri, icons, pr
|
|
|
1406
1406
|
if (catalogCandidates.length > 0) populatedCatalogs.push(catalogCandidates);
|
|
1407
1407
|
}
|
|
1408
1408
|
if (populatedCatalogs.length > 1)
|
|
1409
|
-
throw new Error(`native app icon catalog ${
|
|
1409
|
+
throw new Error(`native app icon catalog ${name} is ambiguous`);
|
|
1410
1410
|
const candidates = [];
|
|
1411
1411
|
if (populatedCatalogs.length === 1) {
|
|
1412
1412
|
candidates.push(...populatedCatalogs[0]);
|
|
@@ -1436,9 +1436,9 @@ function resolveNativeAppIconArtwork(resources, readText, resourceUri, icons, pr
|
|
|
1436
1436
|
return {
|
|
1437
1437
|
...primary.length ? { primary } : {},
|
|
1438
1438
|
alternates: Object.fromEntries(
|
|
1439
|
-
alternateNames.flatMap((
|
|
1440
|
-
const images = resolve(alternates[
|
|
1441
|
-
return images.length ? [[
|
|
1439
|
+
alternateNames.flatMap((name) => {
|
|
1440
|
+
const images = resolve(alternates[name], name);
|
|
1441
|
+
return images.length ? [[name, images]] : [];
|
|
1442
1442
|
})
|
|
1443
1443
|
)
|
|
1444
1444
|
};
|
|
@@ -1544,7 +1544,7 @@ function parseOpenStepPlist(text2) {
|
|
|
1544
1544
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
1545
1545
|
var NEVER_MEMBER = /(?:^|\/)(?:Info\.plist|[^/]+\.entitlements|[^/]+\.xcconfig|\.DS_Store)$/;
|
|
1546
1546
|
var BUNDLE_DIR = /\.(xcassets|bundle|lproj|xcdatamodeld|scnassets|spriteatlas|rcproject|storyboardc|icon)$/;
|
|
1547
|
-
function xcodePathResolver(objects, projectDir,
|
|
1547
|
+
function xcodePathResolver(objects, projectDir, join8, sourceTreeRoot) {
|
|
1548
1548
|
const parents = /* @__PURE__ */ new Map();
|
|
1549
1549
|
for (const [id, entry] of Object.entries(objects)) {
|
|
1550
1550
|
if (!isDict(entry)) continue;
|
|
@@ -1562,14 +1562,14 @@ function xcodePathResolver(objects, projectDir, join9, sourceTreeRoot) {
|
|
|
1562
1562
|
const own = str(entry.path) ?? "";
|
|
1563
1563
|
const tree2 = str(entry.sourceTree) ?? "<group>";
|
|
1564
1564
|
if (tree2 === "<absolute>") result = own;
|
|
1565
|
-
else if (tree2 === "SOURCE_ROOT") result =
|
|
1565
|
+
else if (tree2 === "SOURCE_ROOT") result = join8(projectDir, own);
|
|
1566
1566
|
else if (tree2 === "<group>") {
|
|
1567
1567
|
const parent = parents.get(id);
|
|
1568
1568
|
const base = parent ? resolve(parent) : projectDir;
|
|
1569
|
-
if (base !== null) result =
|
|
1569
|
+
if (base !== null) result = join8(base, own);
|
|
1570
1570
|
} else {
|
|
1571
1571
|
const base = sourceTreeRoot?.(tree2);
|
|
1572
|
-
if (base) result =
|
|
1572
|
+
if (base) result = join8(base, own);
|
|
1573
1573
|
}
|
|
1574
1574
|
}
|
|
1575
1575
|
paths.set(id, result);
|
|
@@ -1591,7 +1591,7 @@ function xcodeTargetMemberVisitor(objects) {
|
|
|
1591
1591
|
if (isDict(group) && group.isa === "PBXFileSystemSynchronizedRootGroup")
|
|
1592
1592
|
synchronizedGroups.push({ id, group });
|
|
1593
1593
|
}
|
|
1594
|
-
return (targetId, resolvePath, filesUnder,
|
|
1594
|
+
return (targetId, resolvePath, filesUnder, join8, visit) => {
|
|
1595
1595
|
const target = objects[targetId];
|
|
1596
1596
|
if (!isDict(target)) return;
|
|
1597
1597
|
for (const phaseId of list(target.buildPhases)) {
|
|
@@ -1626,7 +1626,7 @@ function xcodeTargetMemberVisitor(objects) {
|
|
|
1626
1626
|
for (const relative2 of list(exception.membershipExceptions))
|
|
1627
1627
|
exceptions.add(relative2);
|
|
1628
1628
|
}
|
|
1629
|
-
const members = owned.has(groupId) ? filesUnder(folder) : [...exceptions].flatMap((relative2) => filesUnder(
|
|
1629
|
+
const members = owned.has(groupId) ? filesUnder(folder) : [...exceptions].flatMap((relative2) => filesUnder(join8(folder, relative2)));
|
|
1630
1630
|
for (const file of members) {
|
|
1631
1631
|
const relative2 = file.slice(prefix.length);
|
|
1632
1632
|
const excepted = [...exceptions].some(
|
|
@@ -1775,10 +1775,10 @@ function appTargetReleaseSettings(pbxproj, targetName, infoPlistRelativePath) {
|
|
|
1775
1775
|
var APP_DELEGATE_PATH_RE = /(?:^|\/)(?:ios\/)?([^/]+)\/AppDelegate\.(?:swift|mm|m)$/;
|
|
1776
1776
|
function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri) {
|
|
1777
1777
|
const pbxprojPath = Object.keys(files).find(
|
|
1778
|
-
(
|
|
1778
|
+
(path37) => /(?:^|\/)ios\/[^/]+\.xcodeproj\/project\.pbxproj$/.test(path37)
|
|
1779
1779
|
) ?? Object.keys(files).find(
|
|
1780
|
-
(
|
|
1781
|
-
) ?? Object.keys(files).find((
|
|
1780
|
+
(path37) => /(?:^|\/)[^/]+\.xcodeproj\/project\.pbxproj$/.test(path37)
|
|
1781
|
+
) ?? Object.keys(files).find((path37) => /(?:^|\/)project\.pbxproj$/.test(path37));
|
|
1782
1782
|
if (!pbxprojPath) return null;
|
|
1783
1783
|
const pbxproj = files[pbxprojPath];
|
|
1784
1784
|
let objects = {};
|
|
@@ -1820,8 +1820,8 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
|
|
|
1820
1820
|
} else if (applicationTargetNames.size === 1) {
|
|
1821
1821
|
targetName = [...applicationTargetNames][0];
|
|
1822
1822
|
} else if (applicationTargetNames.size > 1) {
|
|
1823
|
-
const delegateTargets = Object.keys(files).filter((
|
|
1824
|
-
(
|
|
1823
|
+
const delegateTargets = Object.keys(files).filter((path37) => !path37.includes("/Pods/")).map((path37) => path37.match(APP_DELEGATE_PATH_RE)?.[1]).filter(
|
|
1824
|
+
(name) => typeof name === "string" && applicationTargetNames.has(name)
|
|
1825
1825
|
);
|
|
1826
1826
|
if (delegateTargets.length === 1) {
|
|
1827
1827
|
targetName = delegateTargets[0];
|
|
@@ -1938,8 +1938,8 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
|
|
|
1938
1938
|
const icons = dictionary.CFBundleIcons;
|
|
1939
1939
|
const alternates = isRecord(icons) ? icons.CFBundleAlternateIcons : void 0;
|
|
1940
1940
|
const alternateIconNames = /* @__PURE__ */ new Set();
|
|
1941
|
-
for (const
|
|
1942
|
-
const resolved = resolveBuildSetting(
|
|
1941
|
+
for (const name of isRecord(alternates) ? Object.keys(alternates) : []) {
|
|
1942
|
+
const resolved = resolveBuildSetting(name, settings);
|
|
1943
1943
|
if (resolved === null) throw new Error("native alternate icon name is unresolved");
|
|
1944
1944
|
alternateIconNames.add(resolved);
|
|
1945
1945
|
}
|
|
@@ -2031,7 +2031,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
|
|
|
2031
2031
|
if (resourceUri) {
|
|
2032
2032
|
if (!selectedTarget)
|
|
2033
2033
|
throw new Error("native app icon target membership is unresolved");
|
|
2034
|
-
const
|
|
2034
|
+
const join8 = (base, own) => {
|
|
2035
2035
|
const segments = [];
|
|
2036
2036
|
for (const segment of `${base}/${own}`.split("/")) {
|
|
2037
2037
|
if (segment === "" || segment === ".") continue;
|
|
@@ -2044,22 +2044,22 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
|
|
|
2044
2044
|
const project = Object.values(objects).find(
|
|
2045
2045
|
(object3) => isRecord(object3) && object3.isa === "PBXProject"
|
|
2046
2046
|
);
|
|
2047
|
-
const projectDir =
|
|
2047
|
+
const projectDir = join8(
|
|
2048
2048
|
pbxprojPath.replace(/(?:^|\/)[^/]+\.xcodeproj\/project\.pbxproj$/, ""),
|
|
2049
2049
|
isRecord(project) && typeof project.projectDirPath === "string" ? project.projectDirPath : ""
|
|
2050
2050
|
);
|
|
2051
2051
|
const paths = Object.keys(files);
|
|
2052
2052
|
xcodeTargetMemberVisitor(objects)(
|
|
2053
2053
|
selectedTarget.id,
|
|
2054
|
-
xcodePathResolver(objects, projectDir,
|
|
2054
|
+
xcodePathResolver(objects, projectDir, join8),
|
|
2055
2055
|
(file) => {
|
|
2056
2056
|
if (Object.hasOwn(files, file)) return [file];
|
|
2057
2057
|
const prefix = file === "" ? "" : `${file.replace(/\/$/, "")}/`;
|
|
2058
2058
|
return paths.filter(
|
|
2059
|
-
(
|
|
2059
|
+
(path37) => path37.startsWith(prefix) && !/(?:^|\/)\./.test(path37.slice(prefix.length))
|
|
2060
2060
|
);
|
|
2061
2061
|
},
|
|
2062
|
-
|
|
2062
|
+
join8,
|
|
2063
2063
|
(file, kind) => {
|
|
2064
2064
|
if (kind === "resource") resources.add(file);
|
|
2065
2065
|
}
|
|
@@ -2067,7 +2067,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
|
|
|
2067
2067
|
}
|
|
2068
2068
|
const rootModuleName = readRootModuleName(
|
|
2069
2069
|
Object.entries(files).filter(
|
|
2070
|
-
([
|
|
2070
|
+
([path37]) => !path37.includes("/Pods/") && (/(?:^|\/)(?:ios\/)?AppDelegate\.(?:swift|mm|m)$/.test(path37) || path37.match(APP_DELEGATE_PATH_RE)?.[1] === targetName)
|
|
2071
2071
|
).map(([, source]) => source)
|
|
2072
2072
|
);
|
|
2073
2073
|
return {
|
|
@@ -2498,7 +2498,7 @@ var WASI_EMULATION = [
|
|
|
2498
2498
|
"_WASI_EMULATED_MMAN",
|
|
2499
2499
|
"_WASI_EMULATED_PROCESS_CLOCKS"
|
|
2500
2500
|
];
|
|
2501
|
-
var WASI_EMULATION_FLAGS = WASI_EMULATION.map((
|
|
2501
|
+
var WASI_EMULATION_FLAGS = WASI_EMULATION.map((name) => `-D${name}`);
|
|
2502
2502
|
var NATIVE_GRAPH_INPUTS = {
|
|
2503
2503
|
sdk: NATIVE_GRAPH_SDK_VERSION,
|
|
2504
2504
|
settings: "e68503e5e534e9194af5efe8c636ca8b824e2d8237c5f38ec84aa4d155bc8418",
|
|
@@ -2512,8 +2512,8 @@ var NATIVE_GRAPH_ID = createHash2("sha256").update(JSON.stringify(NATIVE_GRAPH_I
|
|
|
2512
2512
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
2513
2513
|
import { execFileSync as execFileSync14 } from "node:child_process";
|
|
2514
2514
|
import { createHash as createHash20 } from "node:crypto";
|
|
2515
|
-
import
|
|
2516
|
-
import
|
|
2515
|
+
import fs16 from "node:fs";
|
|
2516
|
+
import path35 from "node:path";
|
|
2517
2517
|
import plist2 from "plist";
|
|
2518
2518
|
|
|
2519
2519
|
// src/prepared-xcode-phases.ts
|
|
@@ -2881,16 +2881,16 @@ import {
|
|
|
2881
2881
|
execFileSync as execFileSync13
|
|
2882
2882
|
} from "node:child_process";
|
|
2883
2883
|
import { createHash as createHash19 } from "node:crypto";
|
|
2884
|
-
import
|
|
2884
|
+
import fs15 from "node:fs";
|
|
2885
2885
|
import os8 from "node:os";
|
|
2886
|
-
import
|
|
2886
|
+
import path33 from "node:path";
|
|
2887
2887
|
import { promisify as promisify3 } from "node:util";
|
|
2888
2888
|
|
|
2889
2889
|
// src/swift-distribution.ts
|
|
2890
2890
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
2891
|
-
import
|
|
2891
|
+
import fs14 from "node:fs";
|
|
2892
2892
|
import os7 from "node:os";
|
|
2893
|
-
import
|
|
2893
|
+
import path32 from "node:path";
|
|
2894
2894
|
|
|
2895
2895
|
// ../contrast-runtime-delivery/src/index.ts
|
|
2896
2896
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -2936,42 +2936,11 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
|
2936
2936
|
// cli/drivers/linux-browser-libs.ts
|
|
2937
2937
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
2938
2938
|
import { spawnSync as spawnSync5 } from "node:child_process";
|
|
2939
|
-
import { existsSync as existsSync3 } from "node:fs";
|
|
2940
|
-
import { join as join6 } from "node:path";
|
|
2941
|
-
|
|
2942
|
-
// cli/cli-update.ts
|
|
2943
|
-
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
2944
|
-
import fs8 from "node:fs";
|
|
2945
|
-
import path11 from "node:path";
|
|
2946
|
-
|
|
2947
|
-
// src/automatic-update-policy.ts
|
|
2948
|
-
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
2949
2939
|
import { existsSync as existsSync2 } from "node:fs";
|
|
2950
2940
|
import { join as join5 } from "node:path";
|
|
2951
2941
|
|
|
2952
|
-
//
|
|
2942
|
+
// cli/cli-release-origin.ts
|
|
2953
2943
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
2954
|
-
import { readFileSync as readFileSync7 } from "node:fs";
|
|
2955
|
-
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
2956
|
-
|
|
2957
|
-
// src/public-brand.ts
|
|
2958
|
-
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
2959
|
-
var name = "Peach";
|
|
2960
|
-
var peachPublicBrand = Object.freeze({
|
|
2961
|
-
name,
|
|
2962
|
-
packageName: "peachsim",
|
|
2963
|
-
commandName: "peach",
|
|
2964
|
-
domain: "peachsim.com",
|
|
2965
|
-
origin: "https://peachsim.com",
|
|
2966
|
-
boxOrigin: "https://rnx-box.contrast.dev"
|
|
2967
|
-
});
|
|
2968
|
-
|
|
2969
|
-
// cli/commands/inspect/env.ts
|
|
2970
|
-
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
2971
|
-
|
|
2972
|
-
// cli/cli-update.ts
|
|
2973
|
-
var CLI_UPDATE_CHECK_INTERVAL_MS = 20 * 60 * 60 * 1e3;
|
|
2974
|
-
var CLI_UPDATE_NOTIFICATION_COOLDOWN_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
2975
2944
|
|
|
2976
2945
|
// src/swift-compile.ts
|
|
2977
2946
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -2983,11 +2952,11 @@ import { createHash as createHash17, randomUUID as randomUUID5 } from "node:cryp
|
|
|
2983
2952
|
import {
|
|
2984
2953
|
copyFileSync,
|
|
2985
2954
|
cpSync,
|
|
2986
|
-
existsSync as
|
|
2955
|
+
existsSync as existsSync7,
|
|
2987
2956
|
lstatSync,
|
|
2988
2957
|
mkdirSync as mkdirSync6,
|
|
2989
2958
|
mkdtempSync as mkdtempSync3,
|
|
2990
|
-
readFileSync as
|
|
2959
|
+
readFileSync as readFileSync19,
|
|
2991
2960
|
readdirSync as readdirSync10,
|
|
2992
2961
|
readlinkSync,
|
|
2993
2962
|
realpathSync as realpathSync5,
|
|
@@ -2999,7 +2968,7 @@ import {
|
|
|
2999
2968
|
writeFileSync as writeFileSync8
|
|
3000
2969
|
} from "node:fs";
|
|
3001
2970
|
import os6 from "node:os";
|
|
3002
|
-
import
|
|
2971
|
+
import path29 from "node:path";
|
|
3003
2972
|
import * as v5 from "valibot";
|
|
3004
2973
|
|
|
3005
2974
|
// src/admitted-mac-build.ts
|
|
@@ -3011,24 +2980,24 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
|
3011
2980
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
3012
2981
|
import { renameSync } from "node:fs";
|
|
3013
2982
|
import { rm } from "node:fs/promises";
|
|
3014
|
-
import
|
|
2983
|
+
import path11 from "node:path";
|
|
3015
2984
|
|
|
3016
2985
|
// src/process-liveness.ts
|
|
3017
2986
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3018
|
-
import { readFileSync as
|
|
2987
|
+
import { readFileSync as readFileSync7 } from "node:fs";
|
|
3019
2988
|
|
|
3020
2989
|
// src/swift-compiler-digest.ts
|
|
3021
2990
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3022
2991
|
import { createHash as createHash7 } from "node:crypto";
|
|
3023
|
-
import { readFileSync as
|
|
3024
|
-
import
|
|
2992
|
+
import { readFileSync as readFileSync8 } from "node:fs";
|
|
2993
|
+
import path12 from "node:path";
|
|
3025
2994
|
|
|
3026
2995
|
// src/swift-darwin-records.ts
|
|
3027
2996
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3028
2997
|
import { execFileSync as execFileSync4 } from "node:child_process";
|
|
3029
2998
|
import { mkdtempSync as mkdtempSync2, readdirSync as readdirSync7, rmSync as rmSync2, symlinkSync } from "node:fs";
|
|
3030
2999
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
3031
|
-
import
|
|
3000
|
+
import path14 from "node:path";
|
|
3032
3001
|
|
|
3033
3002
|
// src/swift-objc-runtime.ts
|
|
3034
3003
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -3037,8 +3006,8 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
|
3037
3006
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3038
3007
|
import { execFileSync as execFileSync3 } from "node:child_process";
|
|
3039
3008
|
import { createHash as createHash8 } from "node:crypto";
|
|
3040
|
-
import
|
|
3041
|
-
import
|
|
3009
|
+
import fs8, { readdirSync as readdirSync6, readFileSync as readFileSync9 } from "node:fs";
|
|
3010
|
+
import path13 from "node:path";
|
|
3042
3011
|
|
|
3043
3012
|
// src/swift-design-time.ts
|
|
3044
3013
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -3052,23 +3021,23 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
|
3052
3021
|
// src/swift-guest-compile.ts
|
|
3053
3022
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3054
3023
|
import { execFileSync as execFileSync9 } from "node:child_process";
|
|
3055
|
-
import { mkdirSync as mkdirSync2, readFileSync as
|
|
3056
|
-
import
|
|
3024
|
+
import { mkdirSync as mkdirSync2, readFileSync as readFileSync14, writeFileSync as writeFileSync5 } from "node:fs";
|
|
3025
|
+
import path21 from "node:path";
|
|
3057
3026
|
|
|
3058
3027
|
// src/swift-guest-archive.ts
|
|
3059
3028
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3060
3029
|
import { execFileSync as execFileSync6 } from "node:child_process";
|
|
3061
3030
|
import { createHash as createHash10 } from "node:crypto";
|
|
3062
|
-
import { mkdirSync, readFileSync as
|
|
3063
|
-
import
|
|
3031
|
+
import { mkdirSync, readFileSync as readFileSync10, rmSync as rmSync3, writeFileSync as writeFileSync3 } from "node:fs";
|
|
3032
|
+
import path16 from "node:path";
|
|
3064
3033
|
|
|
3065
3034
|
// src/swift-wasm-prune.ts
|
|
3066
3035
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3067
3036
|
import { execFileSync as execFileSync5 } from "node:child_process";
|
|
3068
3037
|
import { createHash as createHash9 } from "node:crypto";
|
|
3069
|
-
import
|
|
3038
|
+
import fs9 from "node:fs";
|
|
3070
3039
|
import os3 from "node:os";
|
|
3071
|
-
import
|
|
3040
|
+
import path15 from "node:path";
|
|
3072
3041
|
import * as v2 from "valibot";
|
|
3073
3042
|
|
|
3074
3043
|
// src/swiftRuntimeProductContract.ts
|
|
@@ -3207,8 +3176,8 @@ var OMIT_SDK_LIB_FLAGS = /* @__PURE__ */ new Set([
|
|
|
3207
3176
|
// src/swift-guest-link.ts
|
|
3208
3177
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3209
3178
|
import { execFileSync as execFileSync7 } from "node:child_process";
|
|
3210
|
-
import
|
|
3211
|
-
import
|
|
3179
|
+
import fs10 from "node:fs";
|
|
3180
|
+
import path19 from "node:path";
|
|
3212
3181
|
import { StringDecoder } from "node:string_decoder";
|
|
3213
3182
|
|
|
3214
3183
|
// src/swift-guest-image-ledger.ts
|
|
@@ -3220,7 +3189,7 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
|
3220
3189
|
// src/swift-guest-manifest.ts
|
|
3221
3190
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3222
3191
|
import { createHash as createHash11 } from "node:crypto";
|
|
3223
|
-
import { readFileSync as
|
|
3192
|
+
import { readFileSync as readFileSync11 } from "node:fs";
|
|
3224
3193
|
|
|
3225
3194
|
// src/swift-guest-projection-storage.ts
|
|
3226
3195
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -3240,13 +3209,13 @@ var maxProjectionRegions = 1 << 20;
|
|
|
3240
3209
|
// src/swift-guest-runtime-plan.ts
|
|
3241
3210
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3242
3211
|
import { createHash as createHash13 } from "node:crypto";
|
|
3243
|
-
import { readFileSync as
|
|
3244
|
-
import
|
|
3212
|
+
import { readFileSync as readFileSync12, realpathSync } from "node:fs";
|
|
3213
|
+
import path18 from "node:path";
|
|
3245
3214
|
import * as v4 from "valibot";
|
|
3246
3215
|
|
|
3247
3216
|
// src/swift-guest-source-plan.ts
|
|
3248
3217
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3249
|
-
import
|
|
3218
|
+
import path17 from "node:path";
|
|
3250
3219
|
|
|
3251
3220
|
// src/swift-runtime-products.ts
|
|
3252
3221
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -3275,13 +3244,13 @@ var packageSchema = v3.object({
|
|
|
3275
3244
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3276
3245
|
import { execFileSync as execFileSync8 } from "node:child_process";
|
|
3277
3246
|
import { createHash as createHash14 } from "node:crypto";
|
|
3278
|
-
import { readFileSync as
|
|
3279
|
-
import
|
|
3247
|
+
import { readFileSync as readFileSync13, realpathSync as realpathSync2, writeFileSync as writeFileSync4 } from "node:fs";
|
|
3248
|
+
import path20 from "node:path";
|
|
3280
3249
|
|
|
3281
3250
|
// src/wasm-optimize.ts
|
|
3282
3251
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3283
|
-
import { existsSync as
|
|
3284
|
-
import { join as
|
|
3252
|
+
import { existsSync as existsSync3 } from "node:fs";
|
|
3253
|
+
import { join as join6 } from "node:path";
|
|
3285
3254
|
import { BINARYEN_VERSION, wasmOpt } from "wasm-opt";
|
|
3286
3255
|
var FEATURES = [
|
|
3287
3256
|
"threads",
|
|
@@ -3301,10 +3270,10 @@ var WASM_OPTIMIZE_IDENTITY = `wasm-opt ${BINARYEN_VERSION} -Oz ${FEATURES.join("
|
|
|
3301
3270
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3302
3271
|
import { execFile as execFile2 } from "node:child_process";
|
|
3303
3272
|
import { createHash as createHash15, randomUUID as randomUUID3 } from "node:crypto";
|
|
3304
|
-
import { existsSync as
|
|
3273
|
+
import { existsSync as existsSync4, readFileSync as readFileSync15 } from "node:fs";
|
|
3305
3274
|
import { mkdir, readFile, rename, writeFile } from "node:fs/promises";
|
|
3306
3275
|
import os4 from "node:os";
|
|
3307
|
-
import
|
|
3276
|
+
import path22 from "node:path";
|
|
3308
3277
|
import { promisify as promisify2 } from "node:util";
|
|
3309
3278
|
import {
|
|
3310
3279
|
brotliCompress,
|
|
@@ -3317,7 +3286,7 @@ import {
|
|
|
3317
3286
|
// ../sootsim-swift/src/icuData.ts
|
|
3318
3287
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3319
3288
|
|
|
3320
|
-
// ../peach-
|
|
3289
|
+
// ../peach-kit/src/wasm-memory.ts
|
|
3321
3290
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3322
3291
|
|
|
3323
3292
|
// ../sootsim-swift/src/icuData.ts
|
|
@@ -3333,8 +3302,8 @@ var inflateGzip = promisify2(gunzip);
|
|
|
3333
3302
|
|
|
3334
3303
|
// src/swift-link-roots.ts
|
|
3335
3304
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3336
|
-
import
|
|
3337
|
-
import
|
|
3305
|
+
import fs11 from "node:fs";
|
|
3306
|
+
import path23 from "node:path";
|
|
3338
3307
|
|
|
3339
3308
|
// src/swift-objc-import.ts
|
|
3340
3309
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -3344,15 +3313,15 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
|
3344
3313
|
import { execFileSync as execFileSync10 } from "node:child_process";
|
|
3345
3314
|
import {
|
|
3346
3315
|
chmodSync,
|
|
3347
|
-
existsSync as
|
|
3316
|
+
existsSync as existsSync5,
|
|
3348
3317
|
mkdirSync as mkdirSync3,
|
|
3349
3318
|
readdirSync as readdirSync8,
|
|
3350
|
-
readFileSync as
|
|
3319
|
+
readFileSync as readFileSync16,
|
|
3351
3320
|
realpathSync as realpathSync3,
|
|
3352
3321
|
rmSync as rmSync4,
|
|
3353
3322
|
statSync as statSync2
|
|
3354
3323
|
} from "node:fs";
|
|
3355
|
-
import
|
|
3324
|
+
import path24 from "node:path";
|
|
3356
3325
|
|
|
3357
3326
|
// src/swift-reproducible.ts
|
|
3358
3327
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -3369,30 +3338,30 @@ import {
|
|
|
3369
3338
|
linkSync,
|
|
3370
3339
|
mkdirSync as mkdirSync4,
|
|
3371
3340
|
readdirSync as readdirSync9,
|
|
3372
|
-
readFileSync as
|
|
3341
|
+
readFileSync as readFileSync17,
|
|
3373
3342
|
rmSync as rmSync5,
|
|
3374
3343
|
writeFileSync as writeFileSync6
|
|
3375
3344
|
} from "node:fs";
|
|
3376
3345
|
import { homedir as homedir2 } from "node:os";
|
|
3377
|
-
import
|
|
3346
|
+
import path25 from "node:path";
|
|
3378
3347
|
|
|
3379
3348
|
// src/swift-uniform-type-constants.ts
|
|
3380
3349
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3381
3350
|
import { execFileSync as execFileSync11 } from "node:child_process";
|
|
3382
|
-
import
|
|
3351
|
+
import path26 from "node:path";
|
|
3383
3352
|
|
|
3384
3353
|
// src/swiftContract.ts
|
|
3385
3354
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3386
3355
|
|
|
3387
3356
|
// src/write-build-file.ts
|
|
3388
3357
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3389
|
-
import { existsSync as
|
|
3390
|
-
import
|
|
3358
|
+
import { existsSync as existsSync6, mkdirSync as mkdirSync5, readFileSync as readFileSync18, writeFileSync as writeFileSync7 } from "node:fs";
|
|
3359
|
+
import path27 from "node:path";
|
|
3391
3360
|
|
|
3392
3361
|
// src/xcode-header-search.ts
|
|
3393
3362
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3394
|
-
import
|
|
3395
|
-
import
|
|
3363
|
+
import fs12 from "node:fs";
|
|
3364
|
+
import path28 from "node:path";
|
|
3396
3365
|
|
|
3397
3366
|
// src/swift-compile.ts
|
|
3398
3367
|
var OPTIONAL_FRAMEWORK_DEPENDENCIES = {
|
|
@@ -3468,7 +3437,7 @@ var FOUNDATION_IMPLICIT_MODULES = [
|
|
|
3468
3437
|
var FOUNDATION_IMPLICIT_FLAGS = FOUNDATION_IMPLICIT_MODULES.map(
|
|
3469
3438
|
(module) => `, "-Xfrontend", "-import-module", "-Xfrontend", "${module}"`
|
|
3470
3439
|
).join("");
|
|
3471
|
-
var compilerSourceDigest = true ? "
|
|
3440
|
+
var compilerSourceDigest = true ? "91c8105b0a382e74c2395d36f69294e1ec6afa3aa0b66c61b6b11e63e0dbe5d7" : swiftCompilerSourceDigest(import.meta.dirname);
|
|
3472
3441
|
var CORE_FOUNDATION_HANDLE_IMPORTS = [
|
|
3473
3442
|
"CFAllocator",
|
|
3474
3443
|
"CFArray",
|
|
@@ -3483,7 +3452,7 @@ var CORE_FOUNDATION_HANDLE_IMPORTS = [
|
|
|
3483
3452
|
"CFSet",
|
|
3484
3453
|
"CFString",
|
|
3485
3454
|
"CFURL"
|
|
3486
|
-
].map((
|
|
3455
|
+
].map((name) => `import class CoreFoundation.${name}`).concat([
|
|
3487
3456
|
"import typealias CoreFoundation.CFPropertyList",
|
|
3488
3457
|
"import typealias CoreFoundation.CFTypeRef",
|
|
3489
3458
|
"import CoreGraphics"
|
|
@@ -3498,32 +3467,32 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
|
3498
3467
|
|
|
3499
3468
|
// src/answeredNativePackages.ts
|
|
3500
3469
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3501
|
-
import { readFileSync as
|
|
3502
|
-
import { join as
|
|
3470
|
+
import { readFileSync as readFileSync20 } from "node:fs";
|
|
3471
|
+
import { join as join7 } from "node:path";
|
|
3503
3472
|
|
|
3504
3473
|
// src/runtime-assets.ts
|
|
3505
3474
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3506
|
-
import
|
|
3507
|
-
import
|
|
3508
|
-
import { fileURLToPath as
|
|
3475
|
+
import fs13 from "fs";
|
|
3476
|
+
import path30 from "path";
|
|
3477
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
3509
3478
|
|
|
3510
3479
|
// src/nitroAdapterContract.ts
|
|
3511
3480
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3512
3481
|
import { createHash as createHash18 } from "node:crypto";
|
|
3513
|
-
import { readdirSync as readdirSync11, readFileSync as
|
|
3514
|
-
import
|
|
3482
|
+
import { readdirSync as readdirSync11, readFileSync as readFileSync21 } from "node:fs";
|
|
3483
|
+
import path31 from "node:path";
|
|
3515
3484
|
|
|
3516
3485
|
// src/swiftNativePinContract.ts
|
|
3517
3486
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3518
3487
|
|
|
3519
3488
|
// src/swift-package-manifest.ts
|
|
3520
|
-
var cacheDir3 =
|
|
3489
|
+
var cacheDir3 = path33.join(cacheDir(), "swift-manifests");
|
|
3521
3490
|
var execFileAsync = promisify3(execFile3);
|
|
3522
3491
|
|
|
3523
3492
|
// src/xcode-json-project.ts
|
|
3524
3493
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3525
3494
|
var import_json5 = __toESM(require_lib(), 1);
|
|
3526
|
-
import
|
|
3495
|
+
import path34 from "node:path";
|
|
3527
3496
|
var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3528
3497
|
var text = (value) => typeof value === "string" ? value : void 0;
|
|
3529
3498
|
var items = (value) => Array.isArray(value) ? value : [];
|
|
@@ -3580,7 +3549,7 @@ var PHASE_ISA = {
|
|
|
3580
3549
|
function readXcodeJsonProject(xcodeproj, source) {
|
|
3581
3550
|
const json = import_json5.default.parse(source);
|
|
3582
3551
|
if (!isJsonObject(json)) throw new Error(`${xcodeproj}/project.xcproj is not an object`);
|
|
3583
|
-
const projectDir =
|
|
3552
|
+
const projectDir = path34.dirname(xcodeproj);
|
|
3584
3553
|
const objects = {};
|
|
3585
3554
|
let next = 0;
|
|
3586
3555
|
const add = (entry, id) => {
|
|
@@ -3593,7 +3562,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
3593
3562
|
const base = /^<([A-Z]+)>\/(.*)$/.exec(raw);
|
|
3594
3563
|
if (base) {
|
|
3595
3564
|
if (base[1] === "PROJECT")
|
|
3596
|
-
return { sourceTree: "<absolute>", path:
|
|
3565
|
+
return { sourceTree: "<absolute>", path: path34.join(projectDir, base[2]) };
|
|
3597
3566
|
if (base[1] === "PRODUCTS")
|
|
3598
3567
|
return { sourceTree: "BUILT_PRODUCTS_DIR", path: base[2] };
|
|
3599
3568
|
return null;
|
|
@@ -3601,7 +3570,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
3601
3570
|
const unescaped = raw.replaceAll("\\<", "<");
|
|
3602
3571
|
if (unescaped.startsWith("/")) return { sourceTree: "<absolute>", path: unescaped };
|
|
3603
3572
|
if (unescaped.startsWith("~")) return null;
|
|
3604
|
-
return groupDir === null ? null : { sourceTree: "<absolute>", path:
|
|
3573
|
+
return groupDir === null ? null : { sourceTree: "<absolute>", path: path34.join(groupDir, unescaped) };
|
|
3605
3574
|
};
|
|
3606
3575
|
const memberships = [];
|
|
3607
3576
|
const folders = [];
|
|
@@ -3612,8 +3581,8 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
3612
3581
|
const kind = text(entry.kind) ?? "file-reference";
|
|
3613
3582
|
const raw = text(entry.path) ?? "";
|
|
3614
3583
|
const located = raw === "" ? null : locate(raw, parent.dir);
|
|
3615
|
-
const
|
|
3616
|
-
const node = { id: "", name
|
|
3584
|
+
const name = text(entry.name) ?? path34.basename(raw);
|
|
3585
|
+
const node = { id: "", name, dir: null, parent, children: [] };
|
|
3617
3586
|
if (kind === "group" || kind === "variant-group" || kind === "version-group") {
|
|
3618
3587
|
node.dir = raw === "" ? parent.dir : located?.sourceTree === "<absolute>" ? located.path : null;
|
|
3619
3588
|
const childIds = walk(items(entry.children), node);
|
|
@@ -3626,7 +3595,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
3626
3595
|
isa: kind === "variant-group" ? "PBXVariantGroup" : "PBXGroup",
|
|
3627
3596
|
children: childIds,
|
|
3628
3597
|
...kind === "variant-group" ? {} : { sourceTree: "<absolute>", path: node.dir ?? "" },
|
|
3629
|
-
name
|
|
3598
|
+
name
|
|
3630
3599
|
},
|
|
3631
3600
|
text(entry.id)
|
|
3632
3601
|
);
|
|
@@ -3644,7 +3613,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
3644
3613
|
{
|
|
3645
3614
|
isa: "PBXFileReference",
|
|
3646
3615
|
...located ?? { sourceTree: "SDKROOT", path: raw },
|
|
3647
|
-
name
|
|
3616
|
+
name
|
|
3648
3617
|
},
|
|
3649
3618
|
text(entry.id)
|
|
3650
3619
|
);
|
|
@@ -3696,8 +3665,8 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
3696
3665
|
return node;
|
|
3697
3666
|
};
|
|
3698
3667
|
const configurations = items(json.configurations).flatMap((entry) => {
|
|
3699
|
-
const
|
|
3700
|
-
return
|
|
3668
|
+
const name = isObject(entry) ? text(entry.name) : text(entry);
|
|
3669
|
+
return name ? [{ name, file: isObject(entry) ? entry.file : void 0 }] : [];
|
|
3701
3670
|
});
|
|
3702
3671
|
const settingsOf = (value) => Object.fromEntries(
|
|
3703
3672
|
Object.entries(isObject(value) ? value : {}).flatMap(
|
|
@@ -3712,14 +3681,14 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
3712
3681
|
const configurationList = (settings, specialized) => add({
|
|
3713
3682
|
isa: "XCConfigurationList",
|
|
3714
3683
|
defaultConfigurationName: text(json["default-configuration"]) ?? "Debug",
|
|
3715
|
-
buildConfigurations: configurations.map(({ name
|
|
3716
|
-
const reference = specialized.has(
|
|
3684
|
+
buildConfigurations: configurations.map(({ name, file }) => {
|
|
3685
|
+
const reference = specialized.has(name) ? specialized.get(name) : file;
|
|
3717
3686
|
const base = lookup(reference);
|
|
3718
3687
|
const anchor = isObject(reference) ? lookupNode(reference.anchor, root)?.id : null;
|
|
3719
3688
|
const relative2 = isObject(reference) ? text(reference["relative-path"]) : null;
|
|
3720
3689
|
return add({
|
|
3721
3690
|
isa: "XCBuildConfiguration",
|
|
3722
|
-
name
|
|
3691
|
+
name,
|
|
3723
3692
|
buildSettings: settings,
|
|
3724
3693
|
...base ? { baseConfigurationReference: base } : anchor && relative2 ? {
|
|
3725
3694
|
baseConfigurationReferenceAnchor: anchor,
|
|
@@ -3733,13 +3702,13 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
3733
3702
|
if (!isObject(entry)) continue;
|
|
3734
3703
|
const repository = text(entry.repository);
|
|
3735
3704
|
const local = text(entry.path);
|
|
3736
|
-
const
|
|
3705
|
+
const name = local !== void 0 ? path34.basename(path34.resolve(path34.dirname(xcodeproj), local)) : path34.basename(repository ?? "").replace(/\.git$/, "");
|
|
3737
3706
|
const id = text(entry.kind) === "local" && local !== void 0 ? add({ isa: "XCLocalSwiftPackageReference", relativePath: local }) : add({
|
|
3738
3707
|
isa: "XCRemoteSwiftPackageReference",
|
|
3739
3708
|
repositoryURL: repository ?? "",
|
|
3740
3709
|
...remoteVersionRequirement(entry)
|
|
3741
3710
|
});
|
|
3742
|
-
packageIds.set(
|
|
3711
|
+
packageIds.set(name.toLowerCase(), id);
|
|
3743
3712
|
}
|
|
3744
3713
|
const productDependency = (entry) => add({
|
|
3745
3714
|
isa: "XCSwiftPackageProductDependency",
|
|
@@ -3759,12 +3728,12 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
3759
3728
|
const targets = [];
|
|
3760
3729
|
for (const entry of items(json.targets)) {
|
|
3761
3730
|
if (!isObject(entry)) continue;
|
|
3762
|
-
const
|
|
3731
|
+
const name = text(entry.name) ?? "";
|
|
3763
3732
|
const productType = text(entry["product-type"]);
|
|
3764
3733
|
const target = {
|
|
3765
3734
|
isa: text(entry.kind) === "aggregate" ? "PBXAggregateTarget" : "PBXNativeTarget",
|
|
3766
|
-
name
|
|
3767
|
-
productName:
|
|
3735
|
+
name,
|
|
3736
|
+
productName: name,
|
|
3768
3737
|
productType: productType ? `com.apple.product-type.${productType}` : text(entry["full-product-type"]) ?? "",
|
|
3769
3738
|
buildPhases: [],
|
|
3770
3739
|
dependencies: [],
|
|
@@ -3774,7 +3743,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
3774
3743
|
const product = lookup(entry.product);
|
|
3775
3744
|
if (product) target.productReference = product;
|
|
3776
3745
|
const id = add(target, text(entry.id));
|
|
3777
|
-
targetIds.set(
|
|
3746
|
+
targetIds.set(name, id);
|
|
3778
3747
|
targets.push({ id, target, entry });
|
|
3779
3748
|
for (const phase of items(entry["build-phases"])) {
|
|
3780
3749
|
const kind = isObject(phase) ? text(phase.kind) : text(phase);
|
|
@@ -3786,7 +3755,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
3786
3755
|
isObject(phase) ? text(phase.id) : void 0
|
|
3787
3756
|
);
|
|
3788
3757
|
target.buildPhases.push(phaseId);
|
|
3789
|
-
phases.set([
|
|
3758
|
+
phases.set([name, kind, phaseName].filter(Boolean).join("/"), phaseId);
|
|
3790
3759
|
phases.set(`id:${phaseId}`, phaseId);
|
|
3791
3760
|
}
|
|
3792
3761
|
}
|
|
@@ -3802,7 +3771,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
3802
3771
|
files?.push(add({ isa: "PBXBuildFile", fileRef: refId }));
|
|
3803
3772
|
}
|
|
3804
3773
|
for (const { target, entry } of targets) {
|
|
3805
|
-
const
|
|
3774
|
+
const name = text(entry.name) ?? "";
|
|
3806
3775
|
target.buildConfigurationList = configurationList(
|
|
3807
3776
|
settingsOf(entry["build-settings"]),
|
|
3808
3777
|
new Map(
|
|
@@ -3840,7 +3809,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
3840
3809
|
const dependency = productDependency(member);
|
|
3841
3810
|
target.packageProductDependencies.push(dependency);
|
|
3842
3811
|
const buildFile = member["build-phase"];
|
|
3843
|
-
phaseFiles(isObject(buildFile) ? buildFile["build-phase"] : buildFile,
|
|
3812
|
+
phaseFiles(isObject(buildFile) ? buildFile["build-phase"] : buildFile, name)?.push(
|
|
3844
3813
|
add({ isa: "PBXBuildFile", productRef: dependency })
|
|
3845
3814
|
);
|
|
3846
3815
|
}
|
|
@@ -3953,28 +3922,28 @@ var CONDITIONS = {
|
|
|
3953
3922
|
variant: "normal"
|
|
3954
3923
|
};
|
|
3955
3924
|
function walkFiles(dir) {
|
|
3956
|
-
if (!
|
|
3925
|
+
if (!fs16.existsSync(dir)) return [];
|
|
3957
3926
|
const out = [];
|
|
3958
|
-
for (const entry of
|
|
3927
|
+
for (const entry of fs16.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name))) {
|
|
3959
3928
|
if (entry.name.startsWith(".")) continue;
|
|
3960
|
-
const full =
|
|
3929
|
+
const full = path35.join(dir, entry.name);
|
|
3961
3930
|
if (entry.isDirectory()) out.push(...walkFiles(full));
|
|
3962
3931
|
else if (entry.isFile()) out.push(full);
|
|
3963
3932
|
}
|
|
3964
3933
|
return out;
|
|
3965
3934
|
}
|
|
3966
|
-
var isDirectory = (dir) =>
|
|
3935
|
+
var isDirectory = (dir) => fs16.existsSync(dir) && fs16.statSync(dir).isDirectory();
|
|
3967
3936
|
function readXcconfig(file, read) {
|
|
3968
|
-
if (read.includes(file) || !
|
|
3937
|
+
if (read.includes(file) || !fs16.existsSync(file)) return {};
|
|
3969
3938
|
read.push(file);
|
|
3970
3939
|
const settings = {};
|
|
3971
|
-
for (const raw of
|
|
3940
|
+
for (const raw of fs16.readFileSync(file, "utf8").split("\n")) {
|
|
3972
3941
|
const line = raw.replace(/\/\/.*$/, "").trim();
|
|
3973
3942
|
const include = /^#include\??\s+"([^"]+)"/.exec(line);
|
|
3974
3943
|
if (include) {
|
|
3975
3944
|
Object.assign(
|
|
3976
3945
|
settings,
|
|
3977
|
-
readXcconfig(
|
|
3946
|
+
readXcconfig(path35.resolve(path35.dirname(file), include[1]), read)
|
|
3978
3947
|
);
|
|
3979
3948
|
continue;
|
|
3980
3949
|
}
|
|
@@ -3994,8 +3963,8 @@ function applyConditions(raw, configuration) {
|
|
|
3994
3963
|
continue;
|
|
3995
3964
|
}
|
|
3996
3965
|
const matches = [...key.slice(bracket).matchAll(/\[([^=\]]+)=([^\]]*)\]/g)].every(
|
|
3997
|
-
([,
|
|
3998
|
-
const actual =
|
|
3966
|
+
([, name, pattern]) => {
|
|
3967
|
+
const actual = name === "config" ? configuration : CONDITIONS[name];
|
|
3999
3968
|
return actual !== void 0 && new RegExp(
|
|
4000
3969
|
`^${pattern.replace(/[.+^${}()|\\]/g, "\\$&").replaceAll("*", ".*").replaceAll("?", ".")}$`
|
|
4001
3970
|
).test(actual);
|
|
@@ -4024,22 +3993,22 @@ function decodeXml(text2) {
|
|
|
4024
3993
|
return text2.replaceAll(""", '"').replaceAll("'", "'").replaceAll("<", "<").replaceAll(">", ">").replaceAll("&", "&");
|
|
4025
3994
|
}
|
|
4026
3995
|
function workspaceReferences(workspace) {
|
|
4027
|
-
const data =
|
|
4028
|
-
if (!
|
|
3996
|
+
const data = path35.join(workspace, "contents.xcworkspacedata");
|
|
3997
|
+
if (!fs16.existsSync(data))
|
|
4029
3998
|
throw new Error(`${workspace} has no contents.xcworkspacedata`);
|
|
4030
|
-
const container =
|
|
3999
|
+
const container = path35.dirname(workspace);
|
|
4031
4000
|
const locate = (location, base) => {
|
|
4032
4001
|
const colon = location.indexOf(":");
|
|
4033
4002
|
const kind = location.slice(0, colon);
|
|
4034
4003
|
const rest = location.slice(colon + 1);
|
|
4035
|
-
if (kind === "group") return
|
|
4036
|
-
if (kind === "container" || kind === "self") return
|
|
4037
|
-
if (kind === "absolute") return
|
|
4038
|
-
throw new Error(`${
|
|
4004
|
+
if (kind === "group") return path35.resolve(base, rest);
|
|
4005
|
+
if (kind === "container" || kind === "self") return path35.resolve(container, rest);
|
|
4006
|
+
if (kind === "absolute") return path35.resolve(rest);
|
|
4007
|
+
throw new Error(`${path35.basename(workspace)} has an unsupported location ${location}`);
|
|
4039
4008
|
};
|
|
4040
4009
|
const groups = [container];
|
|
4041
4010
|
const references = [];
|
|
4042
|
-
for (const [, closing, tag, attributes, selfClosing] of
|
|
4011
|
+
for (const [, closing, tag, attributes, selfClosing] of fs16.readFileSync(data, "utf8").matchAll(/<(\/?)(Group|FileRef)\b([^>]*?)(\/?)>/g)) {
|
|
4043
4012
|
if (closing) {
|
|
4044
4013
|
if (tag === "Group") groups.pop();
|
|
4045
4014
|
continue;
|
|
@@ -4089,9 +4058,9 @@ function remotePackageRequirements(projects) {
|
|
|
4089
4058
|
}
|
|
4090
4059
|
var loaded = /* @__PURE__ */ new Map();
|
|
4091
4060
|
function xcodeProjectFile(xcodeproj) {
|
|
4092
|
-
for (const
|
|
4093
|
-
const file =
|
|
4094
|
-
if (
|
|
4061
|
+
for (const name of ["project.pbxproj", "project.xcproj"]) {
|
|
4062
|
+
const file = path35.join(xcodeproj, name);
|
|
4063
|
+
if (fs16.existsSync(file)) return file;
|
|
4095
4064
|
}
|
|
4096
4065
|
return null;
|
|
4097
4066
|
}
|
|
@@ -4099,7 +4068,7 @@ function loadProject(xcodeproj) {
|
|
|
4099
4068
|
const projectFile = xcodeProjectFile(xcodeproj);
|
|
4100
4069
|
if (!projectFile)
|
|
4101
4070
|
throw new Error(`${xcodeproj} has no project.pbxproj or project.xcproj`);
|
|
4102
|
-
const source =
|
|
4071
|
+
const source = fs16.readFileSync(projectFile, "utf8");
|
|
4103
4072
|
const digest = createHash20("sha256").update(source).digest("hex");
|
|
4104
4073
|
const cached = loaded.get(projectFile);
|
|
4105
4074
|
if (cached?.digest === digest) return cached.project;
|
|
@@ -4116,10 +4085,10 @@ function loadProject(xcodeproj) {
|
|
|
4116
4085
|
if (!project || project.isa !== "PBXProject") {
|
|
4117
4086
|
throw new Error(`${projectFile} has no PBXProject root`);
|
|
4118
4087
|
}
|
|
4119
|
-
const projectDir =
|
|
4120
|
-
|
|
4088
|
+
const projectDir = fs16.realpathSync.native(
|
|
4089
|
+
path35.resolve(path35.dirname(xcodeproj), str(project.projectDirPath) ?? "")
|
|
4121
4090
|
);
|
|
4122
|
-
const resolvePath = xcodePathResolver(objects, projectDir,
|
|
4091
|
+
const resolvePath = xcodePathResolver(objects, projectDir, path35.join);
|
|
4123
4092
|
const result = {
|
|
4124
4093
|
xcodeproj,
|
|
4125
4094
|
projectFile,
|
|
@@ -4150,14 +4119,14 @@ function targetSettings(ref, configuration, builtins, options = {}, overrides =
|
|
|
4150
4119
|
};
|
|
4151
4120
|
const level = (config) => {
|
|
4152
4121
|
if (!config) return [];
|
|
4153
|
-
const
|
|
4122
|
+
const name = str(config.name) ?? configuration;
|
|
4154
4123
|
const base = str(config.baseConfigurationReference);
|
|
4155
4124
|
const anchor = str(config.baseConfigurationReferenceAnchor);
|
|
4156
4125
|
const relative2 = str(config.baseConfigurationReferenceRelativePath);
|
|
4157
4126
|
const own = isDict(config.buildSettings) ? config.buildSettings : {};
|
|
4158
4127
|
const directory = anchor ? project.resolvePath(anchor) : null;
|
|
4159
|
-
const baseFile = base ? project.resolvePath(base) : directory && relative2 ?
|
|
4160
|
-
if (options.requireSources !== false && (base || anchor || relative2) && (!baseFile || !
|
|
4128
|
+
const baseFile = base ? project.resolvePath(base) : directory && relative2 ? path35.resolve(directory, relative2) : null;
|
|
4129
|
+
if (options.requireSources !== false && (base || anchor || relative2) && (!baseFile || !fs16.existsSync(baseFile)))
|
|
4161
4130
|
throw new Error(
|
|
4162
4131
|
`Unable to open base configuration reference file '${baseFile ?? base ?? relative2 ?? anchor}'`
|
|
4163
4132
|
);
|
|
@@ -4165,14 +4134,14 @@ function targetSettings(ref, configuration, builtins, options = {}, overrides =
|
|
|
4165
4134
|
const fromFile = baseFile ? readXcconfig(baseFile, read) : {};
|
|
4166
4135
|
xcconfigs.push(...read);
|
|
4167
4136
|
return [
|
|
4168
|
-
...applyConditions(fromFile,
|
|
4137
|
+
...applyConditions(fromFile, name),
|
|
4169
4138
|
...applyConditions(
|
|
4170
4139
|
Object.fromEntries(
|
|
4171
4140
|
Object.entries(own).flatMap(
|
|
4172
4141
|
([key, value]) => typeof value === "string" ? [[key, value]] : Array.isArray(value) ? [[key, list(value).join(" ")]] : []
|
|
4173
4142
|
)
|
|
4174
4143
|
),
|
|
4175
|
-
|
|
4144
|
+
name
|
|
4176
4145
|
)
|
|
4177
4146
|
];
|
|
4178
4147
|
};
|
|
@@ -4194,7 +4163,7 @@ function targetSettings(ref, configuration, builtins, options = {}, overrides =
|
|
|
4194
4163
|
resolving.add(marker);
|
|
4195
4164
|
const value = expand(
|
|
4196
4165
|
levels[at][key],
|
|
4197
|
-
(
|
|
4166
|
+
(name) => name === "inherited" || name === key ? valueAt(key, at - 1) : valueAt(name, levels.length - 1)
|
|
4198
4167
|
);
|
|
4199
4168
|
resolving.delete(marker);
|
|
4200
4169
|
return value;
|
|
@@ -4255,26 +4224,26 @@ function scriptCommand(shell, script) {
|
|
|
4255
4224
|
return [executable, ...args, "-c", script];
|
|
4256
4225
|
}
|
|
4257
4226
|
function expandSearchPath(directory, rules2) {
|
|
4258
|
-
if (
|
|
4227
|
+
if (path35.basename(directory) !== "**") return [directory];
|
|
4259
4228
|
const expanded = [];
|
|
4260
4229
|
const seen = /* @__PURE__ */ new Set();
|
|
4261
|
-
const queue = [
|
|
4230
|
+
const queue = [path35.dirname(directory)];
|
|
4262
4231
|
for (let at = 0; at < queue.length; at++) {
|
|
4263
4232
|
const current = queue[at];
|
|
4264
4233
|
let real;
|
|
4265
4234
|
try {
|
|
4266
|
-
real =
|
|
4235
|
+
real = fs16.realpathSync.native(current);
|
|
4267
4236
|
} catch {
|
|
4268
4237
|
continue;
|
|
4269
4238
|
}
|
|
4270
|
-
if (!
|
|
4239
|
+
if (!fs16.statSync(real).isDirectory() || seen.has(real)) continue;
|
|
4271
4240
|
seen.add(real);
|
|
4272
4241
|
expanded.push(current);
|
|
4273
|
-
for (const entry of
|
|
4242
|
+
for (const entry of fs16.readdirSync(real, { withFileTypes: true }).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
|
|
4274
4243
|
if (entry.isSymbolicLink() ? !rules2.followLinks : !entry.isDirectory()) continue;
|
|
4275
4244
|
if (rules2.excluded.some((pattern) => pattern.test(entry.name)) && !rules2.included.some((pattern) => pattern.test(entry.name)))
|
|
4276
4245
|
continue;
|
|
4277
|
-
queue.push(
|
|
4246
|
+
queue.push(path35.join(current, entry.name));
|
|
4278
4247
|
}
|
|
4279
4248
|
}
|
|
4280
4249
|
return expanded;
|
|
@@ -4309,9 +4278,9 @@ function expand(value, lookup) {
|
|
|
4309
4278
|
return value.replace(
|
|
4310
4279
|
/\$(?:\(([A-Za-z_][A-Za-z0-9_]*)((?::[^)]*)?)\)|\{([A-Za-z_][A-Za-z0-9_]*)((?::[^}]*)?)\}|([A-Za-z_][A-Za-z0-9_]*))/g,
|
|
4311
4280
|
(_match, paren, parenOps, brace, braceOps, bare) => {
|
|
4312
|
-
const
|
|
4281
|
+
const name = paren ?? brace ?? bare;
|
|
4313
4282
|
const operators = parenOps ?? braceOps ?? "";
|
|
4314
|
-
return operators.split(":").slice(1).reduce((current, operator) => applyOperator(current, operator), lookup(
|
|
4283
|
+
return operators.split(":").slice(1).reduce((current, operator) => applyOperator(current, operator), lookup(name));
|
|
4315
4284
|
}
|
|
4316
4285
|
);
|
|
4317
4286
|
}
|
|
@@ -4345,7 +4314,7 @@ function shellAssetCatalogs(script, settings, projectDir) {
|
|
|
4345
4314
|
for (const token of tokens) {
|
|
4346
4315
|
if (token.startsWith("-")) break;
|
|
4347
4316
|
const file = resolve(token);
|
|
4348
|
-
if (file?.endsWith(".xcassets")) catalogs.push(
|
|
4317
|
+
if (file?.endsWith(".xcassets")) catalogs.push(path35.resolve(projectDir, file));
|
|
4349
4318
|
}
|
|
4350
4319
|
}
|
|
4351
4320
|
return catalogs;
|
|
@@ -4354,8 +4323,8 @@ function shellCopies(script, settings, projectDir) {
|
|
|
4354
4323
|
const assigned = /* @__PURE__ */ new Map();
|
|
4355
4324
|
const copies = [];
|
|
4356
4325
|
let resolved = true;
|
|
4357
|
-
const lookup = (
|
|
4358
|
-
const value = assigned.get(
|
|
4326
|
+
const lookup = (name) => {
|
|
4327
|
+
const value = assigned.get(name) ?? settings(name);
|
|
4359
4328
|
if (value === "") resolved = false;
|
|
4360
4329
|
return value;
|
|
4361
4330
|
};
|
|
@@ -4390,14 +4359,14 @@ function shellCopies(script, settings, projectDir) {
|
|
|
4390
4359
|
if (operands.length !== 2 || operands.some((operand) => operand.startsWith("-")))
|
|
4391
4360
|
return [];
|
|
4392
4361
|
copies.push({
|
|
4393
|
-
from:
|
|
4394
|
-
to:
|
|
4362
|
+
from: path35.resolve(projectDir, operands[0]),
|
|
4363
|
+
to: path35.resolve(projectDir, operands[1])
|
|
4395
4364
|
});
|
|
4396
4365
|
}
|
|
4397
4366
|
return copies;
|
|
4398
4367
|
}
|
|
4399
4368
|
function fileListEntries(file, absolute) {
|
|
4400
|
-
return
|
|
4369
|
+
return fs16.readFileSync(file, "utf8").split(/\r?\n/).map((line) => line.trim()).filter((line) => line !== "" && !line.startsWith("#")).map(absolute);
|
|
4401
4370
|
}
|
|
4402
4371
|
function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
4403
4372
|
const { project, target, id: targetId } = ref;
|
|
@@ -4410,7 +4379,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
4410
4379
|
const copiedFiles = [];
|
|
4411
4380
|
let generatedInfoPlist = false;
|
|
4412
4381
|
const declaredInfoPlist = settings("INFOPLIST_FILE");
|
|
4413
|
-
const infoPlistOutput = declaredInfoPlist ?
|
|
4382
|
+
const infoPlistOutput = declaredInfoPlist ? path35.resolve(project.projectDir, declaredInfoPlist) : null;
|
|
4414
4383
|
const isPreparedOutput = (file) => file === infoPlistOutput || options.requireSources !== false && file.endsWith(".swift");
|
|
4415
4384
|
for (const phaseId of list(target.buildPhases)) {
|
|
4416
4385
|
const phase = project.object(phaseId);
|
|
@@ -4425,7 +4394,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
4425
4394
|
copiedFiles.push(
|
|
4426
4395
|
...shellCopies(str(phase.shellScript) ?? "", settings, project.projectDir)
|
|
4427
4396
|
);
|
|
4428
|
-
const absolute = (raw) =>
|
|
4397
|
+
const absolute = (raw) => path35.resolve(project.projectDir, expand(raw, settings));
|
|
4429
4398
|
const inputs = list(phase.inputPaths).map(absolute);
|
|
4430
4399
|
const outputs = list(phase.outputPaths).map(absolute);
|
|
4431
4400
|
const fileLists = /* @__PURE__ */ new Map();
|
|
@@ -4434,7 +4403,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
4434
4403
|
kind === "INPUT" ? phase.inputFileListPaths : phase.outputFileListPaths
|
|
4435
4404
|
).map((raw) => {
|
|
4436
4405
|
const file = absolute(raw);
|
|
4437
|
-
if (!
|
|
4406
|
+
if (!fs16.existsSync(file)) {
|
|
4438
4407
|
return { file, entries: [] };
|
|
4439
4408
|
}
|
|
4440
4409
|
return { file, entries: fileListEntries(file, absolute) };
|
|
@@ -4455,7 +4424,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
4455
4424
|
...fileLists.get("OUTPUT").map((item) => item.file)
|
|
4456
4425
|
];
|
|
4457
4426
|
if (allOutputs.some((file) => file.endsWith(".swift") || file === infoPlistOutput)) {
|
|
4458
|
-
for (const file of inputFiles) if (
|
|
4427
|
+
for (const file of inputFiles) if (fs16.existsSync(file)) projectInputs.add(file);
|
|
4459
4428
|
}
|
|
4460
4429
|
if (options.prepareGeneratedSources === true && allOutputs.some(isPreparedOutput)) {
|
|
4461
4430
|
const configuration = settings("CONFIGURATION");
|
|
@@ -4468,10 +4437,10 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
4468
4437
|
false
|
|
4469
4438
|
))
|
|
4470
4439
|
continue;
|
|
4471
|
-
const phaseDir =
|
|
4440
|
+
const phaseDir = path35.join(settings("TARGET_TEMP_DIR"), `Script-${phaseId}`);
|
|
4472
4441
|
for (const lists of fileLists.values())
|
|
4473
4442
|
for (const { file } of lists)
|
|
4474
|
-
if (!
|
|
4443
|
+
if (!fs16.existsSync(file))
|
|
4475
4444
|
throw new Error(
|
|
4476
4445
|
`${targetName}: Run Script "${script}" missing file list ${file}`
|
|
4477
4446
|
);
|
|
@@ -4490,7 +4459,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
4490
4459
|
const lists = fileLists.get(kind);
|
|
4491
4460
|
env[`SCRIPT_${kind}_FILE_LIST_COUNT`] = String(lists.length);
|
|
4492
4461
|
lists.forEach((_item, index) => {
|
|
4493
|
-
env[`SCRIPT_${kind}_FILE_LIST_${index}`] =
|
|
4462
|
+
env[`SCRIPT_${kind}_FILE_LIST_${index}`] = path35.join(
|
|
4494
4463
|
phaseDir,
|
|
4495
4464
|
`${kind}-${index}.xcfilelist`
|
|
4496
4465
|
);
|
|
@@ -4501,14 +4470,14 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
4501
4470
|
);
|
|
4502
4471
|
for (const file of inputFiles) {
|
|
4503
4472
|
signature.update(file);
|
|
4504
|
-
if (
|
|
4505
|
-
const stat =
|
|
4473
|
+
if (fs16.existsSync(file)) {
|
|
4474
|
+
const stat = fs16.statSync(file);
|
|
4506
4475
|
signature.update(`${stat.mtimeMs}:${stat.ctimeMs}:${stat.size}`);
|
|
4507
4476
|
} else signature.update("missing");
|
|
4508
4477
|
}
|
|
4509
4478
|
const stamp = signature.digest("hex");
|
|
4510
4479
|
const key = `${project.projectFile}:${targetId}:${phaseId}:${settings("CONFIGURATION")}`;
|
|
4511
|
-
if (preparedSourcePhases.get(key) === stamp && allOutputs.every((file) =>
|
|
4480
|
+
if (preparedSourcePhases.get(key) === stamp && allOutputs.every((file) => fs16.existsSync(file))) {
|
|
4512
4481
|
preparedXcodePhase(
|
|
4513
4482
|
project.projectFile,
|
|
4514
4483
|
targetId,
|
|
@@ -4519,14 +4488,14 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
4519
4488
|
);
|
|
4520
4489
|
continue;
|
|
4521
4490
|
}
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4491
|
+
fs16.mkdirSync(phaseDir, { recursive: true });
|
|
4492
|
+
fs16.mkdirSync(settings("BUILT_PRODUCTS_DIR"), { recursive: true });
|
|
4493
|
+
fs16.mkdirSync(settings("DERIVED_FILE_DIR"), { recursive: true });
|
|
4525
4494
|
for (const output2 of allOutputs)
|
|
4526
|
-
|
|
4495
|
+
fs16.mkdirSync(path35.dirname(output2), { recursive: true });
|
|
4527
4496
|
for (const [kind, lists] of fileLists)
|
|
4528
4497
|
lists.forEach((item, index) => {
|
|
4529
|
-
|
|
4498
|
+
fs16.writeFileSync(
|
|
4530
4499
|
env[`SCRIPT_${kind}_FILE_LIST_${index}`],
|
|
4531
4500
|
`${item.entries.join("\n")}
|
|
4532
4501
|
`
|
|
@@ -4553,7 +4522,7 @@ ${output2}`
|
|
|
4553
4522
|
);
|
|
4554
4523
|
}
|
|
4555
4524
|
const missing = allOutputs.filter(
|
|
4556
|
-
(file) => file === infoPlistOutput && !
|
|
4525
|
+
(file) => file === infoPlistOutput && !fs16.existsSync(file)
|
|
4557
4526
|
);
|
|
4558
4527
|
if (missing.length > 0)
|
|
4559
4528
|
throw new Error(
|
|
@@ -4572,9 +4541,9 @@ ${output2}`
|
|
|
4572
4541
|
}
|
|
4573
4542
|
project.visitMembers(
|
|
4574
4543
|
targetId,
|
|
4575
|
-
xcodePathResolver(project.objects, project.projectDir,
|
|
4576
|
-
(file) => isDirectory(file) ? walkFiles(file) :
|
|
4577
|
-
|
|
4544
|
+
xcodePathResolver(project.objects, project.projectDir, path35.join, settings),
|
|
4545
|
+
(file) => isDirectory(file) ? walkFiles(file) : fs16.existsSync(file) ? [file] : [],
|
|
4546
|
+
path35.join,
|
|
4578
4547
|
(file, kind) => {
|
|
4579
4548
|
if (kind === "header") {
|
|
4580
4549
|
headers.add(file);
|
|
@@ -4584,9 +4553,9 @@ ${output2}`
|
|
|
4584
4553
|
resources.add(file);
|
|
4585
4554
|
return;
|
|
4586
4555
|
}
|
|
4587
|
-
if (!
|
|
4556
|
+
if (!fs16.existsSync(file)) {
|
|
4588
4557
|
if (options.requireSources === false) return;
|
|
4589
|
-
const script = scriptForOutput.get(
|
|
4558
|
+
const script = scriptForOutput.get(path35.normalize(file));
|
|
4590
4559
|
throw new Error(
|
|
4591
4560
|
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}`
|
|
4592
4561
|
);
|
|
@@ -4597,17 +4566,17 @@ ${output2}`
|
|
|
4597
4566
|
);
|
|
4598
4567
|
if (options.prepareGeneratedSources && options.requireSources !== false) {
|
|
4599
4568
|
const interfaceFiles = [...resources].filter(
|
|
4600
|
-
(file) => /\.(storyboard|xib)$/.test(file) && !file.split(
|
|
4569
|
+
(file) => /\.(storyboard|xib)$/.test(file) && !file.split(path35.sep).some((part) => part.endsWith(".bundle"))
|
|
4601
4570
|
);
|
|
4602
4571
|
if (process.platform !== "darwin") {
|
|
4603
4572
|
let launchName = settings("INFOPLIST_KEY_UILaunchStoryboardName");
|
|
4604
|
-
if (!launchName && infoPlistOutput &&
|
|
4605
|
-
const info = plist2.parse(
|
|
4573
|
+
if (!launchName && infoPlistOutput && fs16.existsSync(infoPlistOutput)) {
|
|
4574
|
+
const info = plist2.parse(fs16.readFileSync(infoPlistOutput, "utf8"));
|
|
4606
4575
|
const declared = isRecord(info) ? info.UILaunchStoryboardName : void 0;
|
|
4607
4576
|
if (typeof declared === "string") launchName = expand(declared, settings);
|
|
4608
4577
|
}
|
|
4609
4578
|
const runtimeInterfaceFiles = interfaceFiles.filter(
|
|
4610
|
-
(file) =>
|
|
4579
|
+
(file) => path35.basename(file, path35.extname(file)) !== launchName
|
|
4611
4580
|
);
|
|
4612
4581
|
if (runtimeInterfaceFiles.length > 0)
|
|
4613
4582
|
throw new Error(
|
|
@@ -4618,19 +4587,19 @@ ${output2}`
|
|
|
4618
4587
|
}
|
|
4619
4588
|
const interfaceOutputs = /* @__PURE__ */ new Set();
|
|
4620
4589
|
for (const file of interfaceFiles) {
|
|
4621
|
-
const localization = file.split(
|
|
4590
|
+
const localization = file.split(path35.sep).findLast((part) => part.endsWith(".lproj")) ?? "";
|
|
4622
4591
|
const extension = file.endsWith(".storyboard") ? ".storyboardc" : ".nib";
|
|
4623
|
-
const output2 =
|
|
4592
|
+
const output2 = path35.join(
|
|
4624
4593
|
settings("DERIVED_FILE_DIR"),
|
|
4625
4594
|
"InterfaceBuilder",
|
|
4626
4595
|
localization,
|
|
4627
|
-
|
|
4596
|
+
path35.basename(file, path35.extname(file)) + extension
|
|
4628
4597
|
);
|
|
4629
4598
|
if (interfaceOutputs.has(output2))
|
|
4630
4599
|
throw new Error(`${targetName}: duplicate Interface Builder output ${output2}`);
|
|
4631
4600
|
interfaceOutputs.add(output2);
|
|
4632
|
-
|
|
4633
|
-
|
|
4601
|
+
fs16.rmSync(output2, { recursive: true, force: true });
|
|
4602
|
+
fs16.mkdirSync(path35.dirname(output2), { recursive: true });
|
|
4634
4603
|
const args = [
|
|
4635
4604
|
"ibtool",
|
|
4636
4605
|
"--compile",
|
|
@@ -4664,13 +4633,13 @@ ${output2}`
|
|
|
4664
4633
|
for (const definition of definitions) {
|
|
4665
4634
|
const configuredLanguage = settings("INTENTS_CODEGEN_LANGUAGE");
|
|
4666
4635
|
const language = !configuredLanguage || configuredLanguage === "Automatic" ? sources.size > 0 ? "Swift" : "Objective-C" : configuredLanguage;
|
|
4667
|
-
const output2 =
|
|
4636
|
+
const output2 = path35.join(
|
|
4668
4637
|
settings("DERIVED_FILE_DIR"),
|
|
4669
4638
|
"IntentDefinitionGenerated",
|
|
4670
|
-
|
|
4639
|
+
path35.basename(definition, ".intentdefinition")
|
|
4671
4640
|
);
|
|
4672
|
-
|
|
4673
|
-
|
|
4641
|
+
fs16.rmSync(output2, { recursive: true, force: true });
|
|
4642
|
+
fs16.mkdirSync(output2, { recursive: true });
|
|
4674
4643
|
const args = [
|
|
4675
4644
|
"intentbuilderc",
|
|
4676
4645
|
"generate",
|
|
@@ -4714,37 +4683,37 @@ ${output2}`
|
|
|
4714
4683
|
function commonAncestor(dirs) {
|
|
4715
4684
|
let common = dirs[0];
|
|
4716
4685
|
for (const dir of dirs) {
|
|
4717
|
-
while (common !==
|
|
4718
|
-
common =
|
|
4686
|
+
while (common !== path35.dirname(common) && path35.relative(common, dir).startsWith(".."))
|
|
4687
|
+
common = path35.dirname(common);
|
|
4719
4688
|
}
|
|
4720
4689
|
return common;
|
|
4721
4690
|
}
|
|
4722
|
-
var isPodsProject = (xcodeproj) =>
|
|
4691
|
+
var isPodsProject = (xcodeproj) => path35.basename(xcodeproj) === "Pods.xcodeproj" && path35.basename(path35.dirname(xcodeproj)) === "Pods";
|
|
4723
4692
|
function installedPodsSandbox(pods) {
|
|
4724
|
-
const podfileLock =
|
|
4725
|
-
const manifestLock =
|
|
4726
|
-
if (!
|
|
4693
|
+
const podfileLock = path35.join(path35.dirname(pods), "Podfile.lock");
|
|
4694
|
+
const manifestLock = path35.join(pods, "Manifest.lock");
|
|
4695
|
+
if (!fs16.existsSync(podfileLock))
|
|
4727
4696
|
throw new Error(
|
|
4728
|
-
`${pods} has no ${podfileLock}: run \`pod install\` in ${
|
|
4697
|
+
`${pods} has no ${podfileLock}: run \`pod install\` in ${path35.dirname(pods)}`
|
|
4729
4698
|
);
|
|
4730
|
-
if (!
|
|
4699
|
+
if (!fs16.existsSync(manifestLock) || !fs16.readFileSync(manifestLock).equals(fs16.readFileSync(podfileLock)))
|
|
4731
4700
|
throw new Error(
|
|
4732
|
-
`The sandbox is not in sync with the Podfile.lock: ${manifestLock} differs from ${podfileLock}. Run \`pod install\` in ${
|
|
4701
|
+
`The sandbox is not in sync with the Podfile.lock: ${manifestLock} differs from ${podfileLock}. Run \`pod install\` in ${path35.dirname(pods)}`
|
|
4733
4702
|
);
|
|
4734
4703
|
const specChecksums = {};
|
|
4735
|
-
const lines =
|
|
4704
|
+
const lines = fs16.readFileSync(manifestLock, "utf8").split("\n");
|
|
4736
4705
|
const start = lines.indexOf("SPEC CHECKSUMS:");
|
|
4737
4706
|
for (const line of start === -1 ? [] : lines.slice(start + 1)) {
|
|
4738
4707
|
const entry = /^ {2}"?([^":]+)"?: ([0-9a-f]+)$/.exec(line);
|
|
4739
4708
|
if (!entry) break;
|
|
4740
4709
|
specChecksums[entry[1]] = entry[2];
|
|
4741
4710
|
}
|
|
4742
|
-
const specs =
|
|
4711
|
+
const specs = path35.join(pods, "Local Podspecs");
|
|
4743
4712
|
return {
|
|
4744
4713
|
podfileLock,
|
|
4745
4714
|
manifestLock,
|
|
4746
4715
|
specChecksums,
|
|
4747
|
-
localPodspecs: isDirectory(specs) ?
|
|
4716
|
+
localPodspecs: isDirectory(specs) ? fs16.readdirSync(specs).filter((name) => name.endsWith(".podspec.json")).sort().map((name) => path35.join(specs, name)) : []
|
|
4748
4717
|
};
|
|
4749
4718
|
}
|
|
4750
4719
|
function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
|
|
@@ -4756,14 +4725,14 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
|
|
|
4756
4725
|
if (!xcodeProjectFile(xcodeproj)) {
|
|
4757
4726
|
if (installedPods && isPodsProject(xcodeproj))
|
|
4758
4727
|
throw new Error(
|
|
4759
|
-
`${
|
|
4728
|
+
`${path35.basename(xcodeprojOrWorkspace)} builds ${xcodeproj}, which is not installed: run \`pod install\` in ${path35.dirname(path35.dirname(xcodeproj))}`
|
|
4760
4729
|
);
|
|
4761
4730
|
return;
|
|
4762
4731
|
}
|
|
4763
|
-
const key =
|
|
4764
|
-
if (projectAt.has(key) || !installedPods && key.split(
|
|
4732
|
+
const key = fs16.realpathSync.native(xcodeproj);
|
|
4733
|
+
if (projectAt.has(key) || !installedPods && key.split(path35.sep).includes("Pods"))
|
|
4765
4734
|
return;
|
|
4766
|
-
if (isPodsProject(key)) cocoapods = installedPodsSandbox(
|
|
4735
|
+
if (isPodsProject(key)) cocoapods = installedPodsSandbox(path35.dirname(key));
|
|
4767
4736
|
const project = loadProject(key);
|
|
4768
4737
|
projectAt.set(key, project);
|
|
4769
4738
|
projects.push(project);
|
|
@@ -4779,12 +4748,12 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
|
|
|
4779
4748
|
for (const reference of listed)
|
|
4780
4749
|
if (reference.endsWith(".xcodeproj")) addProject(reference);
|
|
4781
4750
|
if (projects.length === 0) {
|
|
4782
|
-
throw new Error(`${
|
|
4751
|
+
throw new Error(`${path35.basename(xcodeprojOrWorkspace)} lists no Xcode project`);
|
|
4783
4752
|
}
|
|
4784
|
-
const podfile =
|
|
4785
|
-
if (installedPods && !cocoapods &&
|
|
4753
|
+
const podfile = path35.join(path35.dirname(xcodeprojOrWorkspace), "Podfile");
|
|
4754
|
+
if (installedPods && !cocoapods && fs16.existsSync(podfile))
|
|
4786
4755
|
throw new Error(
|
|
4787
|
-
`${podfile} is not installed into ${
|
|
4756
|
+
`${podfile} is not installed into ${path35.basename(xcodeprojOrWorkspace)}: run \`pod install\` in ${path35.dirname(podfile)} and open the workspace it writes`
|
|
4788
4757
|
);
|
|
4789
4758
|
return { listed, projects, projectAt, cocoapods };
|
|
4790
4759
|
}
|
|
@@ -4813,14 +4782,14 @@ function isIosAppTarget(ref, options = {}) {
|
|
|
4813
4782
|
const sdk = get("SDKROOT");
|
|
4814
4783
|
return sdk === "auto" ? settingList(get("SUPPORTED_PLATFORMS")).some(isIosPlatform) : sdk === "" || isIosPlatform(sdk);
|
|
4815
4784
|
}
|
|
4816
|
-
function isIosPlatform(
|
|
4817
|
-
return
|
|
4785
|
+
function isIosPlatform(name) {
|
|
4786
|
+
return name.startsWith("iphoneos") || name.startsWith("iphonesimulator");
|
|
4818
4787
|
}
|
|
4819
4788
|
function listXcodeAppTargets(xcodeprojOrWorkspace, options = {}) {
|
|
4820
4789
|
return workspaceProjects(xcodeprojOrWorkspace).projects.flatMap(projectTargets).filter((ref) => isIosAppTarget(ref, options)).map((ref) => str(ref.target.name) ?? ref.id);
|
|
4821
4790
|
}
|
|
4822
4791
|
function defaultXcodeAppTarget(xcodeproj) {
|
|
4823
|
-
const project = loadProject(
|
|
4792
|
+
const project = loadProject(fs16.realpathSync.native(xcodeproj));
|
|
4824
4793
|
for (const [id, target] of Object.entries(project.objects)) {
|
|
4825
4794
|
if (!isDict(target) || target.isa !== "PBXNativeTarget") continue;
|
|
4826
4795
|
if (isIosAppTarget({ project, id, target }, { requireSources: false }))
|
|
@@ -4828,33 +4797,33 @@ function defaultXcodeAppTarget(xcodeproj) {
|
|
|
4828
4797
|
}
|
|
4829
4798
|
}
|
|
4830
4799
|
function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
4831
|
-
const container =
|
|
4800
|
+
const container = fs16.realpathSync.native(xcodeprojOrWorkspace);
|
|
4832
4801
|
const { projects } = workspaceProjects(container);
|
|
4833
4802
|
const containers = [
|
|
4834
4803
|
.../* @__PURE__ */ new Set([container, ...projects.map((project2) => project2.xcodeproj)])
|
|
4835
4804
|
];
|
|
4836
4805
|
const found = containers.flatMap(
|
|
4837
4806
|
(dir) => [
|
|
4838
|
-
|
|
4839
|
-
...isDirectory(
|
|
4807
|
+
path35.join(dir, "xcshareddata"),
|
|
4808
|
+
...isDirectory(path35.join(dir, "xcuserdata")) ? fs16.readdirSync(path35.join(dir, "xcuserdata")).sort().map((user) => path35.join(dir, "xcuserdata", user)) : []
|
|
4840
4809
|
].map((data) => ({
|
|
4841
4810
|
dir,
|
|
4842
|
-
file:
|
|
4811
|
+
file: path35.join(data, "xcschemes", `${scheme}.xcscheme`)
|
|
4843
4812
|
}))
|
|
4844
|
-
).find((candidate) =>
|
|
4813
|
+
).find((candidate) => fs16.existsSync(candidate.file));
|
|
4845
4814
|
if (!found) {
|
|
4846
4815
|
const known = containers.flatMap(
|
|
4847
|
-
(dir) =>
|
|
4816
|
+
(dir) => fs16.existsSync(path35.join(dir, "xcshareddata", "xcschemes")) ? fs16.readdirSync(path35.join(dir, "xcshareddata", "xcschemes")).filter((name2) => name2.endsWith(".xcscheme")).map((name2) => name2.slice(0, -".xcscheme".length)).sort() : []
|
|
4848
4817
|
);
|
|
4849
4818
|
throw new Error(
|
|
4850
|
-
`${
|
|
4819
|
+
`${path35.basename(container)} has no scheme ${scheme}; it shares ${known.join(", ") || "none"}`
|
|
4851
4820
|
);
|
|
4852
4821
|
}
|
|
4853
4822
|
const launch = /<LaunchAction\b([^>]*)>([\s\S]*?)<\/LaunchAction>/.exec(
|
|
4854
|
-
|
|
4823
|
+
fs16.readFileSync(found.file, "utf8")
|
|
4855
4824
|
);
|
|
4856
|
-
const attribute = (text2,
|
|
4857
|
-
const value = new RegExp(`\\b${
|
|
4825
|
+
const attribute = (text2, name2) => {
|
|
4826
|
+
const value = new RegExp(`\\b${name2}\\s*=\\s*"([^"]*)"`).exec(text2)?.[1];
|
|
4858
4827
|
return value === void 0 ? void 0 : decodeXml(value);
|
|
4859
4828
|
};
|
|
4860
4829
|
const runnable = launch ? /<BuildableProductRunnable\b[\s\S]*?<BuildableReference\b([^>]*)>/.exec(launch[2]) : null;
|
|
@@ -4864,16 +4833,16 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
|
4864
4833
|
if (!configuration || !blueprint || !referenced?.startsWith("container:")) {
|
|
4865
4834
|
throw new Error(`scheme ${scheme} runs no application target`);
|
|
4866
4835
|
}
|
|
4867
|
-
const projectPath =
|
|
4868
|
-
|
|
4836
|
+
const projectPath = path35.resolve(
|
|
4837
|
+
path35.dirname(found.dir),
|
|
4869
4838
|
referenced.slice("container:".length)
|
|
4870
4839
|
);
|
|
4871
4840
|
const project = projects.find(
|
|
4872
|
-
(candidate) =>
|
|
4841
|
+
(candidate) => fs16.existsSync(projectPath) && candidate.xcodeproj === fs16.realpathSync.native(projectPath)
|
|
4873
4842
|
);
|
|
4874
4843
|
const target = project && projectTargets(project).find((ref) => ref.id === blueprint);
|
|
4875
|
-
const
|
|
4876
|
-
if (!
|
|
4844
|
+
const name = target && str(target.target.name);
|
|
4845
|
+
if (!name) {
|
|
4877
4846
|
const declared = (project ? [project] : projects).flatMap(
|
|
4878
4847
|
(candidate) => projectTargets(candidate).flatMap((ref) => {
|
|
4879
4848
|
const targetName = str(ref.target.name);
|
|
@@ -4884,31 +4853,31 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
|
4884
4853
|
`scheme ${scheme} runs blueprint ${blueprint}, which no project here declares (declared targets: ${declared.join(", ") || "none"})`
|
|
4885
4854
|
);
|
|
4886
4855
|
}
|
|
4887
|
-
return { target:
|
|
4856
|
+
return { target: name, configuration };
|
|
4888
4857
|
}
|
|
4889
4858
|
var NativeAppTargetSelectionError = class extends Error {
|
|
4890
4859
|
};
|
|
4891
4860
|
function selectIosAppTarget(projectRoot, iosTarget) {
|
|
4892
|
-
const nested =
|
|
4893
|
-
const iosRoot =
|
|
4894
|
-
const entries =
|
|
4861
|
+
const nested = path35.join(projectRoot, "ios");
|
|
4862
|
+
const iosRoot = fs16.existsSync(nested) ? nested : projectRoot;
|
|
4863
|
+
const entries = fs16.readdirSync(iosRoot, { withFileTypes: true });
|
|
4895
4864
|
const projects = (entries.some((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj")) ? entries.filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj")).map((entry) => ({
|
|
4896
|
-
xcodeproj:
|
|
4865
|
+
xcodeproj: path35.join(iosRoot, entry.name),
|
|
4897
4866
|
workspace: null
|
|
4898
4867
|
})) : entries.filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcworkspace")).flatMap((entry) => {
|
|
4899
|
-
const workspace =
|
|
4868
|
+
const workspace = path35.join(iosRoot, entry.name);
|
|
4900
4869
|
return workspaceReferences(workspace).map((xcodeproj2) => ({
|
|
4901
4870
|
xcodeproj: xcodeproj2,
|
|
4902
4871
|
workspace
|
|
4903
4872
|
}));
|
|
4904
4873
|
}).filter(
|
|
4905
|
-
({ xcodeproj: xcodeproj2 }) => xcodeproj2.endsWith(".xcodeproj") && !xcodeproj2.split(
|
|
4874
|
+
({ xcodeproj: xcodeproj2 }) => xcodeproj2.endsWith(".xcodeproj") && !xcodeproj2.split(path35.sep).includes("Pods") && fs16.existsSync(xcodeproj2)
|
|
4906
4875
|
).filter(
|
|
4907
4876
|
({ xcodeproj: xcodeproj2 }) => listXcodeAppTargets(xcodeproj2, { requireSources: false }).length > 0
|
|
4908
4877
|
)).map(({ xcodeproj: xcodeproj2, workspace }) => ({
|
|
4909
4878
|
xcodeproj: xcodeproj2,
|
|
4910
4879
|
workspace,
|
|
4911
|
-
name:
|
|
4880
|
+
name: path35.basename(xcodeproj2)
|
|
4912
4881
|
}));
|
|
4913
4882
|
if (projects.length === 0) return null;
|
|
4914
4883
|
if (projects.length > 1 && !iosTarget) {
|
|
@@ -4947,13 +4916,13 @@ function selectIosAppTarget(projectRoot, iosTarget) {
|
|
|
4947
4916
|
if (!target) throw new Error("native app identity has no iOS application target");
|
|
4948
4917
|
if (!iosTarget) {
|
|
4949
4918
|
const workspace = xcodeproj.replace(/\.xcodeproj$/, ".xcworkspace");
|
|
4950
|
-
const container =
|
|
4919
|
+
const container = fs16.existsSync(workspace) ? workspace : xcodeproj;
|
|
4951
4920
|
const hasScheme = [container, xcodeproj].some((dir) => {
|
|
4952
|
-
if (
|
|
4921
|
+
if (fs16.existsSync(path35.join(dir, "xcshareddata", "xcschemes", `${target}.xcscheme`)))
|
|
4953
4922
|
return true;
|
|
4954
|
-
const users =
|
|
4955
|
-
return
|
|
4956
|
-
(user) =>
|
|
4923
|
+
const users = path35.join(dir, "xcuserdata");
|
|
4924
|
+
return fs16.existsSync(users) && fs16.readdirSync(users).some(
|
|
4925
|
+
(user) => fs16.existsSync(path35.join(users, user, "xcschemes", `${target}.xcscheme`))
|
|
4957
4926
|
);
|
|
4958
4927
|
});
|
|
4959
4928
|
if (hasScheme) target = readXcodeScheme(container, target).target;
|
|
@@ -4964,8 +4933,8 @@ function selectIosAppTarget(projectRoot, iosTarget) {
|
|
|
4964
4933
|
);
|
|
4965
4934
|
return { xcodeproj, target, workspace: project.workspace };
|
|
4966
4935
|
}
|
|
4967
|
-
var workspaceResolvedFile = (xcodeprojOrWorkspace) =>
|
|
4968
|
-
xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace :
|
|
4936
|
+
var workspaceResolvedFile = (xcodeprojOrWorkspace) => path35.join(
|
|
4937
|
+
xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : path35.join(xcodeprojOrWorkspace, "project.xcworkspace"),
|
|
4969
4938
|
"xcshareddata",
|
|
4970
4939
|
"swiftpm",
|
|
4971
4940
|
"Package.resolved"
|
|
@@ -4980,7 +4949,7 @@ var SwiftPackageResolutionRequired = class extends Error {
|
|
|
4980
4949
|
}
|
|
4981
4950
|
};
|
|
4982
4951
|
function readXcodeAppTarget(input, targetName, configurationName, options = {}) {
|
|
4983
|
-
const xcodeprojOrWorkspace =
|
|
4952
|
+
const xcodeprojOrWorkspace = fs16.realpathSync.native(input);
|
|
4984
4953
|
const workspace = xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : null;
|
|
4985
4954
|
const { listed, projects, projectAt, cocoapods } = workspaceProjects(
|
|
4986
4955
|
xcodeprojOrWorkspace,
|
|
@@ -4989,7 +4958,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4989
4958
|
const allTargets = projects.flatMap(projectTargets);
|
|
4990
4959
|
const appTargets = allTargets.filter((ref) => isIosAppTarget(ref, options));
|
|
4991
4960
|
const appTargetNames = appTargets.map((ref) => str(ref.target.name) ?? ref.id);
|
|
4992
|
-
const container =
|
|
4961
|
+
const container = path35.basename(xcodeprojOrWorkspace);
|
|
4993
4962
|
const named = targetName ? appTargets.filter((ref) => ref.target.name === targetName) : appTargets;
|
|
4994
4963
|
if (named.length !== 1) {
|
|
4995
4964
|
if (appTargets.length === 0)
|
|
@@ -5010,15 +4979,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5010
4979
|
for (const ref of allTargets) {
|
|
5011
4980
|
const product = ref.project.object(str(ref.target.productReference));
|
|
5012
4981
|
const file = str(product?.path);
|
|
5013
|
-
if (file && !byProduct.has(
|
|
5014
|
-
byProduct.set(
|
|
4982
|
+
if (file && !byProduct.has(path35.basename(file)))
|
|
4983
|
+
byProduct.set(path35.basename(file), ref);
|
|
5015
4984
|
}
|
|
5016
4985
|
const proxied = (project, proxyId) => {
|
|
5017
4986
|
const proxy = project.object(proxyId);
|
|
5018
4987
|
if (proxy?.isa !== "PBXContainerItemProxy") return void 0;
|
|
5019
4988
|
const portal = str(proxy.containerPortal);
|
|
5020
4989
|
const portalPath = project.resolvePath(portal ?? "");
|
|
5021
|
-
const owner = project.object(portal)?.isa === "PBXProject" ? project : portalPath &&
|
|
4990
|
+
const owner = project.object(portal)?.isa === "PBXProject" ? project : portalPath && fs16.existsSync(portalPath) ? projectAt.get(fs16.realpathSync.native(portalPath)) : void 0;
|
|
5022
4991
|
const remote = str(proxy.remoteGlobalIDString);
|
|
5023
4992
|
if (!owner || !remote) return void 0;
|
|
5024
4993
|
return projectTargets(owner).find(
|
|
@@ -5035,7 +5004,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5035
5004
|
const buildFile = project.object(buildFileId);
|
|
5036
5005
|
if (!buildFile || !xcodeBuildFileBuildsForIos(buildFile)) continue;
|
|
5037
5006
|
const file = project.object(str(buildFile.fileRef));
|
|
5038
|
-
const resolved = file?.isa === "PBXReferenceProxy" ? proxied(project, str(file.remoteRef)) : file && str(file.sourceTree) === "BUILT_PRODUCTS_DIR" ? byProduct.get(
|
|
5007
|
+
const resolved = file?.isa === "PBXReferenceProxy" ? proxied(project, str(file.remoteRef)) : file && str(file.sourceTree) === "BUILT_PRODUCTS_DIR" ? byProduct.get(path35.basename(str(file.path) ?? "")) : void 0;
|
|
5039
5008
|
if (resolved)
|
|
5040
5009
|
found.push({
|
|
5041
5010
|
target: resolved,
|
|
@@ -5119,8 +5088,8 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5119
5088
|
ref.project.visitMembers(
|
|
5120
5089
|
ref.id,
|
|
5121
5090
|
ref.project.resolvePath,
|
|
5122
|
-
(file) => isDirectory(file) ? walkFiles(file) :
|
|
5123
|
-
|
|
5091
|
+
(file) => isDirectory(file) ? walkFiles(file) : fs16.existsSync(file) ? [file] : [],
|
|
5092
|
+
path35.join,
|
|
5124
5093
|
(file, kind) => {
|
|
5125
5094
|
if (kind === "header") found.push(file);
|
|
5126
5095
|
}
|
|
@@ -5136,13 +5105,13 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5136
5105
|
for (const ref of projectTargets(project)) {
|
|
5137
5106
|
const product = productName(ref);
|
|
5138
5107
|
for (const { file, visibility } of headerPhase(ref)) {
|
|
5139
|
-
const
|
|
5140
|
-
if (!entries.has(
|
|
5141
|
-
entries.set(
|
|
5108
|
+
const name = path35.basename(file);
|
|
5109
|
+
if (!entries.has(name))
|
|
5110
|
+
entries.set(name, visibility !== "Project" ? `${product}/${name}` : file);
|
|
5142
5111
|
}
|
|
5143
5112
|
for (const file of synchronizedHeaders(ref)) {
|
|
5144
|
-
const
|
|
5145
|
-
if (!entries.has(
|
|
5113
|
+
const name = path35.basename(file);
|
|
5114
|
+
if (!entries.has(name)) entries.set(name, file);
|
|
5146
5115
|
}
|
|
5147
5116
|
}
|
|
5148
5117
|
for (const ref of projectTargets(project)) {
|
|
@@ -5151,29 +5120,29 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5151
5120
|
if (folder === null) continue;
|
|
5152
5121
|
for (const file of walkFiles(folder)) {
|
|
5153
5122
|
if (!HEADER_FILE.test(file)) continue;
|
|
5154
|
-
const
|
|
5155
|
-
if (!entries.has(
|
|
5123
|
+
const name = path35.basename(file);
|
|
5124
|
+
if (!entries.has(name)) entries.set(name, file);
|
|
5156
5125
|
}
|
|
5157
5126
|
}
|
|
5158
5127
|
}
|
|
5159
5128
|
for (const id of Object.keys(project.objects)) {
|
|
5160
5129
|
if (project.object(id)?.isa !== "PBXFileReference") continue;
|
|
5161
5130
|
const file = project.resolvePath(id);
|
|
5162
|
-
if (file && HEADER_FILE.test(file) && !entries.has(
|
|
5163
|
-
entries.set(
|
|
5131
|
+
if (file && HEADER_FILE.test(file) && !entries.has(path35.basename(file)))
|
|
5132
|
+
entries.set(path35.basename(file), file);
|
|
5164
5133
|
}
|
|
5165
5134
|
const map = [...entries];
|
|
5166
5135
|
projectHeaderMaps.set(project, map);
|
|
5167
5136
|
return map;
|
|
5168
5137
|
};
|
|
5169
5138
|
const xcconfigs = /* @__PURE__ */ new Set();
|
|
5170
|
-
const buildDir = (project) =>
|
|
5139
|
+
const buildDir = (project) => path35.join(project.projectDir, ".build/peach-xcode/Build");
|
|
5171
5140
|
const workspaceBuild = {
|
|
5172
|
-
SYMROOT:
|
|
5173
|
-
OBJROOT:
|
|
5141
|
+
SYMROOT: path35.join(buildDir(app.project), "Products"),
|
|
5142
|
+
OBJROOT: path35.join(buildDir(app.project), "Intermediates.noindex")
|
|
5174
5143
|
};
|
|
5175
5144
|
const moduleTarget = (ref) => {
|
|
5176
|
-
const
|
|
5145
|
+
const name = str(ref.target.name) ?? ref.id;
|
|
5177
5146
|
const {
|
|
5178
5147
|
get: settings2,
|
|
5179
5148
|
keys,
|
|
@@ -5182,19 +5151,19 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5182
5151
|
ref,
|
|
5183
5152
|
configuration,
|
|
5184
5153
|
{
|
|
5185
|
-
TARGET_NAME:
|
|
5154
|
+
TARGET_NAME: name,
|
|
5186
5155
|
TARGETNAME: "$(TARGET_NAME)",
|
|
5187
5156
|
PROJECT: "$(PROJECT_NAME)",
|
|
5188
|
-
PROJECT_NAME:
|
|
5157
|
+
PROJECT_NAME: path35.basename(ref.project.xcodeproj, ".xcodeproj"),
|
|
5189
5158
|
PROJECT_CLASS_PREFIX: isDict(ref.project.project.attributes) ? str(ref.project.project.attributes.CLASSPREFIX) ?? "" : "",
|
|
5190
5159
|
PROJECT_FILE_PATH: ref.project.xcodeproj,
|
|
5191
5160
|
SRCROOT: ref.project.projectDir,
|
|
5192
5161
|
SOURCE_ROOT: ref.project.projectDir,
|
|
5193
5162
|
PROJECT_DIR: ref.project.projectDir,
|
|
5194
|
-
SYMROOT:
|
|
5163
|
+
SYMROOT: path35.join(buildDir(ref.project), "Products"),
|
|
5195
5164
|
BUILD_DIR: "$(SYMROOT)",
|
|
5196
5165
|
BUILD_ROOT: "$(SYMROOT)",
|
|
5197
|
-
OBJROOT:
|
|
5166
|
+
OBJROOT: path35.join(buildDir(ref.project), "Intermediates.noindex"),
|
|
5198
5167
|
CONFIGURATION_BUILD_DIR: "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)",
|
|
5199
5168
|
BUILT_PRODUCTS_DIR: "$(CONFIGURATION_BUILD_DIR)",
|
|
5200
5169
|
TARGET_BUILD_DIR: "$(CONFIGURATION_BUILD_DIR)",
|
|
@@ -5236,7 +5205,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5236
5205
|
xcconfigs
|
|
5237
5206
|
);
|
|
5238
5207
|
const searchRules = recursiveSearchRules(settings2);
|
|
5239
|
-
const absolute = (file) =>
|
|
5208
|
+
const absolute = (file) => path35.resolve(ref.project.projectDir, file);
|
|
5240
5209
|
const framework = FRAMEWORK_PRODUCTS.has(str(ref.target.productType) ?? "");
|
|
5241
5210
|
const product = settings2("PRODUCT_NAME");
|
|
5242
5211
|
const moduleName = applyOperator(settings2("PRODUCT_MODULE_NAME"), "c99extidentifier");
|
|
@@ -5256,18 +5225,18 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5256
5225
|
const outputUmbrella = outputs.find((file) => file.endsWith("-umbrella.h"));
|
|
5257
5226
|
const outputHeader = outputs.find((file) => file.endsWith(`/${moduleName}-Swift.h`));
|
|
5258
5227
|
if (!moduleMap2 || !umbrella || !outputModuleMap || !outputUmbrella || !outputHeader)
|
|
5259
|
-
throw new Error(`${
|
|
5228
|
+
throw new Error(`${name}: incomplete CocoaPods Swift compatibility header phase`);
|
|
5260
5229
|
return [{ id, moduleMap: moduleMap2, umbrella, outputModuleMap, outputUmbrella, outputHeader }];
|
|
5261
5230
|
});
|
|
5262
5231
|
if (compatibilityPhases.length > 1)
|
|
5263
|
-
throw new Error(`${
|
|
5232
|
+
throw new Error(`${name}: multiple CocoaPods Swift compatibility header phases`);
|
|
5264
5233
|
const compatibility = compatibilityPhases[0];
|
|
5265
5234
|
if (compatibility && members.sources.length === 0)
|
|
5266
5235
|
throw new Error(
|
|
5267
|
-
`${
|
|
5236
|
+
`${name}: Swift compatibility header phase has no Swift producer sources`
|
|
5268
5237
|
);
|
|
5269
5238
|
const building = options.prepareGeneratedSources && options.requireSources !== false;
|
|
5270
|
-
const versioning = building && allSources.length > 0 && settings2("VERSIONING_SYSTEM") === "apple-generic" ?
|
|
5239
|
+
const versioning = building && allSources.length > 0 && settings2("VERSIONING_SYSTEM") === "apple-generic" ? path35.join(settings2("DERIVED_FILE_DIR"), `${product}_vers.c`) : null;
|
|
5271
5240
|
if (versioning) {
|
|
5272
5241
|
const version = settings2("CURRENT_PROJECT_VERSION");
|
|
5273
5242
|
const custom = [
|
|
@@ -5280,7 +5249,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5280
5249
|
].filter((key) => settings2(key));
|
|
5281
5250
|
if (custom.length)
|
|
5282
5251
|
throw new Error(
|
|
5283
|
-
`${
|
|
5252
|
+
`${name}: Xcode generates ${path35.basename(versioning)} with ${custom.join(", ")}; peach does not model VERSION_INFO_* overrides`
|
|
5284
5253
|
);
|
|
5285
5254
|
const symbol = product.replace(/^[^A-Za-z_]/, "_").replace(/[^A-Za-z0-9_]/g, "_");
|
|
5286
5255
|
const [major, minor] = version.split(".");
|
|
@@ -5293,9 +5262,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5293
5262
|
` const double ${symbol}VersionNumber __attribute__ ((used)) = (double)${number2};`,
|
|
5294
5263
|
""
|
|
5295
5264
|
].join("\n");
|
|
5296
|
-
if (!
|
|
5297
|
-
|
|
5298
|
-
|
|
5265
|
+
if (!fs16.existsSync(versioning) || fs16.readFileSync(versioning, "utf8") !== unit) {
|
|
5266
|
+
fs16.mkdirSync(path35.dirname(versioning), { recursive: true });
|
|
5267
|
+
fs16.writeFileSync(versioning, unit);
|
|
5299
5268
|
}
|
|
5300
5269
|
allSources.push(versioning);
|
|
5301
5270
|
}
|
|
@@ -5304,28 +5273,28 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5304
5273
|
if (native && building) {
|
|
5305
5274
|
if (list(ref.target.buildRules).length > 0)
|
|
5306
5275
|
throw new Error(
|
|
5307
|
-
`${
|
|
5276
|
+
`${name}: Xcode's generated-files header map for build rules is not modeled`
|
|
5308
5277
|
);
|
|
5309
5278
|
if (settings2("ALWAYS_SEARCH_USER_PATHS") === "YES" && settings2("USER_HEADER_SEARCH_PATHS").trim())
|
|
5310
5279
|
throw new Error(
|
|
5311
|
-
`${
|
|
5280
|
+
`${name}: ALWAYS_SEARCH_USER_PATHS=YES also searches USER_HEADER_SEARCH_PATHS for angle-bracket includes, which is not modeled`
|
|
5312
5281
|
);
|
|
5313
5282
|
}
|
|
5314
5283
|
const headerFiles = headerPhase(ref);
|
|
5315
5284
|
const ownHeaders = /* @__PURE__ */ new Map();
|
|
5316
5285
|
for (const { file, visibility } of headerFiles) {
|
|
5317
|
-
const
|
|
5286
|
+
const name2 = path35.basename(file);
|
|
5318
5287
|
const published = visibility !== "Project";
|
|
5319
|
-
if (!ownHeaders.has(
|
|
5320
|
-
ownHeaders.set(
|
|
5321
|
-
if (!published && !ownHeaders.has(`${product}/${
|
|
5322
|
-
ownHeaders.set(`${product}/${
|
|
5288
|
+
if (!ownHeaders.has(name2))
|
|
5289
|
+
ownHeaders.set(name2, published ? `${product}/${name2}` : file);
|
|
5290
|
+
if (!published && !ownHeaders.has(`${product}/${name2}`))
|
|
5291
|
+
ownHeaders.set(`${product}/${name2}`, file);
|
|
5323
5292
|
}
|
|
5324
5293
|
for (const file of synchronizedHeaders(ref)) {
|
|
5325
|
-
const
|
|
5326
|
-
if (ownHeaders.has(
|
|
5327
|
-
ownHeaders.set(
|
|
5328
|
-
const qualified = `${product}/${
|
|
5294
|
+
const name2 = path35.basename(file);
|
|
5295
|
+
if (ownHeaders.has(name2)) continue;
|
|
5296
|
+
ownHeaders.set(name2, file);
|
|
5297
|
+
const qualified = `${product}/${name2}`;
|
|
5329
5298
|
if (!ownHeaders.has(qualified)) ownHeaders.set(qualified, file);
|
|
5330
5299
|
}
|
|
5331
5300
|
const nonFrameworkHeaders = /* @__PURE__ */ new Map();
|
|
@@ -5334,24 +5303,24 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5334
5303
|
const otherProduct = productName(other);
|
|
5335
5304
|
for (const { file, visibility } of headerPhase(other)) {
|
|
5336
5305
|
if (visibility === "Project") continue;
|
|
5337
|
-
const key = `${otherProduct}/${
|
|
5306
|
+
const key = `${otherProduct}/${path35.basename(file)}`;
|
|
5338
5307
|
if (!nonFrameworkHeaders.has(key)) nonFrameworkHeaders.set(key, file);
|
|
5339
5308
|
}
|
|
5340
5309
|
}
|
|
5341
|
-
const wrapper =
|
|
5310
|
+
const wrapper = path35.join(settings2("BUILT_PRODUCTS_DIR"), `${product}.framework`);
|
|
5342
5311
|
const moduleMap = (settings2("DEFINES_MODULE") === "YES" || !framework) && settings2("MODULEMAP_FILE") ? absolute(settings2("MODULEMAP_FILE")) : null;
|
|
5343
|
-
const frameworkUmbrella = !compatibility && framework && members.sources.length > 0 && moduleMap ?
|
|
5344
|
-
const frameworkCompatibility = frameworkUmbrella && moduleMap &&
|
|
5312
|
+
const frameworkUmbrella = !compatibility && framework && members.sources.length > 0 && moduleMap ? path35.join(path35.dirname(moduleMap), `${moduleName}-umbrella.h`) : null;
|
|
5313
|
+
const frameworkCompatibility = frameworkUmbrella && moduleMap && fs16.existsSync(moduleMap) && fs16.existsSync(frameworkUmbrella) ? {
|
|
5345
5314
|
framework: true,
|
|
5346
5315
|
moduleMap,
|
|
5347
5316
|
umbrella: frameworkUmbrella,
|
|
5348
|
-
outputModuleMap:
|
|
5349
|
-
outputUmbrella:
|
|
5317
|
+
outputModuleMap: path35.join(wrapper, "Modules", "module.modulemap"),
|
|
5318
|
+
outputUmbrella: path35.join(
|
|
5350
5319
|
wrapper,
|
|
5351
5320
|
"Headers",
|
|
5352
|
-
|
|
5321
|
+
path35.basename(frameworkUmbrella)
|
|
5353
5322
|
),
|
|
5354
|
-
outputHeader:
|
|
5323
|
+
outputHeader: path35.join(
|
|
5355
5324
|
wrapper,
|
|
5356
5325
|
"Headers",
|
|
5357
5326
|
settings2("SWIFT_OBJC_INTERFACE_HEADER_NAME") || `${moduleName}-Swift.h`
|
|
@@ -5365,10 +5334,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5365
5334
|
outputUmbrella: compatibility.outputUmbrella,
|
|
5366
5335
|
outputHeader: compatibility.outputHeader
|
|
5367
5336
|
} : frameworkCompatibility;
|
|
5368
|
-
const podHeaders = !framework && isPodsProject(ref.project.xcodeproj) && moduleMap &&
|
|
5337
|
+
const podHeaders = !framework && isPodsProject(ref.project.xcodeproj) && moduleMap && path35.relative(path35.join(ref.project.projectDir, "Headers", "Public"), moduleMap).split(path35.sep)[0] !== ".." && fs16.existsSync(moduleMap) ? fs16.readdirSync(path35.dirname(moduleMap)).flatMap((entry) => {
|
|
5369
5338
|
if (!/\.(h|hh|hpp|hxx|modulemap)$/.test(entry)) return [];
|
|
5370
|
-
const file =
|
|
5371
|
-
return
|
|
5339
|
+
const file = path35.join(path35.dirname(moduleMap), entry);
|
|
5340
|
+
return fs16.existsSync(file) ? [file] : [];
|
|
5372
5341
|
}) : [];
|
|
5373
5342
|
const fileFlags = {};
|
|
5374
5343
|
for (const phaseId of list(ref.target.buildPhases)) {
|
|
@@ -5393,7 +5362,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5393
5362
|
keys,
|
|
5394
5363
|
module: {
|
|
5395
5364
|
id: `${ref.project.projectFile}#${ref.id}`,
|
|
5396
|
-
name
|
|
5365
|
+
name,
|
|
5397
5366
|
targetIdentity: JSON.stringify([ref.project.xcodeproj, ref.id]),
|
|
5398
5367
|
targetDependencies: Array(),
|
|
5399
5368
|
moduleName,
|
|
@@ -5443,15 +5412,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5443
5412
|
// xcode searches its products' include directory before
|
|
5444
5413
|
// HEADER_SEARCH_PATHS and the target's derived sources after.
|
|
5445
5414
|
headerSearchPaths: [
|
|
5446
|
-
|
|
5415
|
+
path35.join(settings2("BUILT_PRODUCTS_DIR"), "include"),
|
|
5447
5416
|
...settingList(settings2("HEADER_SEARCH_PATHS")).flatMap(
|
|
5448
5417
|
(raw) => expandSearchPath(absolute(raw), searchRules)
|
|
5449
5418
|
),
|
|
5450
|
-
|
|
5419
|
+
path35.join(
|
|
5451
5420
|
`${settings2("DERIVED_FILE_DIR")}-normal`,
|
|
5452
5421
|
settings2("CURRENT_ARCH")
|
|
5453
5422
|
),
|
|
5454
|
-
|
|
5423
|
+
path35.join(settings2("DERIVED_FILE_DIR"), settings2("CURRENT_ARCH")),
|
|
5455
5424
|
settings2("DERIVED_FILE_DIR")
|
|
5456
5425
|
],
|
|
5457
5426
|
userHeaderSearchPaths: settingList(
|
|
@@ -5501,10 +5470,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5501
5470
|
...headerFiles.flatMap(
|
|
5502
5471
|
({ file, visibility }) => visibility === "Project" ? [] : [
|
|
5503
5472
|
[
|
|
5504
|
-
|
|
5473
|
+
path35.join(
|
|
5505
5474
|
wrapper,
|
|
5506
5475
|
visibility === "Public" ? "Headers" : "PrivateHeaders",
|
|
5507
|
-
|
|
5476
|
+
path35.basename(file)
|
|
5508
5477
|
),
|
|
5509
5478
|
file
|
|
5510
5479
|
]
|
|
@@ -5518,7 +5487,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5518
5487
|
return [];
|
|
5519
5488
|
const destination = expand(
|
|
5520
5489
|
str(phase.dstPath) ?? "",
|
|
5521
|
-
(
|
|
5490
|
+
(name2) => name2 === "PUBLIC_HEADERS_FOLDER_PATH" ? path35.join(wrapper, "Headers") : name2 === "PRIVATE_HEADERS_FOLDER_PATH" ? path35.join(wrapper, "PrivateHeaders") : settings2(name2)
|
|
5522
5491
|
);
|
|
5523
5492
|
return list(phase.files).flatMap((id) => {
|
|
5524
5493
|
const file = ref.project.resolvePath(
|
|
@@ -5526,17 +5495,17 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5526
5495
|
);
|
|
5527
5496
|
return file && HEADER_FILE.test(file) ? [
|
|
5528
5497
|
[
|
|
5529
|
-
|
|
5498
|
+
path35.resolve(
|
|
5530
5499
|
settings2("BUILT_PRODUCTS_DIR"),
|
|
5531
5500
|
destination,
|
|
5532
|
-
|
|
5501
|
+
path35.basename(file)
|
|
5533
5502
|
),
|
|
5534
5503
|
file
|
|
5535
5504
|
]
|
|
5536
5505
|
] : [];
|
|
5537
5506
|
});
|
|
5538
5507
|
}),
|
|
5539
|
-
...moduleMap ? [[
|
|
5508
|
+
...moduleMap ? [[path35.join(wrapper, "Modules", "module.modulemap"), moduleMap]] : []
|
|
5540
5509
|
]) : Object.fromEntries([
|
|
5541
5510
|
...podHeaders.map((file) => [file, file]),
|
|
5542
5511
|
...moduleMap ? [[moduleMap, moduleMap]] : []
|
|
@@ -5561,14 +5530,14 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5561
5530
|
};
|
|
5562
5531
|
for (const { ref, module: module2 } of builtTargets)
|
|
5563
5532
|
if (options.nativeModules?.some(
|
|
5564
|
-
(
|
|
5533
|
+
(name) => name === module2.moduleName || name === module2.name
|
|
5565
5534
|
))
|
|
5566
5535
|
includeNativeTarget(ref);
|
|
5567
5536
|
const selectedTargets = options.nativeModules ? builtTargets.filter((target) => nativeTargets.has(target.ref)) : builtTargets;
|
|
5568
5537
|
const frameworkTargets = selectedTargets.filter((target) => target !== builtTargets.at(-1)).filter(({ ref }) => MODULE_PRODUCTS.has(str(ref.target.productType) ?? "")).map(({ ref, module: module2 }) => ({ ref, framework: module2 }));
|
|
5569
5538
|
const frameworks = frameworkTargets.map(({ framework }) => framework);
|
|
5570
5539
|
const podSourceDirs = builtTargets.slice(0, -1).flatMap(
|
|
5571
|
-
({ ref, module: module2 }) => isPodsProject(ref.project.xcodeproj) ? [...module2.allSources, ...module2.objc?.headers ?? []].map((file) =>
|
|
5540
|
+
({ ref, module: module2 }) => isPodsProject(ref.project.xcodeproj) ? [...module2.allSources, ...module2.objc?.headers ?? []].map((file) => path35.dirname(file)).filter((dir) => fs16.existsSync(dir)) : []
|
|
5572
5541
|
);
|
|
5573
5542
|
const expandValue = (value, settings2) => {
|
|
5574
5543
|
if (typeof value === "string") return expand(value, settings2);
|
|
@@ -5589,7 +5558,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5589
5558
|
const phase = owner.ref.project.object(phaseId);
|
|
5590
5559
|
if (phase?.isa !== "PBXShellScriptBuildPhase" || str(phase.name) !== "[CP] Copy Pods Resources")
|
|
5591
5560
|
continue;
|
|
5592
|
-
const absolute = (raw) =>
|
|
5561
|
+
const absolute = (raw) => path35.resolve(owner.ref.project.projectDir, expand(raw, owner.settings));
|
|
5593
5562
|
const entries = (paths) => paths.flatMap((raw) => {
|
|
5594
5563
|
const file = absolute(raw);
|
|
5595
5564
|
xcconfigs.add(file);
|
|
@@ -5605,7 +5574,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5605
5574
|
].filter((file) => file.endsWith(".bundle"));
|
|
5606
5575
|
if (inputs.length !== outputs.length)
|
|
5607
5576
|
throw new Error(`${owner.module.name}: resource bundle copy lists differ`);
|
|
5608
|
-
const destinationRoot =
|
|
5577
|
+
const destinationRoot = path35.join(
|
|
5609
5578
|
owner.settings("TARGET_BUILD_DIR"),
|
|
5610
5579
|
owner.settings("UNLOCALIZED_RESOURCES_FOLDER_PATH")
|
|
5611
5580
|
);
|
|
@@ -5614,24 +5583,24 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5614
5583
|
const file = str(
|
|
5615
5584
|
target.ref.project.object(str(target.ref.target.productReference))?.path
|
|
5616
5585
|
);
|
|
5617
|
-
return file &&
|
|
5586
|
+
return file && path35.join(target.settings("TARGET_BUILD_DIR"), file) === input2;
|
|
5618
5587
|
});
|
|
5619
5588
|
if (!product && !isDirectory(input2))
|
|
5620
5589
|
throw new Error(
|
|
5621
5590
|
`${owner.module.name}: resource bundle input has no selected producer: ${input2}`
|
|
5622
5591
|
);
|
|
5623
|
-
const destination =
|
|
5624
|
-
if (destination === ".." || destination.startsWith(`..${
|
|
5592
|
+
const destination = path35.relative(destinationRoot, outputs[index]);
|
|
5593
|
+
if (destination === ".." || destination.startsWith(`..${path35.sep}`) || path35.isAbsolute(destination) || path35.basename(input2) !== path35.basename(destination))
|
|
5625
5594
|
throw new Error(
|
|
5626
5595
|
`${owner.module.name}: invalid resource bundle copy destination`
|
|
5627
5596
|
);
|
|
5628
|
-
const infoFile = product ?
|
|
5597
|
+
const infoFile = product ? path35.resolve(
|
|
5629
5598
|
product.ref.project.projectDir,
|
|
5630
5599
|
product.settings("INFOPLIST_FILE")
|
|
5631
5600
|
) : null;
|
|
5632
5601
|
if (infoFile) xcconfigs.add(infoFile);
|
|
5633
5602
|
const prefix = owner.ref === app ? "" : `Frameworks/${owner.module.moduleName}.framework/`;
|
|
5634
|
-
const bundlePath = prefix + destination.split(
|
|
5603
|
+
const bundlePath = prefix + destination.split(path35.sep).join("/");
|
|
5635
5604
|
if (resourceProducts.some((resource) => resource.path === bundlePath))
|
|
5636
5605
|
throw new Error(
|
|
5637
5606
|
`${owner.module.name}: duplicate resource bundle destination ${bundlePath}`
|
|
@@ -5642,22 +5611,22 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5642
5611
|
resources: product.module.resources,
|
|
5643
5612
|
infoPlist: plist2.build(
|
|
5644
5613
|
expandValue(
|
|
5645
|
-
plist2.parse(
|
|
5614
|
+
plist2.parse(fs16.readFileSync(infoFile, "utf8")),
|
|
5646
5615
|
product.settings
|
|
5647
5616
|
)
|
|
5648
5617
|
)
|
|
5649
5618
|
} : {
|
|
5650
|
-
resources:
|
|
5619
|
+
resources: fs16.readdirSync(input2, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => path35.join(entry.parentPath, entry.name)).sort(),
|
|
5651
5620
|
sourceRoot: input2
|
|
5652
5621
|
}
|
|
5653
5622
|
});
|
|
5654
5623
|
}
|
|
5655
5624
|
}
|
|
5656
5625
|
}
|
|
5657
|
-
const infoPlistFile = settings("INFOPLIST_FILE") ?
|
|
5658
|
-
const entitlementsFile = settings("CODE_SIGN_ENTITLEMENTS") ?
|
|
5626
|
+
const infoPlistFile = settings("INFOPLIST_FILE") ? path35.resolve(app.project.projectDir, settings("INFOPLIST_FILE")) : null;
|
|
5627
|
+
const entitlementsFile = settings("CODE_SIGN_ENTITLEMENTS") ? path35.resolve(app.project.projectDir, settings("CODE_SIGN_ENTITLEMENTS")) : null;
|
|
5659
5628
|
const infoPlistPending = module.generatedInfoPlist && !options.prepareGeneratedSources;
|
|
5660
|
-
const sourceInfo = infoPlistFile && !infoPlistPending ? plist2.parse(
|
|
5629
|
+
const sourceInfo = infoPlistFile && !infoPlistPending ? plist2.parse(fs16.readFileSync(infoPlistFile, "utf8")) : {};
|
|
5661
5630
|
if (!sourceInfo || typeof sourceInfo !== "object" || Array.isArray(sourceInfo) || sourceInfo instanceof Date || Buffer.isBuffer(sourceInfo)) {
|
|
5662
5631
|
throw new Error(`${module.name} Info.plist must contain a dictionary`);
|
|
5663
5632
|
}
|
|
@@ -5681,7 +5650,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5681
5650
|
}
|
|
5682
5651
|
const bundleIdentifier = settings("PRODUCT_BUNDLE_IDENTIFIER") || (typeof info.CFBundleIdentifier === "string" ? info.CFBundleIdentifier : "");
|
|
5683
5652
|
const keychainAccessGroups = entitlementsFile ? readKeychainAccessGroups(
|
|
5684
|
-
plist2.parse(
|
|
5653
|
+
plist2.parse(fs16.readFileSync(entitlementsFile, "utf8")),
|
|
5685
5654
|
(value) => expand(value, (key) => {
|
|
5686
5655
|
if (key === "AppIdentifierPrefix") return "FAKETEAMID.";
|
|
5687
5656
|
if (key === "TeamIdentifierPrefix") return "";
|
|
@@ -5717,7 +5686,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5717
5686
|
};
|
|
5718
5687
|
}
|
|
5719
5688
|
const localPackageDirs = [
|
|
5720
|
-
...listed.filter((reference) =>
|
|
5689
|
+
...listed.filter((reference) => fs16.existsSync(path35.join(reference, "Package.swift"))),
|
|
5721
5690
|
...projects.flatMap(
|
|
5722
5691
|
(project) => Object.entries(project.objects).flatMap(([id, entry]) => {
|
|
5723
5692
|
if (!isDict(entry)) return [];
|
|
@@ -5727,19 +5696,19 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5727
5696
|
const packages = [];
|
|
5728
5697
|
while (pending.length > 0) {
|
|
5729
5698
|
const dir = pending.pop();
|
|
5730
|
-
if (
|
|
5699
|
+
if (fs16.existsSync(path35.join(dir, "Package.swift"))) {
|
|
5731
5700
|
packages.push(dir);
|
|
5732
5701
|
continue;
|
|
5733
5702
|
}
|
|
5734
5703
|
if (!isDirectory(dir)) continue;
|
|
5735
|
-
for (const child of
|
|
5704
|
+
for (const child of fs16.readdirSync(dir, { withFileTypes: true }))
|
|
5736
5705
|
if (child.isDirectory() && !child.name.startsWith("."))
|
|
5737
|
-
pending.push(
|
|
5706
|
+
pending.push(path35.join(dir, child.name));
|
|
5738
5707
|
}
|
|
5739
5708
|
return packages;
|
|
5740
5709
|
}
|
|
5741
|
-
const candidate = entry.isa === "XCLocalSwiftPackageReference" ?
|
|
5742
|
-
return candidate &&
|
|
5710
|
+
const candidate = entry.isa === "XCLocalSwiftPackageReference" ? path35.resolve(project.projectDir, str(entry.relativePath) ?? "") : entry.isa === "PBXFileReference" ? project.resolvePath(id) : null;
|
|
5711
|
+
return candidate && fs16.existsSync(path35.join(candidate, "Package.swift")) ? [candidate] : [];
|
|
5743
5712
|
})
|
|
5744
5713
|
)
|
|
5745
5714
|
];
|
|
@@ -5765,15 +5734,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5765
5734
|
for (const { ref, settings: settings2 } of builtTargets) {
|
|
5766
5735
|
const ldflags = settingList(settings2("OTHER_LDFLAGS"));
|
|
5767
5736
|
ldflags.forEach((flag, index) => {
|
|
5768
|
-
const
|
|
5769
|
-
if ((flag === "-framework" || flag === "-weak_framework") &&
|
|
5770
|
-
sdkFrameworks.add(
|
|
5737
|
+
const name = ldflags[index + 1];
|
|
5738
|
+
if ((flag === "-framework" || flag === "-weak_framework") && name)
|
|
5739
|
+
sdkFrameworks.add(name);
|
|
5771
5740
|
});
|
|
5772
|
-
const absolute = (raw) =>
|
|
5741
|
+
const absolute = (raw) => path35.resolve(ref.project.projectDir, expand(raw, settings2));
|
|
5773
5742
|
const requested = options.nativeModules;
|
|
5774
|
-
const includeBinary = (
|
|
5775
|
-
if (!requested || nativeTargets.has(ref) || requested.includes(
|
|
5776
|
-
binaryFrameworks.set(
|
|
5743
|
+
const includeBinary = (name, dir) => {
|
|
5744
|
+
if (!requested || nativeTargets.has(ref) || requested.includes(name) || dir.endsWith(".xcframework") && localSwiftBinaryModules(dir).some((module2) => requested.includes(module2)))
|
|
5745
|
+
binaryFrameworks.set(name, dir);
|
|
5777
5746
|
};
|
|
5778
5747
|
if (!options.nativeModules || nativeTargets.has(ref)) {
|
|
5779
5748
|
const searchRules = recursiveSearchRules(settings2);
|
|
@@ -5781,25 +5750,25 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5781
5750
|
for (const directory of expandSearchPath(absolute(raw), searchRules)) {
|
|
5782
5751
|
if (frameworkSearchDirectories.has(directory)) continue;
|
|
5783
5752
|
frameworkSearchDirectories.add(directory);
|
|
5784
|
-
if (!
|
|
5753
|
+
if (!fs16.statSync(directory, { throwIfNoEntry: false })?.isDirectory() || /\.sdk\/(?:System|Developer)\/Library\/Frameworks\/?$/.test(directory))
|
|
5785
5754
|
continue;
|
|
5786
|
-
for (const entry of
|
|
5787
|
-
const
|
|
5788
|
-
if (!
|
|
5755
|
+
for (const entry of fs16.readdirSync(directory, { withFileTypes: true })) {
|
|
5756
|
+
const name = /^(.+)\.framework$/.exec(entry.name)?.[1];
|
|
5757
|
+
if (!name || byProduct.has(entry.name) || searchedFrameworks.has(name))
|
|
5789
5758
|
continue;
|
|
5790
|
-
const file =
|
|
5791
|
-
if (
|
|
5792
|
-
searchedFrameworks.set(
|
|
5759
|
+
const file = path35.join(directory, entry.name);
|
|
5760
|
+
if (fs16.statSync(file, { throwIfNoEntry: false })?.isDirectory())
|
|
5761
|
+
searchedFrameworks.set(name, file);
|
|
5793
5762
|
}
|
|
5794
5763
|
}
|
|
5795
5764
|
}
|
|
5796
5765
|
}
|
|
5797
5766
|
for (const raw of settingList(settings2("SWIFT_INCLUDE_PATHS"))) {
|
|
5798
5767
|
const dir = absolute(raw);
|
|
5799
|
-
const modulemap =
|
|
5800
|
-
if (!
|
|
5801
|
-
const
|
|
5802
|
-
if (
|
|
5768
|
+
const modulemap = path35.join(dir, "module.modulemap");
|
|
5769
|
+
if (!fs16.existsSync(modulemap)) continue;
|
|
5770
|
+
const name = moduleMapName(fs16.readFileSync(modulemap, "utf8"));
|
|
5771
|
+
if (name && !binaryFrameworks.has(name)) includeBinary(name, dir);
|
|
5803
5772
|
}
|
|
5804
5773
|
for (const phaseId of list(ref.target.buildPhases)) {
|
|
5805
5774
|
const phase = ref.project.object(phaseId);
|
|
@@ -5807,13 +5776,13 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5807
5776
|
const inputs = list(phase.inputPaths).map(absolute);
|
|
5808
5777
|
for (const raw of list(phase.inputFileListPaths)) {
|
|
5809
5778
|
const file = absolute(raw);
|
|
5810
|
-
if (!
|
|
5779
|
+
if (!fs16.existsSync(file)) continue;
|
|
5811
5780
|
xcconfigs.add(file);
|
|
5812
5781
|
inputs.push(...fileListEntries(file, absolute));
|
|
5813
5782
|
}
|
|
5814
5783
|
for (const file of inputs) {
|
|
5815
|
-
const
|
|
5816
|
-
if (
|
|
5784
|
+
const name = /([^/]+)\.xcframework$/.exec(file)?.[1];
|
|
5785
|
+
if (name && !binaryFrameworks.has(name)) includeBinary(name, file);
|
|
5817
5786
|
}
|
|
5818
5787
|
}
|
|
5819
5788
|
}
|
|
@@ -5872,7 +5841,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5872
5841
|
...productAttributes.get(dependencyId)?.length ? { attributes: productAttributes.get(dependencyId) } : {},
|
|
5873
5842
|
source: reference?.isa === "XCRemoteSwiftPackageReference" ? { kind: "remote", url: str(reference.repositoryURL) ?? "" } : reference?.isa === "XCLocalSwiftPackageReference" ? {
|
|
5874
5843
|
kind: "local",
|
|
5875
|
-
dir:
|
|
5844
|
+
dir: path35.resolve(
|
|
5876
5845
|
project.projectDir,
|
|
5877
5846
|
str(reference.relativePath) ?? ""
|
|
5878
5847
|
)
|
|
@@ -5899,26 +5868,26 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5899
5868
|
const file = project.object(fileId);
|
|
5900
5869
|
const tree2 = str(file?.sourceTree);
|
|
5901
5870
|
const rawPath = str(file?.path) ?? "";
|
|
5902
|
-
const
|
|
5903
|
-
if (file?.isa !== "PBXFileReference" || !
|
|
5871
|
+
const name = /([^/]+)\.(xc)?framework$/.exec(rawPath)?.[1];
|
|
5872
|
+
if (file?.isa !== "PBXFileReference" || !name) continue;
|
|
5904
5873
|
if (tree2 === "SDKROOT" || /\/System\/Library\/Frameworks\/[^/]+$/.test(`/${rawPath}`)) {
|
|
5905
|
-
sdkFrameworks.add(
|
|
5874
|
+
sdkFrameworks.add(name);
|
|
5906
5875
|
continue;
|
|
5907
5876
|
}
|
|
5908
5877
|
if (tree2 === "BUILT_PRODUCTS_DIR" || tree2 === "DEVELOPER_DIR" || // a target in the workspace builds it, so it exists only after that build
|
|
5909
|
-
byProduct.has(
|
|
5878
|
+
byProduct.has(path35.basename(rawPath)))
|
|
5910
5879
|
continue;
|
|
5911
5880
|
const resolved = fileId ? project.resolvePath(fileId) : null;
|
|
5912
|
-
if (fileId && resolved !== null && !
|
|
5881
|
+
if (fileId && resolved !== null && !fs16.existsSync(resolved))
|
|
5913
5882
|
throw new Error(
|
|
5914
|
-
`${str(target.name) ?? "target"}: linked framework ${
|
|
5883
|
+
`${str(target.name) ?? "target"}: linked framework ${name} (${fileId}) points at missing ${resolved} in ${project.projectFile}`
|
|
5915
5884
|
);
|
|
5916
|
-
if (!binaryFrameworks.get(
|
|
5885
|
+
if (!binaryFrameworks.get(name)) binaryFrameworks.set(name, resolved);
|
|
5917
5886
|
}
|
|
5918
5887
|
}
|
|
5919
5888
|
}
|
|
5920
|
-
for (const [
|
|
5921
|
-
if (!binaryFrameworks.get(
|
|
5889
|
+
for (const [name, file] of searchedFrameworks)
|
|
5890
|
+
if (!binaryFrameworks.get(name)) binaryFrameworks.set(name, file);
|
|
5922
5891
|
for (const { project, linked } of productReferences) {
|
|
5923
5892
|
if (linked.source.kind === "unnamed" && qualifiedProductKeys.has(`${project}\0${linked.product}`))
|
|
5924
5893
|
continue;
|
|
@@ -5932,7 +5901,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5932
5901
|
({ product }) => !options.nativeModules || nativeTargets.has(built.ref) || options.nativeModules.includes(product)
|
|
5933
5902
|
);
|
|
5934
5903
|
const resolvedFile = workspaceResolvedFile(xcodeprojOrWorkspace);
|
|
5935
|
-
let packageResolved =
|
|
5904
|
+
let packageResolved = fs16.existsSync(resolvedFile) ? [fs16.realpathSync.native(resolvedFile)] : [...new Set(localPackageDirs.map((dir) => path35.join(dir, "Package.resolved")))].filter((file) => fs16.existsSync(file)).map((file) => fs16.realpathSync.native(file)).sort();
|
|
5936
5905
|
if (packageResolved.length === 0) {
|
|
5937
5906
|
const requirements = remotePackageRequirements(projects);
|
|
5938
5907
|
if (requirements.length > 0) {
|
|
@@ -5983,14 +5952,14 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5983
5952
|
} : {},
|
|
5984
5953
|
rootDir: commonAncestor(
|
|
5985
5954
|
[
|
|
5986
|
-
workspace ?
|
|
5955
|
+
workspace ? path35.dirname(workspace) : app.project.projectDir,
|
|
5987
5956
|
...used.map((project) => project.projectDir),
|
|
5988
5957
|
...localPackageDirs,
|
|
5989
5958
|
...linkedProducts.flatMap(
|
|
5990
|
-
({ source }) => source.kind === "local" &&
|
|
5959
|
+
({ source }) => source.kind === "local" && fs16.existsSync(source.dir) ? [source.dir] : []
|
|
5991
5960
|
),
|
|
5992
5961
|
...new Set(podSourceDirs)
|
|
5993
|
-
].map((dir) =>
|
|
5962
|
+
].map((dir) => fs16.realpathSync.native(dir))
|
|
5994
5963
|
),
|
|
5995
5964
|
projectFiles: [
|
|
5996
5965
|
.../* @__PURE__ */ new Set([
|
|
@@ -6011,11 +5980,11 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
6011
5980
|
resourceProducts,
|
|
6012
5981
|
linkedProducts,
|
|
6013
5982
|
localPackageDirs: [
|
|
6014
|
-
...new Set(localPackageDirs.map((dir) =>
|
|
5983
|
+
...new Set(localPackageDirs.map((dir) => fs16.realpathSync.native(dir)))
|
|
6015
5984
|
].sort(),
|
|
6016
|
-
binaryFrameworks: [...binaryFrameworks].map(([
|
|
5985
|
+
binaryFrameworks: [...binaryFrameworks].map(([name, file]) => ({ name, path: file })).sort((left, right) => left.name.localeCompare(right.name)),
|
|
6017
5986
|
sdkFrameworks: [...sdkFrameworks].filter(
|
|
6018
|
-
(
|
|
5987
|
+
(name) => !binaryFrameworks.has(name) && !byProduct.has(`${name}.framework`)
|
|
6019
5988
|
).sort(),
|
|
6020
5989
|
packageResolved,
|
|
6021
5990
|
appTargets: appTargetNames,
|
|
@@ -6067,8 +6036,8 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
6067
6036
|
const icons = dictionary.CFBundleIcons;
|
|
6068
6037
|
const alternates = isRecord(icons) ? icons.CFBundleAlternateIcons : void 0;
|
|
6069
6038
|
if (isRecord(alternates)) {
|
|
6070
|
-
for (const
|
|
6071
|
-
if (
|
|
6039
|
+
for (const name of Object.keys(alternates)) {
|
|
6040
|
+
if (name) alternateIconNames.add(name);
|
|
6072
6041
|
}
|
|
6073
6042
|
}
|
|
6074
6043
|
const alternateSetting = settings?.("ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES") ?? "";
|
|
@@ -6106,7 +6075,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
6106
6075
|
const rtcAppGroupIdentifier = nonEmptyString2(dictionary.RTCAppGroupIdentifier);
|
|
6107
6076
|
const screenShareExtensionBundleId = typeof dictionary.ScreenShareExtensionBundleId === "string" ? dictionary.ScreenShareExtensionBundleId : void 0;
|
|
6108
6077
|
const rootModuleName = readRootModuleName(
|
|
6109
|
-
app.allSources.filter((file) => /Delegate\.(?:swift|mm|m)$/.test(file) &&
|
|
6078
|
+
app.allSources.filter((file) => /Delegate\.(?:swift|mm|m)$/.test(file) && fs17.existsSync(file)).map((file) => fs17.readFileSync(file, "utf8"))
|
|
6110
6079
|
);
|
|
6111
6080
|
return stampNativeBuildSdk({
|
|
6112
6081
|
...app.keychainAccessGroups === void 0 ? {} : { keychainAccessGroups: app.keychainAccessGroups },
|
|
@@ -6128,7 +6097,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
6128
6097
|
googleSignIn: readGoogleSignInConfiguration(
|
|
6129
6098
|
dictionary,
|
|
6130
6099
|
Object.fromEntries(
|
|
6131
|
-
app.resources.filter((file) => file.endsWith(".plist")).map((file) => [file, parseInfoPlist(
|
|
6100
|
+
app.resources.filter((file) => file.endsWith(".plist")).map((file) => [file, parseInfoPlist(fs17.readFileSync(file, "utf8"))])
|
|
6132
6101
|
)
|
|
6133
6102
|
),
|
|
6134
6103
|
supportedInterfaceOrientations,
|
|
@@ -6137,11 +6106,11 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
6137
6106
|
alternateIconNames: [...alternateIconNames],
|
|
6138
6107
|
appIconArtwork: resolveNativeAppIconArtwork(
|
|
6139
6108
|
app.resources,
|
|
6140
|
-
(file) =>
|
|
6109
|
+
(file) => fs17.readFileSync(file, "utf8"),
|
|
6141
6110
|
(file) => {
|
|
6142
|
-
const extension =
|
|
6111
|
+
const extension = path36.extname(file).toLowerCase();
|
|
6143
6112
|
const contentType = extension === ".jpg" || extension === ".jpeg" ? "image/jpeg" : extension === ".webp" ? "image/webp" : "image/png";
|
|
6144
|
-
return `data:${contentType};base64,${
|
|
6113
|
+
return `data:${contentType};base64,${fs17.readFileSync(file).toString("base64")}`;
|
|
6145
6114
|
},
|
|
6146
6115
|
icons,
|
|
6147
6116
|
app.appIconName,
|
|
@@ -6170,11 +6139,11 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
|
|
|
6170
6139
|
const read = selectNativeAppIdentityReader(platform, {
|
|
6171
6140
|
android: () => null,
|
|
6172
6141
|
ios: () => {
|
|
6173
|
-
const nested =
|
|
6174
|
-
const iosRoot =
|
|
6142
|
+
const nested = path36.join(projectRoot, "ios");
|
|
6143
|
+
const iosRoot = fs17.existsSync(nested) ? nested : projectRoot;
|
|
6175
6144
|
const prefix = iosRoot === nested ? "ios/" : "";
|
|
6176
6145
|
const files = {};
|
|
6177
|
-
for (const entry of
|
|
6146
|
+
for (const entry of fs17.readdirSync(iosRoot, { withFileTypes: true })) {
|
|
6178
6147
|
if (entry.name === "Pods") continue;
|
|
6179
6148
|
if (entry.isDirectory()) {
|
|
6180
6149
|
const names = entry.name.endsWith(".xcodeproj") ? ["project.pbxproj"] : [
|
|
@@ -6182,17 +6151,17 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
|
|
|
6182
6151
|
"AppDelegate.swift",
|
|
6183
6152
|
"AppDelegate.mm",
|
|
6184
6153
|
"AppDelegate.m",
|
|
6185
|
-
...
|
|
6154
|
+
...fs17.readdirSync(path36.join(iosRoot, entry.name)).filter((name) => name.endsWith(".entitlements"))
|
|
6186
6155
|
];
|
|
6187
|
-
for (const
|
|
6188
|
-
const relative2 = `${prefix}${entry.name}/${
|
|
6189
|
-
const file =
|
|
6190
|
-
if (
|
|
6156
|
+
for (const name of names) {
|
|
6157
|
+
const relative2 = `${prefix}${entry.name}/${name}`;
|
|
6158
|
+
const file = path36.join(projectRoot, relative2);
|
|
6159
|
+
if (fs17.existsSync(file)) files[relative2] = fs17.readFileSync(file, "utf8");
|
|
6191
6160
|
}
|
|
6192
6161
|
} else if (/AppDelegate\.(?:swift|mm|m)$|\.entitlements$/.test(entry.name)) {
|
|
6193
6162
|
const relative2 = `${prefix}${entry.name}`;
|
|
6194
|
-
const file =
|
|
6195
|
-
if (
|
|
6163
|
+
const file = path36.join(projectRoot, relative2);
|
|
6164
|
+
if (fs17.existsSync(file)) files[relative2] = fs17.readFileSync(file, "utf8");
|
|
6196
6165
|
}
|
|
6197
6166
|
}
|
|
6198
6167
|
const identity = extractNativeAppIdentityFromFiles(
|
|
@@ -6209,41 +6178,41 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
|
|
|
6209
6178
|
function readAndroidNativeAppIdentity(projectRoot, androidMergedManifest) {
|
|
6210
6179
|
const files = {};
|
|
6211
6180
|
if (androidMergedManifest) {
|
|
6212
|
-
const file =
|
|
6213
|
-
if (!
|
|
6214
|
-
files[androidMergedManifest] =
|
|
6181
|
+
const file = path36.resolve(projectRoot, androidMergedManifest);
|
|
6182
|
+
if (!fs17.existsSync(file)) return null;
|
|
6183
|
+
files[androidMergedManifest] = fs17.readFileSync(file, "utf8");
|
|
6215
6184
|
} else {
|
|
6216
|
-
const androidRoot =
|
|
6217
|
-
if (!
|
|
6185
|
+
const androidRoot = path36.join(projectRoot, "android");
|
|
6186
|
+
if (!fs17.existsSync(androidRoot)) return null;
|
|
6218
6187
|
const collect = (directory) => {
|
|
6219
|
-
for (const entry of
|
|
6220
|
-
const file =
|
|
6188
|
+
for (const entry of fs17.readdirSync(directory, { withFileTypes: true })) {
|
|
6189
|
+
const file = path36.join(directory, entry.name);
|
|
6221
6190
|
if (entry.isDirectory()) collect(file);
|
|
6222
6191
|
else if (entry.isFile() && entry.name === "AndroidManifest.xml")
|
|
6223
|
-
files[
|
|
6192
|
+
files[path36.relative(projectRoot, file).split(path36.sep).join("/")] = fs17.readFileSync(file, "utf8");
|
|
6224
6193
|
}
|
|
6225
6194
|
};
|
|
6226
|
-
for (const module of
|
|
6195
|
+
for (const module of fs17.readdirSync(androidRoot, { withFileTypes: true })) {
|
|
6227
6196
|
if (!module.isDirectory()) continue;
|
|
6228
|
-
const outputs =
|
|
6197
|
+
const outputs = path36.join(
|
|
6229
6198
|
androidRoot,
|
|
6230
6199
|
module.name,
|
|
6231
6200
|
"build/intermediates/merged_manifests"
|
|
6232
6201
|
);
|
|
6233
|
-
if (
|
|
6202
|
+
if (fs17.existsSync(outputs)) collect(outputs);
|
|
6234
6203
|
}
|
|
6235
6204
|
}
|
|
6236
6205
|
for (const manifest of Object.keys(files)) {
|
|
6237
6206
|
const resourceDirectory = androidMergedResourceValuesDirectory(manifest);
|
|
6238
6207
|
if (!resourceDirectory) continue;
|
|
6239
|
-
const absolute =
|
|
6240
|
-
if (!
|
|
6241
|
-
for (const entry of
|
|
6208
|
+
const absolute = path36.resolve(projectRoot, resourceDirectory);
|
|
6209
|
+
if (!fs17.existsSync(absolute)) continue;
|
|
6210
|
+
for (const entry of fs17.readdirSync(absolute, { withFileTypes: true })) {
|
|
6242
6211
|
if (!entry.isDirectory() || !/^values(?:-|$)/.test(entry.name)) continue;
|
|
6243
|
-
for (const resource of
|
|
6212
|
+
for (const resource of fs17.readdirSync(path36.join(absolute, entry.name))) {
|
|
6244
6213
|
if (!resource.endsWith(".xml")) continue;
|
|
6245
6214
|
const file = `${resourceDirectory}/${entry.name}/${resource}`;
|
|
6246
|
-
files[file] =
|
|
6215
|
+
files[file] = fs17.readFileSync(path36.resolve(projectRoot, file), "utf8");
|
|
6247
6216
|
}
|
|
6248
6217
|
}
|
|
6249
6218
|
}
|
|
@@ -6260,7 +6229,7 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget, enviro
|
|
|
6260
6229
|
const app = readIosAppTarget(projectRoot, iosTarget, environment);
|
|
6261
6230
|
if (!app) return null;
|
|
6262
6231
|
const identity = readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist);
|
|
6263
|
-
const projectManifestPath =
|
|
6232
|
+
const projectManifestPath = path36.join(projectRoot, "package.json");
|
|
6264
6233
|
const projectRequire = createRequire(projectManifestPath);
|
|
6265
6234
|
let reanimatedManifestPath;
|
|
6266
6235
|
try {
|
|
@@ -6274,30 +6243,30 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget, enviro
|
|
|
6274
6243
|
throw error;
|
|
6275
6244
|
}
|
|
6276
6245
|
const installedManifest = JSON.parse(
|
|
6277
|
-
|
|
6246
|
+
fs17.readFileSync(reanimatedManifestPath, "utf8")
|
|
6278
6247
|
);
|
|
6279
6248
|
const installedVersion = isRecord(installedManifest) ? nonEmptyString2(installedManifest.version) : void 0;
|
|
6280
6249
|
if (!installedVersion) throw new Error("Reanimated package version is malformed");
|
|
6281
6250
|
if (Number.parseInt(installedVersion, 10) < 4) return identity;
|
|
6282
6251
|
const defaults = JSON.parse(
|
|
6283
|
-
|
|
6284
|
-
|
|
6285
|
-
|
|
6252
|
+
fs17.readFileSync(
|
|
6253
|
+
path36.join(
|
|
6254
|
+
path36.dirname(reanimatedManifestPath),
|
|
6286
6255
|
"src/featureFlags/staticFlags.json"
|
|
6287
6256
|
),
|
|
6288
6257
|
"utf8"
|
|
6289
6258
|
)
|
|
6290
6259
|
);
|
|
6291
6260
|
if (!isRecord(defaults)) throw new Error("Reanimated static flags are malformed");
|
|
6292
|
-
const manifest = JSON.parse(
|
|
6261
|
+
const manifest = JSON.parse(fs17.readFileSync(projectManifestPath, "utf8"));
|
|
6293
6262
|
const reanimated = isRecord(manifest) ? manifest.reanimated : void 0;
|
|
6294
6263
|
const overrides = isRecord(reanimated) ? reanimated.staticFeatureFlags : void 0;
|
|
6295
6264
|
if (overrides !== void 0 && !isRecord(overrides)) {
|
|
6296
6265
|
throw new Error("Reanimated static flag overrides are malformed");
|
|
6297
6266
|
}
|
|
6298
6267
|
const flags = {};
|
|
6299
|
-
for (const [
|
|
6300
|
-
flags[
|
|
6268
|
+
for (const [name, value] of Object.entries({ ...defaults, ...overrides })) {
|
|
6269
|
+
flags[name] = String(value) === "true";
|
|
6301
6270
|
}
|
|
6302
6271
|
if (flags.USE_LEGACY_LAYOUT_ANIMATIONS_PROXY && flags.ENABLE_SHARED_ELEMENT_TRANSITIONS) {
|
|
6303
6272
|
throw new Error(
|