peachsim 0.1.1815 → 0.1.1818
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/commands/agent-indicator-mode.ts +2 -1
- package/cli/commands/coverage-swift.ts +4 -3
- package/cli/commands/flow.ts +7 -0
- package/cli/commands/inspect/core.ts +1 -1
- package/cli/commands/maestro-compare.ts +7 -0
- package/cli/commands/package.ts +87 -31
- package/cli/commands/screenshot-mode.ts +2 -1
- package/cli/commands/shell-boolean-mode.ts +7 -3
- package/cli/commands/shell-url.ts +4 -0
- package/cli/commands/show-touches-mode.ts +2 -1
- package/cli/commands/test.ts +3 -2
- package/cli/commands/three-mode.ts +2 -1
- package/cli/outbound-endpoints.ts +1 -1
- package/cli/packaged-app-launcher.ts +6 -1
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +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 +5728 -7551
- 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 +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +13 -4
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +5234 -5704
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +4913 -6811
- package/dist-lib/host/fetch-proxy-handler.cjs +13 -4
- 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 +40 -30
- 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 +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +39 -29
- package/dist-lib/native-app-identity-project.cjs +31 -26
- package/dist-lib/native-app-identity-project.mjs +295 -279
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- 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 +29 -24
- package/dist-lib/public-origins-lib.json +121 -93
- 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 +1 -1
- package/dist-lib/sdk.cjs +2 -2
- package/dist-lib/sdk.mjs +2 -2
- package/dist-lib/skills.cjs +64622 -66476
- package/dist-lib/swift-compile.cjs +328 -265
- package/dist-lib/swift-compile.mjs +335 -270
- 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 +52 -6
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +2405 -2262
- package/dist-lib/vite.cjs +13 -4
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +5 -0
- package/dist-types/packages/peach-engine/src/render-worker/map-command-channel.d.ts +41 -0
- package/dist-types/packages/peach-engine/src/render-worker/mapServicesContract.d.ts +45 -0
- package/package.json +2 -1
- package/runtime-companion.json +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes +1 -1
- package/sdk/ios/usr/include/module.modulemap +3 -0
- package/sdk/ios/usr/include/notify.modulemap +9 -0
- package/sdk/ios/usr/lib/swift/Darwin.swiftmodule/arm64-apple-ios-simulator.swiftinterface +4 -0
- package/sdk/ios/usr/lib/swift/Dispatch.swiftmodule/arm64-apple-ios-simulator.swiftinterface +1 -1
- package/sdk/ios/usr/lib/swift/Foundation.swiftmodule/arm64-apple-ios-simulator.swiftinterface +7 -1
- package/sdk/ios/usr/lib/swift/ObjectiveC.swiftmodule/arm64-apple-ios-simulator.swiftinterface +1 -0
- package/sdk/ios/usr/lib/swift/SwiftUI.swiftmodule/arm64-apple-ios-simulator.swiftinterface +21 -0
- package/sdk/ios/usr/lib/swift/SwiftUICore.swiftmodule/arm64-apple-ios-simulator.swiftinterface +6 -1
- package/sdk/ios/wasm/include/__header_time.h +4 -0
- package/sdk/ios/wasm/include/pthread.h +2 -0
- package/sdk/ios/wasm/include/sys/mman.h +1 -1
- package/sdk/ios/wasm/include/sys/resource.h +31 -0
- package/sdk/ios/wasm/include/unistd.h +4 -0
- package/src/answeredNativePackages.ts +43 -0
- package/src/cli-runtime.ts +2 -9
- package/src/expo-discovery-cache.ts +71 -52
- package/src/expo-kotlin-host.ts +11 -9
- package/src/expo-swift-host.ts +55 -13
- package/src/installed-native-libraries.ts +103 -20
- package/src/native-static-libraries.ts +69 -33
- package/src/nitro-adapter.ts +0 -9
- package/src/nitro-bundle.ts +8 -6
- package/src/nitro-compile.ts +45 -16
- package/src/nitro-compiler-digest.ts +2 -4
- package/src/nitro-superset.lock.json +19 -251
- package/src/nitro-superset.ts +63 -68
- package/src/plist-bytes.ts +9 -0
- package/src/portable-expo-workspace.ts +4 -3
- package/src/react-native-bridge-modules.ts +13 -19
- package/src/swift-compile.ts +379 -269
- package/src/swift-cxx-reachable.ts +13 -0
- package/src/swift-distribution.ts +3 -4
- package/src/swift-host.ts +5 -3
- package/src/swift-installed-targets.ts +32 -14
- package/src/swift-native-pin.ts +45 -0
- package/src/swift-objc-compile.ts +23 -1
- package/src/swift-objc-standin.ts +14 -7
- package/src/swift-package-manifest.ts +2 -2
- package/src/swift-root-lock.ts +4 -3
- package/src/swift-standins.ts +41 -38
- package/src/swift-toolchain.ts +69 -12
- package/src/swift-wasm-prune.ts +1 -0
- package/src/swift-xcframework.ts +23 -12
- package/src/swiftContract.ts +2 -0
- package/src/swiftNativePinContract.ts +68 -0
- package/src/turbo-bundle.ts +14 -6
- package/src/turbo-compile.ts +76 -11
- package/src/turbo-source.ts +93 -18
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.1818 | (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": "8b398ceb60faf4a5729842cab60f49c2e601d6fc6bbbc1faec9023ecb8141990", "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": "08583ee03b92e00f3f331e52fb480ef81c9fd7e668d796a5afcfa07978bcaf03", "swift-coverage/xcode-strings.ts": "f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c", "swift-coverage/reader.ts": "da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c", "swift-coverage/provenance.ts": "eb3b41ae8b58b48f6758f084800f188dfb1edb227e483abdd6b80cde66e849b9", "swift-package-manifest.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": "8b398ceb60faf4a5729842cab60f49c2e601d6fc6bbbc1faec9023ecb8141990", "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": "08583ee03b92e00f3f331e52fb480ef81c9fd7e668d796a5afcfa07978bcaf03", "swift-coverage/xcode-strings.ts": "f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c", "swift-coverage/reader.ts": "da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c", "swift-coverage/provenance.ts": "eb3b41ae8b58b48f6758f084800f188dfb1edb227e483abdd6b80cde66e849b9", "swift-package-manifest.ts": "26f8d4a25d1af9917f0005153c73c9cefa4f6681c9d56c6333b8096190db0431", "swift-package.ts": "80932fd45cd31e57871475180148f79f273719ac94d94deabce16dc138fdf387", "swift-source-file.ts": "93fd659ed63a27b67f54a7c229a7ceb636dc9c59e68414920ba36cff1eda1f94", "swift-toolchain.ts": "a90155695844684e625ab83687161104f028ef34030715a40042a4407b77fca0", "home-paths.ts": "744d0e29fcc4baae6748161da45dd75e357348703331dad685c74ec813abcc83", "xcode-header-search.ts": "f8c3d557b4eca5ddad32907545353eb7ad53b2ebd0969d9ed8f7275e109a13b1", "xcode-project.ts": "76e78ea9974671ff3b7e7a5d65e508306d8eadeb6b6bf859bd2ccc03f4ef6e72", "xcode-target-members.ts": "75a23a5fc54cc6f5e952d545f2f0f86241ff36525ab4e568c172e83c3bfb9da4", "xcode-json-project.ts": "41990ebbe4b488eef34e74c4608b4b48e5a5b299ba98ca7fbcfdfa0e77be63b6", "openstep-plist.ts": "74e6ce1dac80c9c318e0e9f5e3e8cd19a898a8820c36fc160609695bcb59dcd3" };
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
|
|
@@ -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 path31 from "node:path";
|
|
1161
1161
|
|
|
1162
1162
|
// src/android-app-identity.ts
|
|
1163
1163
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -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) {
|
|
1548
1548
|
const parents = /* @__PURE__ */ new Map();
|
|
1549
1549
|
for (const [id, entry] of Object.entries(objects)) {
|
|
1550
1550
|
if (!isDict(entry)) continue;
|
|
@@ -1562,11 +1562,11 @@ function xcodePathResolver(objects, projectDir, join7) {
|
|
|
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
|
}
|
|
1571
1571
|
}
|
|
1572
1572
|
paths.set(id, result);
|
|
@@ -1588,7 +1588,7 @@ function xcodeTargetMemberVisitor(objects) {
|
|
|
1588
1588
|
if (isDict(group) && group.isa === "PBXFileSystemSynchronizedRootGroup")
|
|
1589
1589
|
synchronizedGroups.push({ id, group });
|
|
1590
1590
|
}
|
|
1591
|
-
return (targetId, resolvePath, filesUnder,
|
|
1591
|
+
return (targetId, resolvePath, filesUnder, join8, visit) => {
|
|
1592
1592
|
const target = objects[targetId];
|
|
1593
1593
|
if (!isDict(target)) return;
|
|
1594
1594
|
for (const phaseId of list(target.buildPhases)) {
|
|
@@ -1623,7 +1623,7 @@ function xcodeTargetMemberVisitor(objects) {
|
|
|
1623
1623
|
for (const relative2 of list(exception.membershipExceptions))
|
|
1624
1624
|
exceptions.add(relative2);
|
|
1625
1625
|
}
|
|
1626
|
-
const members = owned.has(groupId) ? filesUnder(folder) : [...exceptions].flatMap((relative2) => filesUnder(
|
|
1626
|
+
const members = owned.has(groupId) ? filesUnder(folder) : [...exceptions].flatMap((relative2) => filesUnder(join8(folder, relative2)));
|
|
1627
1627
|
for (const file of members) {
|
|
1628
1628
|
const relative2 = file.slice(prefix.length);
|
|
1629
1629
|
const excepted = [...exceptions].some(
|
|
@@ -1757,10 +1757,10 @@ function appTargetReleaseSettings(pbxproj, targetName, infoPlistRelativePath) {
|
|
|
1757
1757
|
var APP_DELEGATE_PATH_RE = /(?:^|\/)(?:ios\/)?([^/]+)\/AppDelegate\.(?:swift|mm|m)$/;
|
|
1758
1758
|
function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri) {
|
|
1759
1759
|
const pbxprojPath = Object.keys(files).find(
|
|
1760
|
-
(
|
|
1760
|
+
(path32) => /(?:^|\/)ios\/[^/]+\.xcodeproj\/project\.pbxproj$/.test(path32)
|
|
1761
1761
|
) ?? Object.keys(files).find(
|
|
1762
|
-
(
|
|
1763
|
-
) ?? Object.keys(files).find((
|
|
1762
|
+
(path32) => /(?:^|\/)[^/]+\.xcodeproj\/project\.pbxproj$/.test(path32)
|
|
1763
|
+
) ?? Object.keys(files).find((path32) => /(?:^|\/)project\.pbxproj$/.test(path32));
|
|
1764
1764
|
if (!pbxprojPath) return null;
|
|
1765
1765
|
const pbxproj = files[pbxprojPath];
|
|
1766
1766
|
let objects = {};
|
|
@@ -1802,7 +1802,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
|
|
|
1802
1802
|
} else if (applicationTargetNames.size === 1) {
|
|
1803
1803
|
targetName = [...applicationTargetNames][0];
|
|
1804
1804
|
} else if (applicationTargetNames.size > 1) {
|
|
1805
|
-
const delegateTargets = Object.keys(files).filter((
|
|
1805
|
+
const delegateTargets = Object.keys(files).filter((path32) => !path32.includes("/Pods/")).map((path32) => path32.match(APP_DELEGATE_PATH_RE)?.[1]).filter(
|
|
1806
1806
|
(name2) => typeof name2 === "string" && applicationTargetNames.has(name2)
|
|
1807
1807
|
);
|
|
1808
1808
|
if (delegateTargets.length === 1) {
|
|
@@ -2000,7 +2000,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
|
|
|
2000
2000
|
if (resourceUri) {
|
|
2001
2001
|
if (!selectedTarget)
|
|
2002
2002
|
throw new Error("native app icon target membership is unresolved");
|
|
2003
|
-
const
|
|
2003
|
+
const join8 = (base, own) => {
|
|
2004
2004
|
const segments = [];
|
|
2005
2005
|
for (const segment of `${base}/${own}`.split("/")) {
|
|
2006
2006
|
if (segment === "" || segment === ".") continue;
|
|
@@ -2013,22 +2013,22 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
|
|
|
2013
2013
|
const project = Object.values(objects).find(
|
|
2014
2014
|
(object) => isRecord(object) && object.isa === "PBXProject"
|
|
2015
2015
|
);
|
|
2016
|
-
const projectDir =
|
|
2016
|
+
const projectDir = join8(
|
|
2017
2017
|
pbxprojPath.replace(/(?:^|\/)[^/]+\.xcodeproj\/project\.pbxproj$/, ""),
|
|
2018
2018
|
isRecord(project) && typeof project.projectDirPath === "string" ? project.projectDirPath : ""
|
|
2019
2019
|
);
|
|
2020
2020
|
const paths = Object.keys(files);
|
|
2021
2021
|
xcodeTargetMemberVisitor(objects)(
|
|
2022
2022
|
selectedTarget.id,
|
|
2023
|
-
xcodePathResolver(objects, projectDir,
|
|
2023
|
+
xcodePathResolver(objects, projectDir, join8),
|
|
2024
2024
|
(file) => {
|
|
2025
2025
|
if (Object.hasOwn(files, file)) return [file];
|
|
2026
2026
|
const prefix = file === "" ? "" : `${file.replace(/\/$/, "")}/`;
|
|
2027
2027
|
return paths.filter(
|
|
2028
|
-
(
|
|
2028
|
+
(path32) => path32.startsWith(prefix) && !/(?:^|\/)\./.test(path32.slice(prefix.length))
|
|
2029
2029
|
);
|
|
2030
2030
|
},
|
|
2031
|
-
|
|
2031
|
+
join8,
|
|
2032
2032
|
(file, kind) => {
|
|
2033
2033
|
if (kind === "resource") resources.add(file);
|
|
2034
2034
|
}
|
|
@@ -2036,7 +2036,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
|
|
|
2036
2036
|
}
|
|
2037
2037
|
const rootModuleName = readRootModuleName(
|
|
2038
2038
|
Object.entries(files).filter(
|
|
2039
|
-
([
|
|
2039
|
+
([path32]) => !path32.includes("/Pods/") && (/(?:^|\/)(?:ios\/)?AppDelegate\.(?:swift|mm|m)$/.test(path32) || path32.match(APP_DELEGATE_PATH_RE)?.[1] === targetName)
|
|
2040
2040
|
).map(([, source]) => source)
|
|
2041
2041
|
);
|
|
2042
2042
|
return {
|
|
@@ -2141,13 +2141,15 @@ import path2 from "node:path";
|
|
|
2141
2141
|
|
|
2142
2142
|
// src/swift-toolchain.ts
|
|
2143
2143
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
2144
|
-
import { execFile, execFileSync } from "node:child_process";
|
|
2144
|
+
import { execFile, execFileSync, spawn } from "node:child_process";
|
|
2145
2145
|
import { createHash } from "node:crypto";
|
|
2146
2146
|
import fs from "node:fs";
|
|
2147
2147
|
import os from "node:os";
|
|
2148
2148
|
import path from "node:path";
|
|
2149
|
+
import { pipeline } from "node:stream/promises";
|
|
2149
2150
|
import { fileURLToPath } from "node:url";
|
|
2150
2151
|
import { promisify } from "node:util";
|
|
2152
|
+
import zlib from "node:zlib";
|
|
2151
2153
|
function peachsimPackageRoot() {
|
|
2152
2154
|
let dir = import.meta.dirname;
|
|
2153
2155
|
while (!fs.existsSync(path.join(dir, "package.json")) && dir !== path.dirname(dir))
|
|
@@ -2159,6 +2161,7 @@ var SWIFT_HOST_COMPILER_ID = "81b2c791c27276bf";
|
|
|
2159
2161
|
var compilerArchives = {
|
|
2160
2162
|
"swift-6.4.0-RELEASE-custom-0b2d0a9011c88e66": {
|
|
2161
2163
|
identity: "0b2d0a9011c88e66",
|
|
2164
|
+
archive: "tar.gz",
|
|
2162
2165
|
hosts: {
|
|
2163
2166
|
"darwin-arm64": {
|
|
2164
2167
|
checksum: "dc6a494227297ea657e8e5f7c5b4a861cb5e142bdbcfcb028ace2aeb19db90cc",
|
|
@@ -2176,6 +2179,7 @@ var compilerArchives = {
|
|
|
2176
2179
|
},
|
|
2177
2180
|
"swift-6.4.0-RELEASE-custom-f7c03c3f59ec5d83": {
|
|
2178
2181
|
identity: "f7c03c3f59ec5d83",
|
|
2182
|
+
archive: "tar.gz",
|
|
2179
2183
|
hosts: {
|
|
2180
2184
|
"darwin-arm64": {
|
|
2181
2185
|
checksum: "8946a2d4716d3b0784cef7a85a35f66537bd319c4c5a48c63457d607260df5c5",
|
|
@@ -2193,6 +2197,7 @@ var compilerArchives = {
|
|
|
2193
2197
|
},
|
|
2194
2198
|
"swift-6.4.0-RELEASE-custom-3e3dca8fd1d82975": {
|
|
2195
2199
|
identity: "3e3dca8fd1d82975",
|
|
2200
|
+
archive: "tar.gz",
|
|
2196
2201
|
hosts: {
|
|
2197
2202
|
"darwin-arm64": {
|
|
2198
2203
|
checksum: "dfad56454f5e1e465071ff708bf485be65b438cf55d02b04d26d17d26df9f54a",
|
|
@@ -2210,6 +2215,7 @@ var compilerArchives = {
|
|
|
2210
2215
|
},
|
|
2211
2216
|
"swift-6.4.0-RELEASE-custom-b082ac5437336790": {
|
|
2212
2217
|
identity: "b082ac5437336790",
|
|
2218
|
+
archive: "tar.gz",
|
|
2213
2219
|
hosts: {
|
|
2214
2220
|
"darwin-arm64": {
|
|
2215
2221
|
checksum: "85e601982321d3a6f81f05928bc9bbe7a61bc75b27ce24508e79f6b5b537254d",
|
|
@@ -2227,6 +2233,7 @@ var compilerArchives = {
|
|
|
2227
2233
|
},
|
|
2228
2234
|
"swift-6.4.0-RELEASE-custom-9cdaffdb6b37fb47": {
|
|
2229
2235
|
identity: "9cdaffdb6b37fb47",
|
|
2236
|
+
archive: "tar.gz",
|
|
2230
2237
|
hosts: {
|
|
2231
2238
|
"darwin-arm64": {
|
|
2232
2239
|
checksum: "fdd3f88cf76a8dc2083275d4253255030068a25b5ba68acbf59e0407c45677dd",
|
|
@@ -2244,6 +2251,7 @@ var compilerArchives = {
|
|
|
2244
2251
|
},
|
|
2245
2252
|
"swift-6.4.0-RELEASE-custom-bd49e2f77434e7b1": {
|
|
2246
2253
|
identity: "bd49e2f77434e7b1",
|
|
2254
|
+
archive: "tar.gz",
|
|
2247
2255
|
hosts: {
|
|
2248
2256
|
"darwin-arm64": {
|
|
2249
2257
|
checksum: "e815b06394566e8125475afc8f1807f7f465318c845549c5831043cdc28eca64",
|
|
@@ -2261,6 +2269,7 @@ var compilerArchives = {
|
|
|
2261
2269
|
},
|
|
2262
2270
|
"swift-6.4.0-RELEASE-custom-13450179a7e01c81": {
|
|
2263
2271
|
identity: "13450179a7e01c81",
|
|
2272
|
+
archive: "tar.gz",
|
|
2264
2273
|
hosts: {
|
|
2265
2274
|
"darwin-arm64": {
|
|
2266
2275
|
checksum: "a29be6b722f15c7aafac26ba5703a7392f49ce7ea5e1c56548846b7e458290f7",
|
|
@@ -2278,6 +2287,7 @@ var compilerArchives = {
|
|
|
2278
2287
|
},
|
|
2279
2288
|
"swift-6.4.0-RELEASE-custom-f6868fa6054e83d6": {
|
|
2280
2289
|
identity: "f6868fa6054e83d6",
|
|
2290
|
+
archive: "tar.gz",
|
|
2281
2291
|
hosts: {
|
|
2282
2292
|
"darwin-arm64": {
|
|
2283
2293
|
checksum: "bd80c2f35864ec29883dd22001d0165821e80d78002fc12f92406c3c708694a4",
|
|
@@ -2295,23 +2305,25 @@ var compilerArchives = {
|
|
|
2295
2305
|
},
|
|
2296
2306
|
"swift-6.4.0-RELEASE-custom-a560ff35bf882b5c": {
|
|
2297
2307
|
identity: "a560ff35bf882b5c",
|
|
2308
|
+
archive: "tar.zst",
|
|
2298
2309
|
hosts: {
|
|
2299
2310
|
"darwin-arm64": {
|
|
2300
|
-
checksum: "
|
|
2311
|
+
checksum: "36c50bcdfba88a4c0989af0bd60371497eb4403aa7b80644b479fa509a2187a9",
|
|
2301
2312
|
manifest: "253e891527d2213f54eace768b902de89de5e9495a3c5f4018de1985516bd553"
|
|
2302
2313
|
},
|
|
2303
2314
|
"linux-x64": {
|
|
2304
|
-
checksum: "
|
|
2315
|
+
checksum: "ba25da9182314fc7b7dd2fc041280e1c7b409f80a1fbccdfa5c342669d164c8e",
|
|
2305
2316
|
manifest: "6f951cc4071dd0d6054d85711a7c5fe272273658847831b477a8b24be7254ca0"
|
|
2306
2317
|
},
|
|
2307
2318
|
"linux-arm64": {
|
|
2308
|
-
checksum: "
|
|
2319
|
+
checksum: "5f0f4456e9fe22b5486025db9f679c865841660797d71761245291c2c6811c20",
|
|
2309
2320
|
manifest: "b6f62fca2ec37593e274ee5bac474f21ffc5db14cd82f492ccbc774f8e9b75d8"
|
|
2310
2321
|
}
|
|
2311
2322
|
}
|
|
2312
2323
|
},
|
|
2313
2324
|
[SWIFT_HOST_COMPILER_RELEASE]: {
|
|
2314
2325
|
identity: SWIFT_HOST_COMPILER_ID,
|
|
2326
|
+
archive: "tar.gz",
|
|
2315
2327
|
hosts: {
|
|
2316
2328
|
"darwin-arm64": {
|
|
2317
2329
|
checksum: "bc51b83d9e2e01c9873875326544734486d3ff3a868d650379c304045e8838d3",
|
|
@@ -2427,33 +2439,13 @@ var NATIVE_GRAPH_INPUTS = {
|
|
|
2427
2439
|
target: IOS_SDK_TARGET
|
|
2428
2440
|
};
|
|
2429
2441
|
var NATIVE_GRAPH_ID = createHash2("sha256").update(JSON.stringify(NATIVE_GRAPH_INPUTS)).digest("hex");
|
|
2430
|
-
function stripExternalSourceMarks(text2) {
|
|
2431
|
-
return text2.split("\n").map(
|
|
2432
|
-
(line) => line.startsWith("#define PEACH_SWIFT_CLASS(") ? line : line.replace(/PEACH_SWIFT_CLASS\(\w+\)\s*/g, "")
|
|
2433
|
-
).join("\n");
|
|
2434
|
-
}
|
|
2435
|
-
function iosSdkEntries() {
|
|
2436
|
-
const overlays = Object.entries(IOS_SDK_OVERLAYS).map(
|
|
2437
|
-
([module, text2]) => [
|
|
2438
|
-
`usr/lib/swift/${module}.swiftmodule/arm64-apple-ios-simulator.swiftinterface`,
|
|
2439
|
-
`// swift-interface-format-version: 1.0
|
|
2440
|
-
// swift-module-flags: -target ${IOS_SDK_TARGET} -enable-objc-interop -enable-library-evolution -module-name ${module}
|
|
2441
|
-
${text2}`
|
|
2442
|
-
]
|
|
2443
|
-
);
|
|
2444
|
-
const headers = Object.entries(IOS_SDK_HEADERS).map(
|
|
2445
|
-
([file, text2]) => [file, stripExternalSourceMarks(text2)]
|
|
2446
|
-
);
|
|
2447
|
-
return [...headers, ...overlays].sort(([a], [b]) => a < b ? -1 : 1);
|
|
2448
|
-
}
|
|
2449
|
-
var IOS_SDK_ID = createHash2("sha256").update(JSON.stringify(iosSdkEntries())).digest("hex").slice(0, 16);
|
|
2450
2442
|
|
|
2451
2443
|
// src/xcode-project.ts
|
|
2452
2444
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
2453
2445
|
import { execFileSync as execFileSync11 } from "node:child_process";
|
|
2454
|
-
import { createHash as
|
|
2455
|
-
import
|
|
2456
|
-
import
|
|
2446
|
+
import { createHash as createHash15 } from "node:crypto";
|
|
2447
|
+
import fs16 from "node:fs";
|
|
2448
|
+
import path30 from "node:path";
|
|
2457
2449
|
import plist2 from "plist";
|
|
2458
2450
|
|
|
2459
2451
|
// src/prepared-xcode-phases.ts
|
|
@@ -2820,31 +2812,32 @@ import {
|
|
|
2820
2812
|
execFile as execFile3,
|
|
2821
2813
|
execFileSync as execFileSync10
|
|
2822
2814
|
} from "node:child_process";
|
|
2823
|
-
import { createHash as
|
|
2824
|
-
import
|
|
2815
|
+
import { createHash as createHash14 } from "node:crypto";
|
|
2816
|
+
import fs15 from "node:fs";
|
|
2825
2817
|
import os8 from "node:os";
|
|
2826
|
-
import
|
|
2818
|
+
import path28 from "node:path";
|
|
2827
2819
|
import { promisify as promisify3 } from "node:util";
|
|
2828
2820
|
|
|
2829
2821
|
// src/swift-distribution.ts
|
|
2830
2822
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
2831
|
-
import
|
|
2823
|
+
import fs14 from "node:fs";
|
|
2832
2824
|
import os7 from "node:os";
|
|
2833
|
-
import
|
|
2825
|
+
import path27 from "node:path";
|
|
2834
2826
|
|
|
2835
2827
|
// ../contrast-runtime-delivery/src/index.ts
|
|
2836
2828
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
2837
|
-
import { spawn as
|
|
2829
|
+
import { spawn as spawn3 } from "node:child_process";
|
|
2838
2830
|
import crypto from "node:crypto";
|
|
2839
2831
|
import fs7 from "node:fs";
|
|
2840
2832
|
import os2 from "node:os";
|
|
2841
2833
|
import path10 from "node:path";
|
|
2842
2834
|
import { Readable } from "node:stream";
|
|
2843
|
-
import { pipeline } from "node:stream/promises";
|
|
2835
|
+
import { pipeline as pipeline2 } from "node:stream/promises";
|
|
2836
|
+
import zlib2 from "node:zlib";
|
|
2844
2837
|
|
|
2845
2838
|
// src/process-group.ts
|
|
2846
2839
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
2847
|
-
import { spawn, spawnSync as spawnSync4 } from "node:child_process";
|
|
2840
|
+
import { spawn as spawn2, spawnSync as spawnSync4 } from "node:child_process";
|
|
2848
2841
|
import {
|
|
2849
2842
|
appendFileSync,
|
|
2850
2843
|
mkdtempSync,
|
|
@@ -2915,7 +2908,7 @@ var CLI_UPDATE_NOTIFICATION_COOLDOWN_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
|
2915
2908
|
// src/swift-compile.ts
|
|
2916
2909
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
2917
2910
|
import {
|
|
2918
|
-
spawn as
|
|
2911
|
+
spawn as spawn5,
|
|
2919
2912
|
execFileSync as execFileSync9
|
|
2920
2913
|
} from "node:child_process";
|
|
2921
2914
|
import { createHash as createHash12, randomUUID as randomUUID5 } from "node:crypto";
|
|
@@ -3030,7 +3023,7 @@ import os4 from "node:os";
|
|
|
3030
3023
|
// src/swift-root-lock.ts
|
|
3031
3024
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3032
3025
|
import {
|
|
3033
|
-
spawn as
|
|
3026
|
+
spawn as spawn4
|
|
3034
3027
|
} from "node:child_process";
|
|
3035
3028
|
import { createHash as createHash10, randomUUID as randomUUID4 } from "node:crypto";
|
|
3036
3029
|
import {
|
|
@@ -3186,7 +3179,7 @@ var FOUNDATION_IMPLICIT_MODULES = [
|
|
|
3186
3179
|
var FOUNDATION_IMPLICIT_FLAGS = FOUNDATION_IMPLICIT_MODULES.map(
|
|
3187
3180
|
(module) => `, "-Xfrontend", "-import-module", "-Xfrontend", "${module}"`
|
|
3188
3181
|
).join("");
|
|
3189
|
-
var compilerSourceDigest = true ? "
|
|
3182
|
+
var compilerSourceDigest = true ? "f079d0f9f3d0467a52729f6950de38e5f71e1ad9017031a3ec3722aad044dac2" : swiftCompilerSourceDigest(import.meta.dirname);
|
|
3190
3183
|
var CORE_FOUNDATION_HANDLE_IMPORTS = [
|
|
3191
3184
|
"CFAllocator",
|
|
3192
3185
|
"CFArray",
|
|
@@ -3211,14 +3204,37 @@ var host = globalThis;
|
|
|
3211
3204
|
var rootLocks = host[ROOT_LOCKS] ?? (host[ROOT_LOCKS] = /* @__PURE__ */ new Map());
|
|
3212
3205
|
var SHARED_ARTIFACT_BUDGET_BYTES = 4 * 1024 ** 3;
|
|
3213
3206
|
|
|
3207
|
+
// src/swift-native-pin.ts
|
|
3208
|
+
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3209
|
+
|
|
3210
|
+
// src/answeredNativePackages.ts
|
|
3211
|
+
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3212
|
+
import { readFileSync as readFileSync16 } from "node:fs";
|
|
3213
|
+
import { join as join7 } from "node:path";
|
|
3214
|
+
|
|
3215
|
+
// src/runtime-assets.ts
|
|
3216
|
+
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3217
|
+
import fs13 from "fs";
|
|
3218
|
+
import path25 from "path";
|
|
3219
|
+
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
3220
|
+
|
|
3221
|
+
// src/nitroAdapterContract.ts
|
|
3222
|
+
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3223
|
+
import { createHash as createHash13 } from "node:crypto";
|
|
3224
|
+
import { readdirSync as readdirSync11, readFileSync as readFileSync17 } from "node:fs";
|
|
3225
|
+
import path26 from "node:path";
|
|
3226
|
+
|
|
3227
|
+
// src/swiftNativePinContract.ts
|
|
3228
|
+
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3229
|
+
|
|
3214
3230
|
// src/swift-package-manifest.ts
|
|
3215
|
-
var cacheDir3 =
|
|
3231
|
+
var cacheDir3 = path28.join(cacheDir(), "swift-manifests");
|
|
3216
3232
|
var execFileAsync = promisify3(execFile3);
|
|
3217
3233
|
|
|
3218
3234
|
// src/xcode-json-project.ts
|
|
3219
3235
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3220
3236
|
var import_json5 = __toESM(require_lib(), 1);
|
|
3221
|
-
import
|
|
3237
|
+
import path29 from "node:path";
|
|
3222
3238
|
var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3223
3239
|
var text = (value) => typeof value === "string" ? value : void 0;
|
|
3224
3240
|
var items = (value) => Array.isArray(value) ? value : [];
|
|
@@ -3275,7 +3291,7 @@ var PHASE_ISA = {
|
|
|
3275
3291
|
function readXcodeJsonProject(xcodeproj, source) {
|
|
3276
3292
|
const json = import_json5.default.parse(source);
|
|
3277
3293
|
if (!isJsonObject(json)) throw new Error(`${xcodeproj}/project.xcproj is not an object`);
|
|
3278
|
-
const projectDir =
|
|
3294
|
+
const projectDir = path29.dirname(xcodeproj);
|
|
3279
3295
|
const objects = {};
|
|
3280
3296
|
let next = 0;
|
|
3281
3297
|
const add = (entry, id) => {
|
|
@@ -3288,7 +3304,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
3288
3304
|
const base = /^<([A-Z]+)>\/(.*)$/.exec(raw);
|
|
3289
3305
|
if (base) {
|
|
3290
3306
|
if (base[1] === "PROJECT")
|
|
3291
|
-
return { sourceTree: "<absolute>", path:
|
|
3307
|
+
return { sourceTree: "<absolute>", path: path29.join(projectDir, base[2]) };
|
|
3292
3308
|
if (base[1] === "PRODUCTS")
|
|
3293
3309
|
return { sourceTree: "BUILT_PRODUCTS_DIR", path: base[2] };
|
|
3294
3310
|
return null;
|
|
@@ -3296,7 +3312,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
3296
3312
|
const unescaped = raw.replaceAll("\\<", "<");
|
|
3297
3313
|
if (unescaped.startsWith("/")) return { sourceTree: "<absolute>", path: unescaped };
|
|
3298
3314
|
if (unescaped.startsWith("~")) return null;
|
|
3299
|
-
return groupDir === null ? null : { sourceTree: "<absolute>", path:
|
|
3315
|
+
return groupDir === null ? null : { sourceTree: "<absolute>", path: path29.join(groupDir, unescaped) };
|
|
3300
3316
|
};
|
|
3301
3317
|
const memberships = [];
|
|
3302
3318
|
const folders = [];
|
|
@@ -3307,7 +3323,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
3307
3323
|
const kind = text(entry.kind) ?? "file-reference";
|
|
3308
3324
|
const raw = text(entry.path) ?? "";
|
|
3309
3325
|
const located = raw === "" ? null : locate(raw, parent.dir);
|
|
3310
|
-
const name2 = text(entry.name) ??
|
|
3326
|
+
const name2 = text(entry.name) ?? path29.basename(raw);
|
|
3311
3327
|
const node = { id: "", name: name2, dir: null, parent, children: [] };
|
|
3312
3328
|
if (kind === "group" || kind === "variant-group" || kind === "version-group") {
|
|
3313
3329
|
node.dir = raw === "" ? parent.dir : located?.sourceTree === "<absolute>" ? located.path : null;
|
|
@@ -3428,7 +3444,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
3428
3444
|
if (!isObject(entry)) continue;
|
|
3429
3445
|
const repository = text(entry.repository);
|
|
3430
3446
|
const local = text(entry.path);
|
|
3431
|
-
const name2 = local !== void 0 ?
|
|
3447
|
+
const name2 = local !== void 0 ? path29.basename(path29.resolve(path29.dirname(xcodeproj), local)) : path29.basename(repository ?? "").replace(/\.git$/, "");
|
|
3432
3448
|
const id = text(entry.kind) === "local" && local !== void 0 ? add({ isa: "XCLocalSwiftPackageReference", relativePath: local }) : add({
|
|
3433
3449
|
isa: "XCRemoteSwiftPackageReference",
|
|
3434
3450
|
repositoryURL: repository ?? "",
|
|
@@ -3638,28 +3654,28 @@ var CONDITIONS = {
|
|
|
3638
3654
|
variant: "normal"
|
|
3639
3655
|
};
|
|
3640
3656
|
function walkFiles(dir) {
|
|
3641
|
-
if (!
|
|
3657
|
+
if (!fs16.existsSync(dir)) return [];
|
|
3642
3658
|
const out = [];
|
|
3643
|
-
for (const entry of
|
|
3659
|
+
for (const entry of fs16.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name))) {
|
|
3644
3660
|
if (entry.name.startsWith(".")) continue;
|
|
3645
|
-
const full =
|
|
3661
|
+
const full = path30.join(dir, entry.name);
|
|
3646
3662
|
if (entry.isDirectory()) out.push(...walkFiles(full));
|
|
3647
3663
|
else if (entry.isFile()) out.push(full);
|
|
3648
3664
|
}
|
|
3649
3665
|
return out;
|
|
3650
3666
|
}
|
|
3651
|
-
var isDirectory = (dir) =>
|
|
3667
|
+
var isDirectory = (dir) => fs16.existsSync(dir) && fs16.statSync(dir).isDirectory();
|
|
3652
3668
|
function readXcconfig(file, read) {
|
|
3653
|
-
if (read.includes(file) || !
|
|
3669
|
+
if (read.includes(file) || !fs16.existsSync(file)) return {};
|
|
3654
3670
|
read.push(file);
|
|
3655
3671
|
const settings = {};
|
|
3656
|
-
for (const raw of
|
|
3672
|
+
for (const raw of fs16.readFileSync(file, "utf8").split("\n")) {
|
|
3657
3673
|
const line = raw.replace(/\/\/.*$/, "").trim();
|
|
3658
3674
|
const include = /^#include\??\s+"([^"]+)"/.exec(line);
|
|
3659
3675
|
if (include) {
|
|
3660
3676
|
Object.assign(
|
|
3661
3677
|
settings,
|
|
3662
|
-
readXcconfig(
|
|
3678
|
+
readXcconfig(path30.resolve(path30.dirname(file), include[1]), read)
|
|
3663
3679
|
);
|
|
3664
3680
|
continue;
|
|
3665
3681
|
}
|
|
@@ -3709,22 +3725,22 @@ function decodeXml(text2) {
|
|
|
3709
3725
|
return text2.replaceAll(""", '"').replaceAll("'", "'").replaceAll("<", "<").replaceAll(">", ">").replaceAll("&", "&");
|
|
3710
3726
|
}
|
|
3711
3727
|
function workspaceReferences(workspace) {
|
|
3712
|
-
const data =
|
|
3713
|
-
if (!
|
|
3728
|
+
const data = path30.join(workspace, "contents.xcworkspacedata");
|
|
3729
|
+
if (!fs16.existsSync(data))
|
|
3714
3730
|
throw new Error(`${workspace} has no contents.xcworkspacedata`);
|
|
3715
|
-
const container =
|
|
3731
|
+
const container = path30.dirname(workspace);
|
|
3716
3732
|
const locate = (location, base) => {
|
|
3717
3733
|
const colon = location.indexOf(":");
|
|
3718
3734
|
const kind = location.slice(0, colon);
|
|
3719
3735
|
const rest = location.slice(colon + 1);
|
|
3720
|
-
if (kind === "group") return
|
|
3721
|
-
if (kind === "container" || kind === "self") return
|
|
3722
|
-
if (kind === "absolute") return
|
|
3723
|
-
throw new Error(`${
|
|
3736
|
+
if (kind === "group") return path30.resolve(base, rest);
|
|
3737
|
+
if (kind === "container" || kind === "self") return path30.resolve(container, rest);
|
|
3738
|
+
if (kind === "absolute") return path30.resolve(rest);
|
|
3739
|
+
throw new Error(`${path30.basename(workspace)} has an unsupported location ${location}`);
|
|
3724
3740
|
};
|
|
3725
3741
|
const groups = [container];
|
|
3726
3742
|
const references = [];
|
|
3727
|
-
for (const [, closing, tag, attributes, selfClosing] of
|
|
3743
|
+
for (const [, closing, tag, attributes, selfClosing] of fs16.readFileSync(data, "utf8").matchAll(/<(\/?)(Group|FileRef)\b([^>]*?)(\/?)>/g)) {
|
|
3728
3744
|
if (closing) {
|
|
3729
3745
|
if (tag === "Group") groups.pop();
|
|
3730
3746
|
continue;
|
|
@@ -3775,8 +3791,8 @@ function remotePackageRequirements(projects) {
|
|
|
3775
3791
|
var loaded = /* @__PURE__ */ new Map();
|
|
3776
3792
|
function xcodeProjectFile(xcodeproj) {
|
|
3777
3793
|
for (const name2 of ["project.pbxproj", "project.xcproj"]) {
|
|
3778
|
-
const file =
|
|
3779
|
-
if (
|
|
3794
|
+
const file = path30.join(xcodeproj, name2);
|
|
3795
|
+
if (fs16.existsSync(file)) return file;
|
|
3780
3796
|
}
|
|
3781
3797
|
return null;
|
|
3782
3798
|
}
|
|
@@ -3784,8 +3800,8 @@ function loadProject(xcodeproj) {
|
|
|
3784
3800
|
const projectFile = xcodeProjectFile(xcodeproj);
|
|
3785
3801
|
if (!projectFile)
|
|
3786
3802
|
throw new Error(`${xcodeproj} has no project.pbxproj or project.xcproj`);
|
|
3787
|
-
const source =
|
|
3788
|
-
const digest =
|
|
3803
|
+
const source = fs16.readFileSync(projectFile, "utf8");
|
|
3804
|
+
const digest = createHash15("sha256").update(source).digest("hex");
|
|
3789
3805
|
const cached = loaded.get(projectFile);
|
|
3790
3806
|
if (cached?.digest === digest) return cached.project;
|
|
3791
3807
|
const root = projectFile.endsWith(".xcproj") ? readXcodeJsonProject(xcodeproj, source) : parseOpenStepPlist(source);
|
|
@@ -3801,10 +3817,10 @@ function loadProject(xcodeproj) {
|
|
|
3801
3817
|
if (!project || project.isa !== "PBXProject") {
|
|
3802
3818
|
throw new Error(`${projectFile} has no PBXProject root`);
|
|
3803
3819
|
}
|
|
3804
|
-
const projectDir =
|
|
3805
|
-
|
|
3820
|
+
const projectDir = fs16.realpathSync(
|
|
3821
|
+
path30.resolve(path30.dirname(xcodeproj), str(project.projectDirPath) ?? "")
|
|
3806
3822
|
);
|
|
3807
|
-
const resolvePath = xcodePathResolver(objects, projectDir,
|
|
3823
|
+
const resolvePath = xcodePathResolver(objects, projectDir, path30.join);
|
|
3808
3824
|
const result = {
|
|
3809
3825
|
xcodeproj,
|
|
3810
3826
|
projectFile,
|
|
@@ -3841,8 +3857,8 @@ function targetSettings(ref, configuration, builtins, options = {}, overrides =
|
|
|
3841
3857
|
const relative2 = str(config.baseConfigurationReferenceRelativePath);
|
|
3842
3858
|
const own = isDict(config.buildSettings) ? config.buildSettings : {};
|
|
3843
3859
|
const directory = anchor ? project.resolvePath(anchor) : null;
|
|
3844
|
-
const baseFile = base ? project.resolvePath(base) : directory && relative2 ?
|
|
3845
|
-
if (options.requireSources !== false && (base || anchor || relative2) && (!baseFile || !
|
|
3860
|
+
const baseFile = base ? project.resolvePath(base) : directory && relative2 ? path30.resolve(directory, relative2) : null;
|
|
3861
|
+
if (options.requireSources !== false && (base || anchor || relative2) && (!baseFile || !fs16.existsSync(baseFile)))
|
|
3846
3862
|
throw new Error(
|
|
3847
3863
|
`Unable to open base configuration reference file '${baseFile ?? base ?? relative2 ?? anchor}'`
|
|
3848
3864
|
);
|
|
@@ -3935,26 +3951,26 @@ function scriptCommand(shell, script) {
|
|
|
3935
3951
|
return [executable, ...args, "-c", script];
|
|
3936
3952
|
}
|
|
3937
3953
|
function expandSearchPath(directory, rules2) {
|
|
3938
|
-
if (
|
|
3954
|
+
if (path30.basename(directory) !== "**") return [directory];
|
|
3939
3955
|
const expanded = [];
|
|
3940
3956
|
const seen = /* @__PURE__ */ new Set();
|
|
3941
|
-
const queue = [
|
|
3957
|
+
const queue = [path30.dirname(directory)];
|
|
3942
3958
|
for (let at = 0; at < queue.length; at++) {
|
|
3943
3959
|
const current = queue[at];
|
|
3944
3960
|
let real;
|
|
3945
3961
|
try {
|
|
3946
|
-
real =
|
|
3962
|
+
real = fs16.realpathSync(current);
|
|
3947
3963
|
} catch {
|
|
3948
3964
|
continue;
|
|
3949
3965
|
}
|
|
3950
|
-
if (!
|
|
3966
|
+
if (!fs16.statSync(real).isDirectory() || seen.has(real)) continue;
|
|
3951
3967
|
seen.add(real);
|
|
3952
3968
|
expanded.push(current);
|
|
3953
|
-
for (const entry of
|
|
3969
|
+
for (const entry of fs16.readdirSync(real, { withFileTypes: true }).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
|
|
3954
3970
|
if (entry.isSymbolicLink() ? !rules2.followLinks : !entry.isDirectory()) continue;
|
|
3955
3971
|
if (rules2.excluded.some((pattern) => pattern.test(entry.name)) && !rules2.included.some((pattern) => pattern.test(entry.name)))
|
|
3956
3972
|
continue;
|
|
3957
|
-
queue.push(
|
|
3973
|
+
queue.push(path30.join(current, entry.name));
|
|
3958
3974
|
}
|
|
3959
3975
|
}
|
|
3960
3976
|
return expanded;
|
|
@@ -4025,7 +4041,7 @@ function shellAssetCatalogs(script, settings, projectDir) {
|
|
|
4025
4041
|
for (const token of tokens) {
|
|
4026
4042
|
if (token.startsWith("-")) break;
|
|
4027
4043
|
const file = resolve(token);
|
|
4028
|
-
if (file?.endsWith(".xcassets")) catalogs.push(
|
|
4044
|
+
if (file?.endsWith(".xcassets")) catalogs.push(path30.resolve(projectDir, file));
|
|
4029
4045
|
}
|
|
4030
4046
|
}
|
|
4031
4047
|
return catalogs;
|
|
@@ -4070,14 +4086,14 @@ function shellCopies(script, settings, projectDir) {
|
|
|
4070
4086
|
if (operands.length !== 2 || operands.some((operand) => operand.startsWith("-")))
|
|
4071
4087
|
return [];
|
|
4072
4088
|
copies.push({
|
|
4073
|
-
from:
|
|
4074
|
-
to:
|
|
4089
|
+
from: path30.resolve(projectDir, operands[0]),
|
|
4090
|
+
to: path30.resolve(projectDir, operands[1])
|
|
4075
4091
|
});
|
|
4076
4092
|
}
|
|
4077
4093
|
return copies;
|
|
4078
4094
|
}
|
|
4079
4095
|
function fileListEntries(file, absolute) {
|
|
4080
|
-
return
|
|
4096
|
+
return fs16.readFileSync(file, "utf8").split(/\r?\n/).map((line) => line.trim()).filter((line) => line !== "" && !line.startsWith("#")).map(absolute);
|
|
4081
4097
|
}
|
|
4082
4098
|
function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
4083
4099
|
const { project, target, id: targetId } = ref;
|
|
@@ -4090,7 +4106,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
4090
4106
|
const copiedFiles = [];
|
|
4091
4107
|
let generatedInfoPlist = false;
|
|
4092
4108
|
const declaredInfoPlist = settings("INFOPLIST_FILE");
|
|
4093
|
-
const infoPlistOutput = declaredInfoPlist ?
|
|
4109
|
+
const infoPlistOutput = declaredInfoPlist ? path30.resolve(project.projectDir, declaredInfoPlist) : null;
|
|
4094
4110
|
const isPreparedOutput = (file) => file === infoPlistOutput || options.requireSources !== false && file.endsWith(".swift");
|
|
4095
4111
|
for (const phaseId of list(target.buildPhases)) {
|
|
4096
4112
|
const phase = project.object(phaseId);
|
|
@@ -4105,7 +4121,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
4105
4121
|
copiedFiles.push(
|
|
4106
4122
|
...shellCopies(str(phase.shellScript) ?? "", settings, project.projectDir)
|
|
4107
4123
|
);
|
|
4108
|
-
const absolute = (raw) =>
|
|
4124
|
+
const absolute = (raw) => path30.resolve(project.projectDir, expand(raw, settings));
|
|
4109
4125
|
const inputs = list(phase.inputPaths).map(absolute);
|
|
4110
4126
|
const outputs = list(phase.outputPaths).map(absolute);
|
|
4111
4127
|
const fileLists = /* @__PURE__ */ new Map();
|
|
@@ -4114,7 +4130,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
4114
4130
|
kind === "INPUT" ? phase.inputFileListPaths : phase.outputFileListPaths
|
|
4115
4131
|
).map((raw) => {
|
|
4116
4132
|
const file = absolute(raw);
|
|
4117
|
-
if (!
|
|
4133
|
+
if (!fs16.existsSync(file)) {
|
|
4118
4134
|
return { file, entries: [] };
|
|
4119
4135
|
}
|
|
4120
4136
|
return { file, entries: fileListEntries(file, absolute) };
|
|
@@ -4135,7 +4151,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
4135
4151
|
...fileLists.get("OUTPUT").map((item) => item.file)
|
|
4136
4152
|
];
|
|
4137
4153
|
if (allOutputs.some((file) => file.endsWith(".swift") || file === infoPlistOutput)) {
|
|
4138
|
-
for (const file of inputFiles) if (
|
|
4154
|
+
for (const file of inputFiles) if (fs16.existsSync(file)) projectInputs.add(file);
|
|
4139
4155
|
}
|
|
4140
4156
|
if (options.prepareGeneratedSources === true && allOutputs.some(isPreparedOutput)) {
|
|
4141
4157
|
const configuration = settings("CONFIGURATION");
|
|
@@ -4148,10 +4164,10 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
4148
4164
|
false
|
|
4149
4165
|
))
|
|
4150
4166
|
continue;
|
|
4151
|
-
const phaseDir =
|
|
4167
|
+
const phaseDir = path30.join(settings("TARGET_TEMP_DIR"), `Script-${phaseId}`);
|
|
4152
4168
|
for (const lists of fileLists.values())
|
|
4153
4169
|
for (const { file } of lists)
|
|
4154
|
-
if (!
|
|
4170
|
+
if (!fs16.existsSync(file))
|
|
4155
4171
|
throw new Error(
|
|
4156
4172
|
`${targetName}: Run Script "${script}" missing file list ${file}`
|
|
4157
4173
|
);
|
|
@@ -4170,25 +4186,25 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
4170
4186
|
const lists = fileLists.get(kind);
|
|
4171
4187
|
env[`SCRIPT_${kind}_FILE_LIST_COUNT`] = String(lists.length);
|
|
4172
4188
|
lists.forEach((_item, index) => {
|
|
4173
|
-
env[`SCRIPT_${kind}_FILE_LIST_${index}`] =
|
|
4189
|
+
env[`SCRIPT_${kind}_FILE_LIST_${index}`] = path30.join(
|
|
4174
4190
|
phaseDir,
|
|
4175
4191
|
`${kind}-${index}.xcfilelist`
|
|
4176
4192
|
);
|
|
4177
4193
|
});
|
|
4178
4194
|
}
|
|
4179
|
-
const signature =
|
|
4195
|
+
const signature = createHash15("sha256").update(
|
|
4180
4196
|
JSON.stringify([phase, [...settingKeys].map((key2) => [key2, settings(key2)])])
|
|
4181
4197
|
);
|
|
4182
4198
|
for (const file of inputFiles) {
|
|
4183
4199
|
signature.update(file);
|
|
4184
|
-
if (
|
|
4185
|
-
const stat =
|
|
4200
|
+
if (fs16.existsSync(file)) {
|
|
4201
|
+
const stat = fs16.statSync(file);
|
|
4186
4202
|
signature.update(`${stat.mtimeMs}:${stat.ctimeMs}:${stat.size}`);
|
|
4187
4203
|
} else signature.update("missing");
|
|
4188
4204
|
}
|
|
4189
4205
|
const stamp = signature.digest("hex");
|
|
4190
4206
|
const key = `${project.projectFile}:${targetId}:${phaseId}:${settings("CONFIGURATION")}`;
|
|
4191
|
-
if (preparedSourcePhases.get(key) === stamp && allOutputs.every((file) =>
|
|
4207
|
+
if (preparedSourcePhases.get(key) === stamp && allOutputs.every((file) => fs16.existsSync(file))) {
|
|
4192
4208
|
preparedXcodePhase(
|
|
4193
4209
|
project.projectFile,
|
|
4194
4210
|
targetId,
|
|
@@ -4199,14 +4215,14 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
4199
4215
|
);
|
|
4200
4216
|
continue;
|
|
4201
4217
|
}
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4218
|
+
fs16.mkdirSync(phaseDir, { recursive: true });
|
|
4219
|
+
fs16.mkdirSync(settings("BUILT_PRODUCTS_DIR"), { recursive: true });
|
|
4220
|
+
fs16.mkdirSync(settings("DERIVED_FILE_DIR"), { recursive: true });
|
|
4205
4221
|
for (const output2 of allOutputs)
|
|
4206
|
-
|
|
4222
|
+
fs16.mkdirSync(path30.dirname(output2), { recursive: true });
|
|
4207
4223
|
for (const [kind, lists] of fileLists)
|
|
4208
4224
|
lists.forEach((item, index) => {
|
|
4209
|
-
|
|
4225
|
+
fs16.writeFileSync(
|
|
4210
4226
|
env[`SCRIPT_${kind}_FILE_LIST_${index}`],
|
|
4211
4227
|
`${item.entries.join("\n")}
|
|
4212
4228
|
`
|
|
@@ -4233,7 +4249,7 @@ ${output2}`
|
|
|
4233
4249
|
);
|
|
4234
4250
|
}
|
|
4235
4251
|
const missing = allOutputs.filter(
|
|
4236
|
-
(file) => file === infoPlistOutput && !
|
|
4252
|
+
(file) => file === infoPlistOutput && !fs16.existsSync(file)
|
|
4237
4253
|
);
|
|
4238
4254
|
if (missing.length > 0)
|
|
4239
4255
|
throw new Error(
|
|
@@ -4253,8 +4269,8 @@ ${output2}`
|
|
|
4253
4269
|
project.visitMembers(
|
|
4254
4270
|
targetId,
|
|
4255
4271
|
project.resolvePath,
|
|
4256
|
-
(file) => isDirectory(file) ? walkFiles(file) :
|
|
4257
|
-
|
|
4272
|
+
(file) => isDirectory(file) ? walkFiles(file) : fs16.existsSync(file) ? [file] : [],
|
|
4273
|
+
path30.join,
|
|
4258
4274
|
(file, kind) => {
|
|
4259
4275
|
if (kind === "header") {
|
|
4260
4276
|
headers.add(file);
|
|
@@ -4264,9 +4280,9 @@ ${output2}`
|
|
|
4264
4280
|
resources.add(file);
|
|
4265
4281
|
return;
|
|
4266
4282
|
}
|
|
4267
|
-
if (!
|
|
4283
|
+
if (!fs16.existsSync(file)) {
|
|
4268
4284
|
if (options.requireSources === false) return;
|
|
4269
|
-
const script = scriptForOutput.get(
|
|
4285
|
+
const script = scriptForOutput.get(path30.normalize(file));
|
|
4270
4286
|
throw new Error(
|
|
4271
4287
|
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}`
|
|
4272
4288
|
);
|
|
@@ -4287,37 +4303,37 @@ ${output2}`
|
|
|
4287
4303
|
function commonAncestor(dirs) {
|
|
4288
4304
|
let common = dirs[0];
|
|
4289
4305
|
for (const dir of dirs) {
|
|
4290
|
-
while (common !==
|
|
4291
|
-
common =
|
|
4306
|
+
while (common !== path30.dirname(common) && path30.relative(common, dir).startsWith(".."))
|
|
4307
|
+
common = path30.dirname(common);
|
|
4292
4308
|
}
|
|
4293
4309
|
return common;
|
|
4294
4310
|
}
|
|
4295
|
-
var isPodsProject = (xcodeproj) =>
|
|
4311
|
+
var isPodsProject = (xcodeproj) => path30.basename(xcodeproj) === "Pods.xcodeproj" && path30.basename(path30.dirname(xcodeproj)) === "Pods";
|
|
4296
4312
|
function installedPodsSandbox(pods) {
|
|
4297
|
-
const podfileLock =
|
|
4298
|
-
const manifestLock =
|
|
4299
|
-
if (!
|
|
4313
|
+
const podfileLock = path30.join(path30.dirname(pods), "Podfile.lock");
|
|
4314
|
+
const manifestLock = path30.join(pods, "Manifest.lock");
|
|
4315
|
+
if (!fs16.existsSync(podfileLock))
|
|
4300
4316
|
throw new Error(
|
|
4301
|
-
`${pods} has no ${podfileLock}: run \`pod install\` in ${
|
|
4317
|
+
`${pods} has no ${podfileLock}: run \`pod install\` in ${path30.dirname(pods)}`
|
|
4302
4318
|
);
|
|
4303
|
-
if (!
|
|
4319
|
+
if (!fs16.existsSync(manifestLock) || !fs16.readFileSync(manifestLock).equals(fs16.readFileSync(podfileLock)))
|
|
4304
4320
|
throw new Error(
|
|
4305
|
-
`The sandbox is not in sync with the Podfile.lock: ${manifestLock} differs from ${podfileLock}. Run \`pod install\` in ${
|
|
4321
|
+
`The sandbox is not in sync with the Podfile.lock: ${manifestLock} differs from ${podfileLock}. Run \`pod install\` in ${path30.dirname(pods)}`
|
|
4306
4322
|
);
|
|
4307
4323
|
const specChecksums = {};
|
|
4308
|
-
const lines =
|
|
4324
|
+
const lines = fs16.readFileSync(manifestLock, "utf8").split("\n");
|
|
4309
4325
|
const start = lines.indexOf("SPEC CHECKSUMS:");
|
|
4310
4326
|
for (const line of start === -1 ? [] : lines.slice(start + 1)) {
|
|
4311
4327
|
const entry = /^ {2}"?([^":]+)"?: ([0-9a-f]+)$/.exec(line);
|
|
4312
4328
|
if (!entry) break;
|
|
4313
4329
|
specChecksums[entry[1]] = entry[2];
|
|
4314
4330
|
}
|
|
4315
|
-
const specs =
|
|
4331
|
+
const specs = path30.join(pods, "Local Podspecs");
|
|
4316
4332
|
return {
|
|
4317
4333
|
podfileLock,
|
|
4318
4334
|
manifestLock,
|
|
4319
4335
|
specChecksums,
|
|
4320
|
-
localPodspecs: isDirectory(specs) ?
|
|
4336
|
+
localPodspecs: isDirectory(specs) ? fs16.readdirSync(specs).filter((name2) => name2.endsWith(".podspec.json")).sort().map((name2) => path30.join(specs, name2)) : []
|
|
4321
4337
|
};
|
|
4322
4338
|
}
|
|
4323
4339
|
function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
|
|
@@ -4329,14 +4345,14 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
|
|
|
4329
4345
|
if (!xcodeProjectFile(xcodeproj)) {
|
|
4330
4346
|
if (installedPods && isPodsProject(xcodeproj))
|
|
4331
4347
|
throw new Error(
|
|
4332
|
-
`${
|
|
4348
|
+
`${path30.basename(xcodeprojOrWorkspace)} builds ${xcodeproj}, which is not installed: run \`pod install\` in ${path30.dirname(path30.dirname(xcodeproj))}`
|
|
4333
4349
|
);
|
|
4334
4350
|
return;
|
|
4335
4351
|
}
|
|
4336
|
-
const key =
|
|
4337
|
-
if (projectAt.has(key) || !installedPods && key.split(
|
|
4352
|
+
const key = fs16.realpathSync(xcodeproj);
|
|
4353
|
+
if (projectAt.has(key) || !installedPods && key.split(path30.sep).includes("Pods"))
|
|
4338
4354
|
return;
|
|
4339
|
-
if (isPodsProject(key)) cocoapods = installedPodsSandbox(
|
|
4355
|
+
if (isPodsProject(key)) cocoapods = installedPodsSandbox(path30.dirname(key));
|
|
4340
4356
|
const project = loadProject(key);
|
|
4341
4357
|
projectAt.set(key, project);
|
|
4342
4358
|
projects.push(project);
|
|
@@ -4352,12 +4368,12 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
|
|
|
4352
4368
|
for (const reference of listed)
|
|
4353
4369
|
if (reference.endsWith(".xcodeproj")) addProject(reference);
|
|
4354
4370
|
if (projects.length === 0) {
|
|
4355
|
-
throw new Error(`${
|
|
4371
|
+
throw new Error(`${path30.basename(xcodeprojOrWorkspace)} lists no Xcode project`);
|
|
4356
4372
|
}
|
|
4357
|
-
const podfile =
|
|
4358
|
-
if (installedPods && !cocoapods &&
|
|
4373
|
+
const podfile = path30.join(path30.dirname(xcodeprojOrWorkspace), "Podfile");
|
|
4374
|
+
if (installedPods && !cocoapods && fs16.existsSync(podfile))
|
|
4359
4375
|
throw new Error(
|
|
4360
|
-
`${podfile} is not installed into ${
|
|
4376
|
+
`${podfile} is not installed into ${path30.basename(xcodeprojOrWorkspace)}: run \`pod install\` in ${path30.dirname(podfile)} and open the workspace it writes`
|
|
4361
4377
|
);
|
|
4362
4378
|
return { listed, projects, projectAt, cocoapods };
|
|
4363
4379
|
}
|
|
@@ -4393,7 +4409,7 @@ function listXcodeAppTargets(xcodeprojOrWorkspace, options = {}) {
|
|
|
4393
4409
|
return workspaceProjects(xcodeprojOrWorkspace).projects.flatMap(projectTargets).filter((ref) => isIosAppTarget(ref, options)).map((ref) => str(ref.target.name) ?? ref.id);
|
|
4394
4410
|
}
|
|
4395
4411
|
function defaultXcodeAppTarget(xcodeproj) {
|
|
4396
|
-
const project = loadProject(
|
|
4412
|
+
const project = loadProject(fs16.realpathSync(xcodeproj));
|
|
4397
4413
|
for (const [id, target] of Object.entries(project.objects)) {
|
|
4398
4414
|
if (!isDict(target) || target.isa !== "PBXNativeTarget") continue;
|
|
4399
4415
|
if (isIosAppTarget({ project, id, target }, { requireSources: false }))
|
|
@@ -4401,30 +4417,30 @@ function defaultXcodeAppTarget(xcodeproj) {
|
|
|
4401
4417
|
}
|
|
4402
4418
|
}
|
|
4403
4419
|
function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
4404
|
-
const container =
|
|
4420
|
+
const container = fs16.realpathSync(xcodeprojOrWorkspace);
|
|
4405
4421
|
const { projects } = workspaceProjects(container);
|
|
4406
4422
|
const containers = [
|
|
4407
4423
|
.../* @__PURE__ */ new Set([container, ...projects.map((project2) => project2.xcodeproj)])
|
|
4408
4424
|
];
|
|
4409
4425
|
const found = containers.flatMap(
|
|
4410
4426
|
(dir) => [
|
|
4411
|
-
|
|
4412
|
-
...isDirectory(
|
|
4427
|
+
path30.join(dir, "xcshareddata"),
|
|
4428
|
+
...isDirectory(path30.join(dir, "xcuserdata")) ? fs16.readdirSync(path30.join(dir, "xcuserdata")).sort().map((user) => path30.join(dir, "xcuserdata", user)) : []
|
|
4413
4429
|
].map((data) => ({
|
|
4414
4430
|
dir,
|
|
4415
|
-
file:
|
|
4431
|
+
file: path30.join(data, "xcschemes", `${scheme}.xcscheme`)
|
|
4416
4432
|
}))
|
|
4417
|
-
).find((candidate) =>
|
|
4433
|
+
).find((candidate) => fs16.existsSync(candidate.file));
|
|
4418
4434
|
if (!found) {
|
|
4419
4435
|
const known = containers.flatMap(
|
|
4420
|
-
(dir) =>
|
|
4436
|
+
(dir) => fs16.existsSync(path30.join(dir, "xcshareddata", "xcschemes")) ? fs16.readdirSync(path30.join(dir, "xcshareddata", "xcschemes")).filter((name3) => name3.endsWith(".xcscheme")).map((name3) => name3.slice(0, -".xcscheme".length)).sort() : []
|
|
4421
4437
|
);
|
|
4422
4438
|
throw new Error(
|
|
4423
|
-
`${
|
|
4439
|
+
`${path30.basename(container)} has no scheme ${scheme}; it shares ${known.join(", ") || "none"}`
|
|
4424
4440
|
);
|
|
4425
4441
|
}
|
|
4426
4442
|
const launch = /<LaunchAction\b([^>]*)>([\s\S]*?)<\/LaunchAction>/.exec(
|
|
4427
|
-
|
|
4443
|
+
fs16.readFileSync(found.file, "utf8")
|
|
4428
4444
|
);
|
|
4429
4445
|
const attribute = (text2, name3) => {
|
|
4430
4446
|
const value = new RegExp(`\\b${name3}\\s*=\\s*"([^"]*)"`).exec(text2)?.[1];
|
|
@@ -4437,12 +4453,12 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
|
4437
4453
|
if (!configuration || !blueprint || !referenced?.startsWith("container:")) {
|
|
4438
4454
|
throw new Error(`scheme ${scheme} runs no application target`);
|
|
4439
4455
|
}
|
|
4440
|
-
const projectPath =
|
|
4441
|
-
|
|
4456
|
+
const projectPath = path30.resolve(
|
|
4457
|
+
path30.dirname(found.dir),
|
|
4442
4458
|
referenced.slice("container:".length)
|
|
4443
4459
|
);
|
|
4444
4460
|
const project = projects.find(
|
|
4445
|
-
(candidate) =>
|
|
4461
|
+
(candidate) => fs16.existsSync(projectPath) && candidate.xcodeproj === fs16.realpathSync(projectPath)
|
|
4446
4462
|
);
|
|
4447
4463
|
const target = project && projectTargets(project).find((ref) => ref.id === blueprint);
|
|
4448
4464
|
const name2 = target && str(target.target.name);
|
|
@@ -4452,9 +4468,9 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
|
4452
4468
|
var NativeAppTargetSelectionError = class extends Error {
|
|
4453
4469
|
};
|
|
4454
4470
|
function selectIosAppTarget(projectRoot, iosTarget) {
|
|
4455
|
-
const nested =
|
|
4456
|
-
const iosRoot =
|
|
4457
|
-
const projects =
|
|
4471
|
+
const nested = path30.join(projectRoot, "ios");
|
|
4472
|
+
const iosRoot = fs16.existsSync(nested) ? nested : projectRoot;
|
|
4473
|
+
const projects = fs16.readdirSync(iosRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj"));
|
|
4458
4474
|
if (projects.length === 0) return null;
|
|
4459
4475
|
if (projects.length > 1 && !iosTarget) {
|
|
4460
4476
|
throw new NativeAppTargetSelectionError(
|
|
@@ -4464,7 +4480,7 @@ function selectIosAppTarget(projectRoot, iosTarget) {
|
|
|
4464
4480
|
let project = projects[0];
|
|
4465
4481
|
if (iosTarget && projects.length > 1) {
|
|
4466
4482
|
const matches = projects.filter(
|
|
4467
|
-
(entry) => listXcodeAppTargets(
|
|
4483
|
+
(entry) => listXcodeAppTargets(path30.join(iosRoot, entry.name), {
|
|
4468
4484
|
requireSources: false
|
|
4469
4485
|
}).includes(iosTarget)
|
|
4470
4486
|
);
|
|
@@ -4476,19 +4492,19 @@ function selectIosAppTarget(projectRoot, iosTarget) {
|
|
|
4476
4492
|
);
|
|
4477
4493
|
project = matches[0];
|
|
4478
4494
|
}
|
|
4479
|
-
const xcodeproj =
|
|
4495
|
+
const xcodeproj = path30.join(iosRoot, project.name);
|
|
4480
4496
|
const appTargets = listXcodeAppTargets(xcodeproj, { requireSources: false });
|
|
4481
4497
|
let target = iosTarget ?? defaultXcodeAppTarget(xcodeproj);
|
|
4482
4498
|
if (!target) throw new Error("native app identity has no iOS application target");
|
|
4483
4499
|
if (!iosTarget) {
|
|
4484
4500
|
const workspace = xcodeproj.replace(/\.xcodeproj$/, ".xcworkspace");
|
|
4485
|
-
const container =
|
|
4501
|
+
const container = fs16.existsSync(workspace) ? workspace : xcodeproj;
|
|
4486
4502
|
const hasScheme = [container, xcodeproj].some((dir) => {
|
|
4487
|
-
if (
|
|
4503
|
+
if (fs16.existsSync(path30.join(dir, "xcshareddata", "xcschemes", `${target}.xcscheme`)))
|
|
4488
4504
|
return true;
|
|
4489
|
-
const users =
|
|
4490
|
-
return
|
|
4491
|
-
(user) =>
|
|
4505
|
+
const users = path30.join(dir, "xcuserdata");
|
|
4506
|
+
return fs16.existsSync(users) && fs16.readdirSync(users).some(
|
|
4507
|
+
(user) => fs16.existsSync(path30.join(users, user, "xcschemes", `${target}.xcscheme`))
|
|
4492
4508
|
);
|
|
4493
4509
|
});
|
|
4494
4510
|
if (hasScheme) target = readXcodeScheme(container, target).target;
|
|
@@ -4497,8 +4513,8 @@ function selectIosAppTarget(projectRoot, iosTarget) {
|
|
|
4497
4513
|
throw new Error(`native app identity has no application target ${target}`);
|
|
4498
4514
|
return { xcodeproj, target };
|
|
4499
4515
|
}
|
|
4500
|
-
var workspaceResolvedFile = (xcodeprojOrWorkspace) =>
|
|
4501
|
-
xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace :
|
|
4516
|
+
var workspaceResolvedFile = (xcodeprojOrWorkspace) => path30.join(
|
|
4517
|
+
xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : path30.join(xcodeprojOrWorkspace, "project.xcworkspace"),
|
|
4502
4518
|
"xcshareddata",
|
|
4503
4519
|
"swiftpm",
|
|
4504
4520
|
"Package.resolved"
|
|
@@ -4513,7 +4529,7 @@ var SwiftPackageResolutionRequired = class extends Error {
|
|
|
4513
4529
|
}
|
|
4514
4530
|
};
|
|
4515
4531
|
function readXcodeAppTarget(input, targetName, configurationName, options = {}) {
|
|
4516
|
-
const xcodeprojOrWorkspace =
|
|
4532
|
+
const xcodeprojOrWorkspace = fs16.realpathSync(input);
|
|
4517
4533
|
const workspace = xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : null;
|
|
4518
4534
|
const { listed, projects, projectAt, cocoapods } = workspaceProjects(
|
|
4519
4535
|
xcodeprojOrWorkspace,
|
|
@@ -4522,7 +4538,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4522
4538
|
const allTargets = projects.flatMap(projectTargets);
|
|
4523
4539
|
const appTargets = allTargets.filter((ref) => isIosAppTarget(ref, options));
|
|
4524
4540
|
const appTargetNames = appTargets.map((ref) => str(ref.target.name) ?? ref.id);
|
|
4525
|
-
const container =
|
|
4541
|
+
const container = path30.basename(xcodeprojOrWorkspace);
|
|
4526
4542
|
const named = targetName ? appTargets.filter((ref) => ref.target.name === targetName) : appTargets;
|
|
4527
4543
|
if (named.length !== 1) {
|
|
4528
4544
|
if (appTargets.length === 0)
|
|
@@ -4543,15 +4559,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4543
4559
|
for (const ref of allTargets) {
|
|
4544
4560
|
const product = ref.project.object(str(ref.target.productReference));
|
|
4545
4561
|
const file = str(product?.path);
|
|
4546
|
-
if (file && !byProduct.has(
|
|
4547
|
-
byProduct.set(
|
|
4562
|
+
if (file && !byProduct.has(path30.basename(file)))
|
|
4563
|
+
byProduct.set(path30.basename(file), ref);
|
|
4548
4564
|
}
|
|
4549
4565
|
const proxied = (project, proxyId) => {
|
|
4550
4566
|
const proxy = project.object(proxyId);
|
|
4551
4567
|
if (proxy?.isa !== "PBXContainerItemProxy") return void 0;
|
|
4552
4568
|
const portal = str(proxy.containerPortal);
|
|
4553
4569
|
const portalPath = project.resolvePath(portal ?? "");
|
|
4554
|
-
const owner = project.object(portal)?.isa === "PBXProject" ? project : portalPath &&
|
|
4570
|
+
const owner = project.object(portal)?.isa === "PBXProject" ? project : portalPath && fs16.existsSync(portalPath) ? projectAt.get(fs16.realpathSync(portalPath)) : void 0;
|
|
4555
4571
|
const remote = str(proxy.remoteGlobalIDString);
|
|
4556
4572
|
if (!owner || !remote) return void 0;
|
|
4557
4573
|
return projectTargets(owner).find(
|
|
@@ -4575,7 +4591,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4575
4591
|
const buildFile = project.object(buildFileId);
|
|
4576
4592
|
if (!buildFile || !xcodeBuildFileBuildsForIos(buildFile)) continue;
|
|
4577
4593
|
const file = project.object(str(buildFile.fileRef));
|
|
4578
|
-
const resolved = file?.isa === "PBXReferenceProxy" ? proxied(project, str(file.remoteRef)) : file && str(file.sourceTree) === "BUILT_PRODUCTS_DIR" ? byProduct.get(
|
|
4594
|
+
const resolved = file?.isa === "PBXReferenceProxy" ? proxied(project, str(file.remoteRef)) : file && str(file.sourceTree) === "BUILT_PRODUCTS_DIR" ? byProduct.get(path30.basename(str(file.path) ?? "")) : void 0;
|
|
4579
4595
|
if (resolved) found.push(resolved);
|
|
4580
4596
|
}
|
|
4581
4597
|
}
|
|
@@ -4632,8 +4648,8 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4632
4648
|
ref.project.visitMembers(
|
|
4633
4649
|
ref.id,
|
|
4634
4650
|
ref.project.resolvePath,
|
|
4635
|
-
(file) => isDirectory(file) ? walkFiles(file) :
|
|
4636
|
-
|
|
4651
|
+
(file) => isDirectory(file) ? walkFiles(file) : fs16.existsSync(file) ? [file] : [],
|
|
4652
|
+
path30.join,
|
|
4637
4653
|
(file, kind) => {
|
|
4638
4654
|
if (kind === "header") found.push(file);
|
|
4639
4655
|
}
|
|
@@ -4649,12 +4665,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4649
4665
|
for (const ref of projectTargets(project)) {
|
|
4650
4666
|
const product = productName(ref);
|
|
4651
4667
|
for (const { file, visibility } of headerPhase(ref)) {
|
|
4652
|
-
const name2 =
|
|
4668
|
+
const name2 = path30.basename(file);
|
|
4653
4669
|
if (!entries.has(name2))
|
|
4654
4670
|
entries.set(name2, visibility !== "Project" ? `${product}/${name2}` : file);
|
|
4655
4671
|
}
|
|
4656
4672
|
for (const file of synchronizedHeaders(ref)) {
|
|
4657
|
-
const name2 =
|
|
4673
|
+
const name2 = path30.basename(file);
|
|
4658
4674
|
if (!entries.has(name2)) entries.set(name2, file);
|
|
4659
4675
|
}
|
|
4660
4676
|
}
|
|
@@ -4664,7 +4680,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4664
4680
|
if (folder === null) continue;
|
|
4665
4681
|
for (const file of walkFiles(folder)) {
|
|
4666
4682
|
if (!HEADER_FILE.test(file)) continue;
|
|
4667
|
-
const name2 =
|
|
4683
|
+
const name2 = path30.basename(file);
|
|
4668
4684
|
if (!entries.has(name2)) entries.set(name2, file);
|
|
4669
4685
|
}
|
|
4670
4686
|
}
|
|
@@ -4672,18 +4688,18 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4672
4688
|
for (const id of Object.keys(project.objects)) {
|
|
4673
4689
|
if (project.object(id)?.isa !== "PBXFileReference") continue;
|
|
4674
4690
|
const file = project.resolvePath(id);
|
|
4675
|
-
if (file && HEADER_FILE.test(file) && !entries.has(
|
|
4676
|
-
entries.set(
|
|
4691
|
+
if (file && HEADER_FILE.test(file) && !entries.has(path30.basename(file)))
|
|
4692
|
+
entries.set(path30.basename(file), file);
|
|
4677
4693
|
}
|
|
4678
4694
|
const map = [...entries];
|
|
4679
4695
|
projectHeaderMaps.set(project, map);
|
|
4680
4696
|
return map;
|
|
4681
4697
|
};
|
|
4682
4698
|
const xcconfigs = /* @__PURE__ */ new Set();
|
|
4683
|
-
const buildDir = (project) =>
|
|
4699
|
+
const buildDir = (project) => path30.join(project.projectDir, ".build/peach-xcode/Build");
|
|
4684
4700
|
const workspaceBuild = {
|
|
4685
|
-
SYMROOT:
|
|
4686
|
-
OBJROOT:
|
|
4701
|
+
SYMROOT: path30.join(buildDir(app.project), "Products"),
|
|
4702
|
+
OBJROOT: path30.join(buildDir(app.project), "Intermediates.noindex")
|
|
4687
4703
|
};
|
|
4688
4704
|
const moduleTarget = (ref) => {
|
|
4689
4705
|
const name2 = str(ref.target.name) ?? ref.id;
|
|
@@ -4698,15 +4714,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4698
4714
|
TARGET_NAME: name2,
|
|
4699
4715
|
TARGETNAME: "$(TARGET_NAME)",
|
|
4700
4716
|
PROJECT: "$(PROJECT_NAME)",
|
|
4701
|
-
PROJECT_NAME:
|
|
4717
|
+
PROJECT_NAME: path30.basename(ref.project.xcodeproj, ".xcodeproj"),
|
|
4702
4718
|
PROJECT_FILE_PATH: ref.project.xcodeproj,
|
|
4703
4719
|
SRCROOT: ref.project.projectDir,
|
|
4704
4720
|
SOURCE_ROOT: ref.project.projectDir,
|
|
4705
4721
|
PROJECT_DIR: ref.project.projectDir,
|
|
4706
|
-
SYMROOT:
|
|
4722
|
+
SYMROOT: path30.join(buildDir(ref.project), "Products"),
|
|
4707
4723
|
BUILD_DIR: "$(SYMROOT)",
|
|
4708
4724
|
BUILD_ROOT: "$(SYMROOT)",
|
|
4709
|
-
OBJROOT:
|
|
4725
|
+
OBJROOT: path30.join(buildDir(ref.project), "Intermediates.noindex"),
|
|
4710
4726
|
CONFIGURATION_BUILD_DIR: "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)",
|
|
4711
4727
|
BUILT_PRODUCTS_DIR: "$(CONFIGURATION_BUILD_DIR)",
|
|
4712
4728
|
TARGET_BUILD_DIR: "$(CONFIGURATION_BUILD_DIR)",
|
|
@@ -4748,7 +4764,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4748
4764
|
xcconfigs
|
|
4749
4765
|
);
|
|
4750
4766
|
const searchRules = recursiveSearchRules(settings2);
|
|
4751
|
-
const absolute = (file) =>
|
|
4767
|
+
const absolute = (file) => path30.resolve(ref.project.projectDir, file);
|
|
4752
4768
|
const framework = FRAMEWORK_PRODUCTS.has(str(ref.target.productType) ?? "");
|
|
4753
4769
|
const product = settings2("PRODUCT_NAME");
|
|
4754
4770
|
const moduleName = applyOperator(settings2("PRODUCT_MODULE_NAME"), "c99extidentifier");
|
|
@@ -4779,7 +4795,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4779
4795
|
`${name2}: Swift compatibility header phase has no Swift producer sources`
|
|
4780
4796
|
);
|
|
4781
4797
|
const building = options.prepareGeneratedSources && options.requireSources !== false;
|
|
4782
|
-
const versioning = building && allSources.length > 0 && settings2("VERSIONING_SYSTEM") === "apple-generic" ?
|
|
4798
|
+
const versioning = building && allSources.length > 0 && settings2("VERSIONING_SYSTEM") === "apple-generic" ? path30.join(settings2("DERIVED_FILE_DIR"), `${product}_vers.c`) : null;
|
|
4783
4799
|
if (versioning) {
|
|
4784
4800
|
const version = settings2("CURRENT_PROJECT_VERSION");
|
|
4785
4801
|
const custom = [
|
|
@@ -4792,7 +4808,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4792
4808
|
].filter((key) => settings2(key));
|
|
4793
4809
|
if (custom.length)
|
|
4794
4810
|
throw new Error(
|
|
4795
|
-
`${name2}: Xcode generates ${
|
|
4811
|
+
`${name2}: Xcode generates ${path30.basename(versioning)} with ${custom.join(", ")}; peach does not model VERSION_INFO_* overrides`
|
|
4796
4812
|
);
|
|
4797
4813
|
const symbol = product.replace(/^[^A-Za-z_]/, "_").replace(/[^A-Za-z0-9_]/g, "_");
|
|
4798
4814
|
const [major, minor] = version.split(".");
|
|
@@ -4805,9 +4821,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4805
4821
|
` const double ${symbol}VersionNumber __attribute__ ((used)) = (double)${number};`,
|
|
4806
4822
|
""
|
|
4807
4823
|
].join("\n");
|
|
4808
|
-
if (!
|
|
4809
|
-
|
|
4810
|
-
|
|
4824
|
+
if (!fs16.existsSync(versioning) || fs16.readFileSync(versioning, "utf8") !== unit) {
|
|
4825
|
+
fs16.mkdirSync(path30.dirname(versioning), { recursive: true });
|
|
4826
|
+
fs16.writeFileSync(versioning, unit);
|
|
4811
4827
|
}
|
|
4812
4828
|
allSources.push(versioning);
|
|
4813
4829
|
}
|
|
@@ -4826,7 +4842,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4826
4842
|
const headerFiles = headerPhase(ref);
|
|
4827
4843
|
const ownHeaders = /* @__PURE__ */ new Map();
|
|
4828
4844
|
for (const { file, visibility } of headerFiles) {
|
|
4829
|
-
const name3 =
|
|
4845
|
+
const name3 = path30.basename(file);
|
|
4830
4846
|
const published = visibility !== "Project";
|
|
4831
4847
|
if (!ownHeaders.has(name3))
|
|
4832
4848
|
ownHeaders.set(name3, published ? `${product}/${name3}` : file);
|
|
@@ -4834,7 +4850,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4834
4850
|
ownHeaders.set(`${product}/${name3}`, file);
|
|
4835
4851
|
}
|
|
4836
4852
|
for (const file of synchronizedHeaders(ref)) {
|
|
4837
|
-
const name3 =
|
|
4853
|
+
const name3 = path30.basename(file);
|
|
4838
4854
|
if (ownHeaders.has(name3)) continue;
|
|
4839
4855
|
ownHeaders.set(name3, file);
|
|
4840
4856
|
const qualified = `${product}/${name3}`;
|
|
@@ -4846,24 +4862,24 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4846
4862
|
const otherProduct = productName(other);
|
|
4847
4863
|
for (const { file, visibility } of headerPhase(other)) {
|
|
4848
4864
|
if (visibility === "Project") continue;
|
|
4849
|
-
const key = `${otherProduct}/${
|
|
4865
|
+
const key = `${otherProduct}/${path30.basename(file)}`;
|
|
4850
4866
|
if (!nonFrameworkHeaders.has(key)) nonFrameworkHeaders.set(key, file);
|
|
4851
4867
|
}
|
|
4852
4868
|
}
|
|
4853
|
-
const wrapper =
|
|
4869
|
+
const wrapper = path30.join(settings2("BUILT_PRODUCTS_DIR"), `${product}.framework`);
|
|
4854
4870
|
const moduleMap = (settings2("DEFINES_MODULE") === "YES" || !framework) && settings2("MODULEMAP_FILE") ? absolute(settings2("MODULEMAP_FILE")) : null;
|
|
4855
|
-
const frameworkUmbrella = !compatibility && framework && members.sources.length > 0 && moduleMap ?
|
|
4856
|
-
const frameworkCompatibility = frameworkUmbrella && moduleMap &&
|
|
4871
|
+
const frameworkUmbrella = !compatibility && framework && members.sources.length > 0 && moduleMap ? path30.join(path30.dirname(moduleMap), `${moduleName}-umbrella.h`) : null;
|
|
4872
|
+
const frameworkCompatibility = frameworkUmbrella && moduleMap && fs16.existsSync(moduleMap) && fs16.existsSync(frameworkUmbrella) ? {
|
|
4857
4873
|
framework: true,
|
|
4858
4874
|
moduleMap,
|
|
4859
4875
|
umbrella: frameworkUmbrella,
|
|
4860
|
-
outputModuleMap:
|
|
4861
|
-
outputUmbrella:
|
|
4876
|
+
outputModuleMap: path30.join(wrapper, "Modules", "module.modulemap"),
|
|
4877
|
+
outputUmbrella: path30.join(
|
|
4862
4878
|
wrapper,
|
|
4863
4879
|
"Headers",
|
|
4864
|
-
|
|
4880
|
+
path30.basename(frameworkUmbrella)
|
|
4865
4881
|
),
|
|
4866
|
-
outputHeader:
|
|
4882
|
+
outputHeader: path30.join(
|
|
4867
4883
|
wrapper,
|
|
4868
4884
|
"Headers",
|
|
4869
4885
|
settings2("SWIFT_OBJC_INTERFACE_HEADER_NAME") || `${moduleName}-Swift.h`
|
|
@@ -4877,10 +4893,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4877
4893
|
outputUmbrella: compatibility.outputUmbrella,
|
|
4878
4894
|
outputHeader: compatibility.outputHeader
|
|
4879
4895
|
} : frameworkCompatibility;
|
|
4880
|
-
const podHeaders = !framework && isPodsProject(ref.project.xcodeproj) && moduleMap &&
|
|
4896
|
+
const podHeaders = !framework && isPodsProject(ref.project.xcodeproj) && moduleMap && path30.relative(path30.join(ref.project.projectDir, "Headers", "Public"), moduleMap).split(path30.sep)[0] !== ".." && fs16.existsSync(moduleMap) ? fs16.readdirSync(path30.dirname(moduleMap)).flatMap((entry) => {
|
|
4881
4897
|
if (!/\.(h|hh|hpp|hxx|modulemap)$/.test(entry)) return [];
|
|
4882
|
-
const file =
|
|
4883
|
-
return
|
|
4898
|
+
const file = path30.join(path30.dirname(moduleMap), entry);
|
|
4899
|
+
return fs16.existsSync(file) ? [file] : [];
|
|
4884
4900
|
}) : [];
|
|
4885
4901
|
const fileFlags = {};
|
|
4886
4902
|
for (const phaseId of list(ref.target.buildPhases)) {
|
|
@@ -4952,15 +4968,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4952
4968
|
// xcode searches its products' include directory before
|
|
4953
4969
|
// HEADER_SEARCH_PATHS and the target's derived sources after.
|
|
4954
4970
|
headerSearchPaths: [
|
|
4955
|
-
|
|
4971
|
+
path30.join(settings2("BUILT_PRODUCTS_DIR"), "include"),
|
|
4956
4972
|
...settingList(settings2("HEADER_SEARCH_PATHS")).flatMap(
|
|
4957
4973
|
(raw) => expandSearchPath(absolute(raw), searchRules)
|
|
4958
4974
|
),
|
|
4959
|
-
|
|
4975
|
+
path30.join(
|
|
4960
4976
|
`${settings2("DERIVED_FILE_DIR")}-normal`,
|
|
4961
4977
|
settings2("CURRENT_ARCH")
|
|
4962
4978
|
),
|
|
4963
|
-
|
|
4979
|
+
path30.join(settings2("DERIVED_FILE_DIR"), settings2("CURRENT_ARCH")),
|
|
4964
4980
|
settings2("DERIVED_FILE_DIR")
|
|
4965
4981
|
],
|
|
4966
4982
|
userHeaderSearchPaths: settingList(
|
|
@@ -5010,10 +5026,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5010
5026
|
...headerFiles.flatMap(
|
|
5011
5027
|
({ file, visibility }) => visibility === "Project" ? [] : [
|
|
5012
5028
|
[
|
|
5013
|
-
|
|
5029
|
+
path30.join(
|
|
5014
5030
|
wrapper,
|
|
5015
5031
|
visibility === "Public" ? "Headers" : "PrivateHeaders",
|
|
5016
|
-
|
|
5032
|
+
path30.basename(file)
|
|
5017
5033
|
),
|
|
5018
5034
|
file
|
|
5019
5035
|
]
|
|
@@ -5027,7 +5043,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5027
5043
|
return [];
|
|
5028
5044
|
const destination = expand(
|
|
5029
5045
|
str(phase.dstPath) ?? "",
|
|
5030
|
-
(name3) => name3 === "PUBLIC_HEADERS_FOLDER_PATH" ?
|
|
5046
|
+
(name3) => name3 === "PUBLIC_HEADERS_FOLDER_PATH" ? path30.join(wrapper, "Headers") : name3 === "PRIVATE_HEADERS_FOLDER_PATH" ? path30.join(wrapper, "PrivateHeaders") : settings2(name3)
|
|
5031
5047
|
);
|
|
5032
5048
|
return list(phase.files).flatMap((id) => {
|
|
5033
5049
|
const file = ref.project.resolvePath(
|
|
@@ -5035,17 +5051,17 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5035
5051
|
);
|
|
5036
5052
|
return file && HEADER_FILE.test(file) ? [
|
|
5037
5053
|
[
|
|
5038
|
-
|
|
5054
|
+
path30.resolve(
|
|
5039
5055
|
settings2("BUILT_PRODUCTS_DIR"),
|
|
5040
5056
|
destination,
|
|
5041
|
-
|
|
5057
|
+
path30.basename(file)
|
|
5042
5058
|
),
|
|
5043
5059
|
file
|
|
5044
5060
|
]
|
|
5045
5061
|
] : [];
|
|
5046
5062
|
});
|
|
5047
5063
|
}),
|
|
5048
|
-
...moduleMap ? [[
|
|
5064
|
+
...moduleMap ? [[path30.join(wrapper, "Modules", "module.modulemap"), moduleMap]] : []
|
|
5049
5065
|
]) : Object.fromEntries([
|
|
5050
5066
|
...podHeaders.map((file) => [file, file]),
|
|
5051
5067
|
...moduleMap ? [[moduleMap, moduleMap]] : []
|
|
@@ -5077,7 +5093,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5077
5093
|
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 }));
|
|
5078
5094
|
const frameworks = frameworkTargets.map(({ framework }) => framework);
|
|
5079
5095
|
const podSourceDirs = builtTargets.slice(0, -1).flatMap(
|
|
5080
|
-
({ ref, module: module2 }) => isPodsProject(ref.project.xcodeproj) ? [...module2.allSources, ...module2.objc?.headers ?? []].map((file) =>
|
|
5096
|
+
({ ref, module: module2 }) => isPodsProject(ref.project.xcodeproj) ? [...module2.allSources, ...module2.objc?.headers ?? []].map((file) => path30.dirname(file)).filter((dir) => fs16.existsSync(dir)) : []
|
|
5081
5097
|
);
|
|
5082
5098
|
const expandValue = (value, settings2) => {
|
|
5083
5099
|
if (typeof value === "string") return expand(value, settings2);
|
|
@@ -5098,7 +5114,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5098
5114
|
const phase = owner.ref.project.object(phaseId);
|
|
5099
5115
|
if (phase?.isa !== "PBXShellScriptBuildPhase" || str(phase.name) !== "[CP] Copy Pods Resources")
|
|
5100
5116
|
continue;
|
|
5101
|
-
const absolute = (raw) =>
|
|
5117
|
+
const absolute = (raw) => path30.resolve(owner.ref.project.projectDir, expand(raw, owner.settings));
|
|
5102
5118
|
const entries = (paths) => paths.flatMap((raw) => {
|
|
5103
5119
|
const file = absolute(raw);
|
|
5104
5120
|
xcconfigs.add(file);
|
|
@@ -5114,7 +5130,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5114
5130
|
].filter((file) => file.endsWith(".bundle"));
|
|
5115
5131
|
if (inputs.length !== outputs.length)
|
|
5116
5132
|
throw new Error(`${owner.module.name}: resource bundle copy lists differ`);
|
|
5117
|
-
const destinationRoot =
|
|
5133
|
+
const destinationRoot = path30.join(
|
|
5118
5134
|
owner.settings("TARGET_BUILD_DIR"),
|
|
5119
5135
|
owner.settings("UNLOCALIZED_RESOURCES_FOLDER_PATH")
|
|
5120
5136
|
);
|
|
@@ -5123,24 +5139,24 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5123
5139
|
const file = str(
|
|
5124
5140
|
target.ref.project.object(str(target.ref.target.productReference))?.path
|
|
5125
5141
|
);
|
|
5126
|
-
return file &&
|
|
5142
|
+
return file && path30.join(target.settings("TARGET_BUILD_DIR"), file) === input2;
|
|
5127
5143
|
});
|
|
5128
5144
|
if (!product && !isDirectory(input2))
|
|
5129
5145
|
throw new Error(
|
|
5130
5146
|
`${owner.module.name}: resource bundle input has no selected producer: ${input2}`
|
|
5131
5147
|
);
|
|
5132
|
-
const destination =
|
|
5133
|
-
if (destination === ".." || destination.startsWith(`..${
|
|
5148
|
+
const destination = path30.relative(destinationRoot, outputs[index]);
|
|
5149
|
+
if (destination === ".." || destination.startsWith(`..${path30.sep}`) || path30.isAbsolute(destination) || path30.basename(input2) !== path30.basename(destination))
|
|
5134
5150
|
throw new Error(
|
|
5135
5151
|
`${owner.module.name}: invalid resource bundle copy destination`
|
|
5136
5152
|
);
|
|
5137
|
-
const infoFile = product ?
|
|
5153
|
+
const infoFile = product ? path30.resolve(
|
|
5138
5154
|
product.ref.project.projectDir,
|
|
5139
5155
|
product.settings("INFOPLIST_FILE")
|
|
5140
5156
|
) : null;
|
|
5141
5157
|
if (infoFile) xcconfigs.add(infoFile);
|
|
5142
5158
|
const prefix = owner.ref === app ? "" : `Frameworks/${owner.module.moduleName}.framework/`;
|
|
5143
|
-
const bundlePath = prefix + destination.split(
|
|
5159
|
+
const bundlePath = prefix + destination.split(path30.sep).join("/");
|
|
5144
5160
|
if (resourceProducts.some((resource) => resource.path === bundlePath))
|
|
5145
5161
|
throw new Error(
|
|
5146
5162
|
`${owner.module.name}: duplicate resource bundle destination ${bundlePath}`
|
|
@@ -5151,21 +5167,21 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5151
5167
|
resources: product.module.resources,
|
|
5152
5168
|
infoPlist: plist2.build(
|
|
5153
5169
|
expandValue(
|
|
5154
|
-
plist2.parse(
|
|
5170
|
+
plist2.parse(fs16.readFileSync(infoFile, "utf8")),
|
|
5155
5171
|
product.settings
|
|
5156
5172
|
)
|
|
5157
5173
|
)
|
|
5158
5174
|
} : {
|
|
5159
|
-
resources:
|
|
5175
|
+
resources: fs16.readdirSync(input2, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => path30.join(entry.parentPath, entry.name)).sort(),
|
|
5160
5176
|
sourceRoot: input2
|
|
5161
5177
|
}
|
|
5162
5178
|
});
|
|
5163
5179
|
}
|
|
5164
5180
|
}
|
|
5165
5181
|
}
|
|
5166
|
-
const infoPlistFile = settings("INFOPLIST_FILE") ?
|
|
5182
|
+
const infoPlistFile = settings("INFOPLIST_FILE") ? path30.resolve(app.project.projectDir, settings("INFOPLIST_FILE")) : null;
|
|
5167
5183
|
const infoPlistPending = module.generatedInfoPlist && !options.prepareGeneratedSources;
|
|
5168
|
-
const sourceInfo = infoPlistFile && !infoPlistPending ? plist2.parse(
|
|
5184
|
+
const sourceInfo = infoPlistFile && !infoPlistPending ? plist2.parse(fs16.readFileSync(infoPlistFile, "utf8")) : {};
|
|
5169
5185
|
if (!sourceInfo || typeof sourceInfo !== "object" || Array.isArray(sourceInfo) || sourceInfo instanceof Date || Buffer.isBuffer(sourceInfo)) {
|
|
5170
5186
|
throw new Error(`${module.name} Info.plist must contain a dictionary`);
|
|
5171
5187
|
}
|
|
@@ -5211,7 +5227,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5211
5227
|
};
|
|
5212
5228
|
}
|
|
5213
5229
|
const localPackageDirs = [
|
|
5214
|
-
...listed.filter((reference) =>
|
|
5230
|
+
...listed.filter((reference) => fs16.existsSync(path30.join(reference, "Package.swift"))),
|
|
5215
5231
|
...projects.flatMap(
|
|
5216
5232
|
(project) => Object.entries(project.objects).flatMap(([id, entry]) => {
|
|
5217
5233
|
if (!isDict(entry)) return [];
|
|
@@ -5221,19 +5237,19 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5221
5237
|
const packages = [];
|
|
5222
5238
|
while (pending.length > 0) {
|
|
5223
5239
|
const dir = pending.pop();
|
|
5224
|
-
if (
|
|
5240
|
+
if (fs16.existsSync(path30.join(dir, "Package.swift"))) {
|
|
5225
5241
|
packages.push(dir);
|
|
5226
5242
|
continue;
|
|
5227
5243
|
}
|
|
5228
5244
|
if (!isDirectory(dir)) continue;
|
|
5229
|
-
for (const child of
|
|
5245
|
+
for (const child of fs16.readdirSync(dir, { withFileTypes: true }))
|
|
5230
5246
|
if (child.isDirectory() && !child.name.startsWith("."))
|
|
5231
|
-
pending.push(
|
|
5247
|
+
pending.push(path30.join(dir, child.name));
|
|
5232
5248
|
}
|
|
5233
5249
|
return packages;
|
|
5234
5250
|
}
|
|
5235
|
-
const candidate = entry.isa === "XCLocalSwiftPackageReference" ?
|
|
5236
|
-
return candidate &&
|
|
5251
|
+
const candidate = entry.isa === "XCLocalSwiftPackageReference" ? path30.resolve(project.projectDir, str(entry.relativePath) ?? "") : entry.isa === "PBXFileReference" ? project.resolvePath(id) : null;
|
|
5252
|
+
return candidate && fs16.existsSync(path30.join(candidate, "Package.swift")) ? [candidate] : [];
|
|
5237
5253
|
})
|
|
5238
5254
|
)
|
|
5239
5255
|
];
|
|
@@ -5256,7 +5272,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5256
5272
|
const searchedFrameworks = /* @__PURE__ */ new Map();
|
|
5257
5273
|
const frameworkSearchDirectories = /* @__PURE__ */ new Set();
|
|
5258
5274
|
for (const { ref, settings: settings2 } of builtTargets) {
|
|
5259
|
-
const absolute = (raw) =>
|
|
5275
|
+
const absolute = (raw) => path30.resolve(ref.project.projectDir, expand(raw, settings2));
|
|
5260
5276
|
const requested = options.nativeModules;
|
|
5261
5277
|
const includeBinary = (name2, dir) => {
|
|
5262
5278
|
if (!requested || nativeTargets.has(ref) || requested.includes(name2) || dir.endsWith(".xcframework") && localSwiftBinaryModules(dir).some((module2) => requested.includes(module2)))
|
|
@@ -5268,14 +5284,14 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5268
5284
|
for (const directory of expandSearchPath(absolute(raw), searchRules)) {
|
|
5269
5285
|
if (frameworkSearchDirectories.has(directory)) continue;
|
|
5270
5286
|
frameworkSearchDirectories.add(directory);
|
|
5271
|
-
if (!
|
|
5287
|
+
if (!fs16.statSync(directory, { throwIfNoEntry: false })?.isDirectory() || /\.sdk\/(?:System|Developer)\/Library\/Frameworks\/?$/.test(directory))
|
|
5272
5288
|
continue;
|
|
5273
|
-
for (const entry of
|
|
5289
|
+
for (const entry of fs16.readdirSync(directory, { withFileTypes: true })) {
|
|
5274
5290
|
const name2 = /^(.+)\.framework$/.exec(entry.name)?.[1];
|
|
5275
5291
|
if (!name2 || byProduct.has(entry.name) || searchedFrameworks.has(name2))
|
|
5276
5292
|
continue;
|
|
5277
|
-
const file =
|
|
5278
|
-
if (
|
|
5293
|
+
const file = path30.join(directory, entry.name);
|
|
5294
|
+
if (fs16.statSync(file, { throwIfNoEntry: false })?.isDirectory())
|
|
5279
5295
|
searchedFrameworks.set(name2, file);
|
|
5280
5296
|
}
|
|
5281
5297
|
}
|
|
@@ -5283,9 +5299,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5283
5299
|
}
|
|
5284
5300
|
for (const raw of settingList(settings2("SWIFT_INCLUDE_PATHS"))) {
|
|
5285
5301
|
const dir = absolute(raw);
|
|
5286
|
-
const modulemap =
|
|
5287
|
-
if (!
|
|
5288
|
-
const name2 = moduleMapName(
|
|
5302
|
+
const modulemap = path30.join(dir, "module.modulemap");
|
|
5303
|
+
if (!fs16.existsSync(modulemap)) continue;
|
|
5304
|
+
const name2 = moduleMapName(fs16.readFileSync(modulemap, "utf8"));
|
|
5289
5305
|
if (name2 && !binaryFrameworks.has(name2)) includeBinary(name2, dir);
|
|
5290
5306
|
}
|
|
5291
5307
|
for (const phaseId of list(ref.target.buildPhases)) {
|
|
@@ -5294,7 +5310,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5294
5310
|
const inputs = list(phase.inputPaths).map(absolute);
|
|
5295
5311
|
for (const raw of list(phase.inputFileListPaths)) {
|
|
5296
5312
|
const file = absolute(raw);
|
|
5297
|
-
if (!
|
|
5313
|
+
if (!fs16.existsSync(file)) continue;
|
|
5298
5314
|
xcconfigs.add(file);
|
|
5299
5315
|
inputs.push(...fileListEntries(file, absolute));
|
|
5300
5316
|
}
|
|
@@ -5343,7 +5359,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5343
5359
|
product,
|
|
5344
5360
|
source: reference?.isa === "XCRemoteSwiftPackageReference" ? { kind: "remote", url: str(reference.repositoryURL) ?? "" } : reference?.isa === "XCLocalSwiftPackageReference" ? {
|
|
5345
5361
|
kind: "local",
|
|
5346
|
-
dir:
|
|
5362
|
+
dir: path30.resolve(
|
|
5347
5363
|
project.projectDir,
|
|
5348
5364
|
str(reference.relativePath) ?? ""
|
|
5349
5365
|
)
|
|
@@ -5376,10 +5392,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5376
5392
|
// however it is rooted: xcode links -framework <name> from the sdk
|
|
5377
5393
|
// and a stale group-relative path to it contributes nothing.
|
|
5378
5394
|
/\/System\/Library\/Frameworks\/[^/]+$/.test(`/${rawPath}`) || // a target in the workspace builds it, so it exists only after that build
|
|
5379
|
-
byProduct.has(
|
|
5395
|
+
byProduct.has(path30.basename(rawPath)))
|
|
5380
5396
|
continue;
|
|
5381
5397
|
const resolved = fileId ? project.resolvePath(fileId) : null;
|
|
5382
|
-
if (fileId && resolved !== null && !
|
|
5398
|
+
if (fileId && resolved !== null && !fs16.existsSync(resolved))
|
|
5383
5399
|
throw new Error(
|
|
5384
5400
|
`${str(target.name) ?? "target"}: linked framework ${name2} (${fileId}) points at missing ${resolved} in ${project.projectFile}`
|
|
5385
5401
|
);
|
|
@@ -5402,7 +5418,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5402
5418
|
({ product }) => !options.nativeModules || nativeTargets.has(built.ref) || options.nativeModules.includes(product)
|
|
5403
5419
|
);
|
|
5404
5420
|
const resolvedFile = workspaceResolvedFile(xcodeprojOrWorkspace);
|
|
5405
|
-
let packageResolved =
|
|
5421
|
+
let packageResolved = fs16.existsSync(resolvedFile) ? [fs16.realpathSync(resolvedFile)] : [...new Set(localPackageDirs.map((dir) => path30.join(dir, "Package.resolved")))].filter((file) => fs16.existsSync(file)).map((file) => fs16.realpathSync(file)).sort();
|
|
5406
5422
|
if (packageResolved.length === 0) {
|
|
5407
5423
|
const requirements = remotePackageRequirements(projects);
|
|
5408
5424
|
if (requirements.length > 0) {
|
|
@@ -5428,14 +5444,14 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5428
5444
|
} : {},
|
|
5429
5445
|
rootDir: commonAncestor(
|
|
5430
5446
|
[
|
|
5431
|
-
workspace ?
|
|
5447
|
+
workspace ? path30.dirname(workspace) : app.project.projectDir,
|
|
5432
5448
|
...used.map((project) => project.projectDir),
|
|
5433
5449
|
...localPackageDirs,
|
|
5434
5450
|
...linkedProducts.flatMap(
|
|
5435
|
-
({ source }) => source.kind === "local" &&
|
|
5451
|
+
({ source }) => source.kind === "local" && fs16.existsSync(source.dir) ? [source.dir] : []
|
|
5436
5452
|
),
|
|
5437
5453
|
...new Set(podSourceDirs)
|
|
5438
|
-
].map((dir) =>
|
|
5454
|
+
].map((dir) => fs16.realpathSync(dir))
|
|
5439
5455
|
),
|
|
5440
5456
|
projectFiles: [
|
|
5441
5457
|
.../* @__PURE__ */ new Set([
|
|
@@ -5454,7 +5470,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5454
5470
|
resourceProducts,
|
|
5455
5471
|
linkedProducts,
|
|
5456
5472
|
localPackageDirs: [
|
|
5457
|
-
...new Set(localPackageDirs.map((dir) =>
|
|
5473
|
+
...new Set(localPackageDirs.map((dir) => fs16.realpathSync(dir)))
|
|
5458
5474
|
].sort(),
|
|
5459
5475
|
binaryFrameworks: [...binaryFrameworks].map(([name2, file]) => ({ name: name2, path: file })).sort((left, right) => left.name.localeCompare(right.name)),
|
|
5460
5476
|
packageResolved,
|
|
@@ -5544,7 +5560,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
5544
5560
|
const rtcAppGroupIdentifier = nonEmptyString2(dictionary.RTCAppGroupIdentifier);
|
|
5545
5561
|
const screenShareExtensionBundleId = typeof dictionary.ScreenShareExtensionBundleId === "string" ? dictionary.ScreenShareExtensionBundleId : void 0;
|
|
5546
5562
|
const rootModuleName = readRootModuleName(
|
|
5547
|
-
app.allSources.filter((file) => /Delegate\.(?:swift|mm|m)$/.test(file) &&
|
|
5563
|
+
app.allSources.filter((file) => /Delegate\.(?:swift|mm|m)$/.test(file) && fs17.existsSync(file)).map((file) => fs17.readFileSync(file, "utf8"))
|
|
5548
5564
|
);
|
|
5549
5565
|
return stampNativeBuildSdk({
|
|
5550
5566
|
applicationName,
|
|
@@ -5565,7 +5581,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
5565
5581
|
googleSignIn: readGoogleSignInConfiguration(
|
|
5566
5582
|
dictionary,
|
|
5567
5583
|
Object.fromEntries(
|
|
5568
|
-
app.resources.filter((file) => file.endsWith(".plist")).map((file) => [file, parseInfoPlist(
|
|
5584
|
+
app.resources.filter((file) => file.endsWith(".plist")).map((file) => [file, parseInfoPlist(fs17.readFileSync(file, "utf8"))])
|
|
5569
5585
|
)
|
|
5570
5586
|
),
|
|
5571
5587
|
supportedInterfaceOrientations,
|
|
@@ -5574,11 +5590,11 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
5574
5590
|
alternateIconNames: [...alternateIconNames],
|
|
5575
5591
|
appIconArtwork: resolveNativeAppIconArtwork(
|
|
5576
5592
|
app.resources,
|
|
5577
|
-
(file) =>
|
|
5593
|
+
(file) => fs17.readFileSync(file, "utf8"),
|
|
5578
5594
|
(file) => {
|
|
5579
|
-
const extension =
|
|
5595
|
+
const extension = path31.extname(file).toLowerCase();
|
|
5580
5596
|
const contentType = extension === ".jpg" || extension === ".jpeg" ? "image/jpeg" : extension === ".webp" ? "image/webp" : "image/png";
|
|
5581
|
-
return `data:${contentType};base64,${
|
|
5597
|
+
return `data:${contentType};base64,${fs17.readFileSync(file).toString("base64")}`;
|
|
5582
5598
|
},
|
|
5583
5599
|
icons,
|
|
5584
5600
|
app.appIconName,
|
|
@@ -5607,23 +5623,23 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
|
|
|
5607
5623
|
const read = selectNativeAppIdentityReader(platform, {
|
|
5608
5624
|
android: () => null,
|
|
5609
5625
|
ios: () => {
|
|
5610
|
-
const nested =
|
|
5611
|
-
const iosRoot =
|
|
5626
|
+
const nested = path31.join(projectRoot, "ios");
|
|
5627
|
+
const iosRoot = fs17.existsSync(nested) ? nested : projectRoot;
|
|
5612
5628
|
const prefix = iosRoot === nested ? "ios/" : "";
|
|
5613
5629
|
const files = {};
|
|
5614
|
-
for (const entry of
|
|
5630
|
+
for (const entry of fs17.readdirSync(iosRoot, { withFileTypes: true })) {
|
|
5615
5631
|
if (entry.name === "Pods") continue;
|
|
5616
5632
|
if (entry.isDirectory()) {
|
|
5617
5633
|
const names = entry.name.endsWith(".xcodeproj") ? ["project.pbxproj"] : ["Info.plist", "AppDelegate.swift", "AppDelegate.mm", "AppDelegate.m"];
|
|
5618
5634
|
for (const name2 of names) {
|
|
5619
5635
|
const relative2 = `${prefix}${entry.name}/${name2}`;
|
|
5620
|
-
const file =
|
|
5621
|
-
if (
|
|
5636
|
+
const file = path31.join(projectRoot, relative2);
|
|
5637
|
+
if (fs17.existsSync(file)) files[relative2] = fs17.readFileSync(file, "utf8");
|
|
5622
5638
|
}
|
|
5623
5639
|
} else if (/AppDelegate\.(?:swift|mm|m)$/.test(entry.name)) {
|
|
5624
5640
|
const relative2 = `${prefix}${entry.name}`;
|
|
5625
|
-
const file =
|
|
5626
|
-
if (
|
|
5641
|
+
const file = path31.join(projectRoot, relative2);
|
|
5642
|
+
if (fs17.existsSync(file)) files[relative2] = fs17.readFileSync(file, "utf8");
|
|
5627
5643
|
}
|
|
5628
5644
|
}
|
|
5629
5645
|
const identity = extractNativeAppIdentityFromFiles(
|
|
@@ -5640,41 +5656,41 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
|
|
|
5640
5656
|
function readAndroidNativeAppIdentity(projectRoot, androidMergedManifest) {
|
|
5641
5657
|
const files = {};
|
|
5642
5658
|
if (androidMergedManifest) {
|
|
5643
|
-
const file =
|
|
5644
|
-
if (!
|
|
5645
|
-
files[androidMergedManifest] =
|
|
5659
|
+
const file = path31.resolve(projectRoot, androidMergedManifest);
|
|
5660
|
+
if (!fs17.existsSync(file)) return null;
|
|
5661
|
+
files[androidMergedManifest] = fs17.readFileSync(file, "utf8");
|
|
5646
5662
|
} else {
|
|
5647
|
-
const androidRoot =
|
|
5648
|
-
if (!
|
|
5663
|
+
const androidRoot = path31.join(projectRoot, "android");
|
|
5664
|
+
if (!fs17.existsSync(androidRoot)) return null;
|
|
5649
5665
|
const collect = (directory) => {
|
|
5650
|
-
for (const entry of
|
|
5651
|
-
const file =
|
|
5666
|
+
for (const entry of fs17.readdirSync(directory, { withFileTypes: true })) {
|
|
5667
|
+
const file = path31.join(directory, entry.name);
|
|
5652
5668
|
if (entry.isDirectory()) collect(file);
|
|
5653
5669
|
else if (entry.isFile() && entry.name === "AndroidManifest.xml")
|
|
5654
|
-
files[
|
|
5670
|
+
files[path31.relative(projectRoot, file).split(path31.sep).join("/")] = fs17.readFileSync(file, "utf8");
|
|
5655
5671
|
}
|
|
5656
5672
|
};
|
|
5657
|
-
for (const module of
|
|
5673
|
+
for (const module of fs17.readdirSync(androidRoot, { withFileTypes: true })) {
|
|
5658
5674
|
if (!module.isDirectory()) continue;
|
|
5659
|
-
const outputs =
|
|
5675
|
+
const outputs = path31.join(
|
|
5660
5676
|
androidRoot,
|
|
5661
5677
|
module.name,
|
|
5662
5678
|
"build/intermediates/merged_manifests"
|
|
5663
5679
|
);
|
|
5664
|
-
if (
|
|
5680
|
+
if (fs17.existsSync(outputs)) collect(outputs);
|
|
5665
5681
|
}
|
|
5666
5682
|
}
|
|
5667
5683
|
for (const manifest of Object.keys(files)) {
|
|
5668
5684
|
const resourceDirectory = androidMergedResourceValuesDirectory(manifest);
|
|
5669
5685
|
if (!resourceDirectory) continue;
|
|
5670
|
-
const absolute =
|
|
5671
|
-
if (!
|
|
5672
|
-
for (const entry of
|
|
5686
|
+
const absolute = path31.resolve(projectRoot, resourceDirectory);
|
|
5687
|
+
if (!fs17.existsSync(absolute)) continue;
|
|
5688
|
+
for (const entry of fs17.readdirSync(absolute, { withFileTypes: true })) {
|
|
5673
5689
|
if (!entry.isDirectory() || !/^values(?:-|$)/.test(entry.name)) continue;
|
|
5674
|
-
for (const resource of
|
|
5690
|
+
for (const resource of fs17.readdirSync(path31.join(absolute, entry.name))) {
|
|
5675
5691
|
if (!resource.endsWith(".xml")) continue;
|
|
5676
5692
|
const file = `${resourceDirectory}/${entry.name}/${resource}`;
|
|
5677
|
-
files[file] =
|
|
5693
|
+
files[file] = fs17.readFileSync(path31.resolve(projectRoot, file), "utf8");
|
|
5678
5694
|
}
|
|
5679
5695
|
}
|
|
5680
5696
|
}
|
|
@@ -5691,7 +5707,7 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget, enviro
|
|
|
5691
5707
|
const app = readIosAppTarget(projectRoot, iosTarget, environment);
|
|
5692
5708
|
if (!app) return null;
|
|
5693
5709
|
const identity = readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist);
|
|
5694
|
-
const projectManifestPath =
|
|
5710
|
+
const projectManifestPath = path31.join(projectRoot, "package.json");
|
|
5695
5711
|
const projectRequire = createRequire(projectManifestPath);
|
|
5696
5712
|
let reanimatedManifestPath;
|
|
5697
5713
|
try {
|
|
@@ -5705,22 +5721,22 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget, enviro
|
|
|
5705
5721
|
throw error;
|
|
5706
5722
|
}
|
|
5707
5723
|
const installedManifest = JSON.parse(
|
|
5708
|
-
|
|
5724
|
+
fs17.readFileSync(reanimatedManifestPath, "utf8")
|
|
5709
5725
|
);
|
|
5710
5726
|
const installedVersion = isRecord(installedManifest) ? nonEmptyString2(installedManifest.version) : void 0;
|
|
5711
5727
|
if (!installedVersion) throw new Error("Reanimated package version is malformed");
|
|
5712
5728
|
if (Number.parseInt(installedVersion, 10) < 4) return identity;
|
|
5713
5729
|
const defaults = JSON.parse(
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5730
|
+
fs17.readFileSync(
|
|
5731
|
+
path31.join(
|
|
5732
|
+
path31.dirname(reanimatedManifestPath),
|
|
5717
5733
|
"src/featureFlags/staticFlags.json"
|
|
5718
5734
|
),
|
|
5719
5735
|
"utf8"
|
|
5720
5736
|
)
|
|
5721
5737
|
);
|
|
5722
5738
|
if (!isRecord(defaults)) throw new Error("Reanimated static flags are malformed");
|
|
5723
|
-
const manifest = JSON.parse(
|
|
5739
|
+
const manifest = JSON.parse(fs17.readFileSync(projectManifestPath, "utf8"));
|
|
5724
5740
|
const reanimated = isRecord(manifest) ? manifest.reanimated : void 0;
|
|
5725
5741
|
const overrides = isRecord(reanimated) ? reanimated.staticFeatureFlags : void 0;
|
|
5726
5742
|
if (overrides !== void 0 && !isRecord(overrides)) {
|