peachsim 0.1.1817 → 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 +5 -0
- 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/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 +2823 -3829
- 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 +2 -2
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +1703 -1579
- 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 +2781 -3793
- package/dist-lib/host/fetch-proxy-handler.cjs +2 -2
- 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 +29 -8
- 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 +28 -7
- package/dist-lib/native-app-identity-project.cjs +31 -6
- package/dist-lib/native-app-identity-project.mjs +295 -259
- 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 +100 -80
- 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 +3166 -4142
- package/dist-lib/swift-compile.cjs +118 -29
- package/dist-lib/swift-compile.mjs +125 -34
- 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 +2188 -2060
- package/dist-lib/vite.cjs +2 -2
- 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 +11 -9
- package/src/expo-discovery-cache.ts +69 -52
- package/src/expo-swift-host.ts +45 -7
- 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-compile.ts +45 -16
- package/src/nitro-superset.ts +4 -5
- package/src/plist-bytes.ts +9 -0
- package/src/portable-expo-workspace.ts +4 -3
- package/src/react-native-bridge-modules.ts +11 -15
- package/src/swift-compile.ts +124 -18
- 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 +4 -1
- package/src/swift-package-manifest.ts +2 -2
- package/src/swift-root-lock.ts +4 -3
- package/src/swift-standins.ts +5 -26
- 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 +91 -15
|
@@ -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",
|
|
@@ -2431,9 +2443,9 @@ var NATIVE_GRAPH_ID = createHash2("sha256").update(JSON.stringify(NATIVE_GRAPH_I
|
|
|
2431
2443
|
// src/xcode-project.ts
|
|
2432
2444
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
2433
2445
|
import { execFileSync as execFileSync11 } from "node:child_process";
|
|
2434
|
-
import { createHash as
|
|
2435
|
-
import
|
|
2436
|
-
import
|
|
2446
|
+
import { createHash as createHash15 } from "node:crypto";
|
|
2447
|
+
import fs16 from "node:fs";
|
|
2448
|
+
import path30 from "node:path";
|
|
2437
2449
|
import plist2 from "plist";
|
|
2438
2450
|
|
|
2439
2451
|
// src/prepared-xcode-phases.ts
|
|
@@ -2800,31 +2812,32 @@ import {
|
|
|
2800
2812
|
execFile as execFile3,
|
|
2801
2813
|
execFileSync as execFileSync10
|
|
2802
2814
|
} from "node:child_process";
|
|
2803
|
-
import { createHash as
|
|
2804
|
-
import
|
|
2815
|
+
import { createHash as createHash14 } from "node:crypto";
|
|
2816
|
+
import fs15 from "node:fs";
|
|
2805
2817
|
import os8 from "node:os";
|
|
2806
|
-
import
|
|
2818
|
+
import path28 from "node:path";
|
|
2807
2819
|
import { promisify as promisify3 } from "node:util";
|
|
2808
2820
|
|
|
2809
2821
|
// src/swift-distribution.ts
|
|
2810
2822
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
2811
|
-
import
|
|
2823
|
+
import fs14 from "node:fs";
|
|
2812
2824
|
import os7 from "node:os";
|
|
2813
|
-
import
|
|
2825
|
+
import path27 from "node:path";
|
|
2814
2826
|
|
|
2815
2827
|
// ../contrast-runtime-delivery/src/index.ts
|
|
2816
2828
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
2817
|
-
import { spawn as
|
|
2829
|
+
import { spawn as spawn3 } from "node:child_process";
|
|
2818
2830
|
import crypto from "node:crypto";
|
|
2819
2831
|
import fs7 from "node:fs";
|
|
2820
2832
|
import os2 from "node:os";
|
|
2821
2833
|
import path10 from "node:path";
|
|
2822
2834
|
import { Readable } from "node:stream";
|
|
2823
|
-
import { pipeline } from "node:stream/promises";
|
|
2835
|
+
import { pipeline as pipeline2 } from "node:stream/promises";
|
|
2836
|
+
import zlib2 from "node:zlib";
|
|
2824
2837
|
|
|
2825
2838
|
// src/process-group.ts
|
|
2826
2839
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
2827
|
-
import { spawn, spawnSync as spawnSync4 } from "node:child_process";
|
|
2840
|
+
import { spawn as spawn2, spawnSync as spawnSync4 } from "node:child_process";
|
|
2828
2841
|
import {
|
|
2829
2842
|
appendFileSync,
|
|
2830
2843
|
mkdtempSync,
|
|
@@ -2895,7 +2908,7 @@ var CLI_UPDATE_NOTIFICATION_COOLDOWN_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
|
2895
2908
|
// src/swift-compile.ts
|
|
2896
2909
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
2897
2910
|
import {
|
|
2898
|
-
spawn as
|
|
2911
|
+
spawn as spawn5,
|
|
2899
2912
|
execFileSync as execFileSync9
|
|
2900
2913
|
} from "node:child_process";
|
|
2901
2914
|
import { createHash as createHash12, randomUUID as randomUUID5 } from "node:crypto";
|
|
@@ -3010,7 +3023,7 @@ import os4 from "node:os";
|
|
|
3010
3023
|
// src/swift-root-lock.ts
|
|
3011
3024
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3012
3025
|
import {
|
|
3013
|
-
spawn as
|
|
3026
|
+
spawn as spawn4
|
|
3014
3027
|
} from "node:child_process";
|
|
3015
3028
|
import { createHash as createHash10, randomUUID as randomUUID4 } from "node:crypto";
|
|
3016
3029
|
import {
|
|
@@ -3166,7 +3179,7 @@ var FOUNDATION_IMPLICIT_MODULES = [
|
|
|
3166
3179
|
var FOUNDATION_IMPLICIT_FLAGS = FOUNDATION_IMPLICIT_MODULES.map(
|
|
3167
3180
|
(module) => `, "-Xfrontend", "-import-module", "-Xfrontend", "${module}"`
|
|
3168
3181
|
).join("");
|
|
3169
|
-
var compilerSourceDigest = true ? "
|
|
3182
|
+
var compilerSourceDigest = true ? "f079d0f9f3d0467a52729f6950de38e5f71e1ad9017031a3ec3722aad044dac2" : swiftCompilerSourceDigest(import.meta.dirname);
|
|
3170
3183
|
var CORE_FOUNDATION_HANDLE_IMPORTS = [
|
|
3171
3184
|
"CFAllocator",
|
|
3172
3185
|
"CFArray",
|
|
@@ -3191,14 +3204,37 @@ var host = globalThis;
|
|
|
3191
3204
|
var rootLocks = host[ROOT_LOCKS] ?? (host[ROOT_LOCKS] = /* @__PURE__ */ new Map());
|
|
3192
3205
|
var SHARED_ARTIFACT_BUDGET_BYTES = 4 * 1024 ** 3;
|
|
3193
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
|
+
|
|
3194
3230
|
// src/swift-package-manifest.ts
|
|
3195
|
-
var cacheDir3 =
|
|
3231
|
+
var cacheDir3 = path28.join(cacheDir(), "swift-manifests");
|
|
3196
3232
|
var execFileAsync = promisify3(execFile3);
|
|
3197
3233
|
|
|
3198
3234
|
// src/xcode-json-project.ts
|
|
3199
3235
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
3200
3236
|
var import_json5 = __toESM(require_lib(), 1);
|
|
3201
|
-
import
|
|
3237
|
+
import path29 from "node:path";
|
|
3202
3238
|
var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3203
3239
|
var text = (value) => typeof value === "string" ? value : void 0;
|
|
3204
3240
|
var items = (value) => Array.isArray(value) ? value : [];
|
|
@@ -3255,7 +3291,7 @@ var PHASE_ISA = {
|
|
|
3255
3291
|
function readXcodeJsonProject(xcodeproj, source) {
|
|
3256
3292
|
const json = import_json5.default.parse(source);
|
|
3257
3293
|
if (!isJsonObject(json)) throw new Error(`${xcodeproj}/project.xcproj is not an object`);
|
|
3258
|
-
const projectDir =
|
|
3294
|
+
const projectDir = path29.dirname(xcodeproj);
|
|
3259
3295
|
const objects = {};
|
|
3260
3296
|
let next = 0;
|
|
3261
3297
|
const add = (entry, id) => {
|
|
@@ -3268,7 +3304,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
3268
3304
|
const base = /^<([A-Z]+)>\/(.*)$/.exec(raw);
|
|
3269
3305
|
if (base) {
|
|
3270
3306
|
if (base[1] === "PROJECT")
|
|
3271
|
-
return { sourceTree: "<absolute>", path:
|
|
3307
|
+
return { sourceTree: "<absolute>", path: path29.join(projectDir, base[2]) };
|
|
3272
3308
|
if (base[1] === "PRODUCTS")
|
|
3273
3309
|
return { sourceTree: "BUILT_PRODUCTS_DIR", path: base[2] };
|
|
3274
3310
|
return null;
|
|
@@ -3276,7 +3312,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
3276
3312
|
const unescaped = raw.replaceAll("\\<", "<");
|
|
3277
3313
|
if (unescaped.startsWith("/")) return { sourceTree: "<absolute>", path: unescaped };
|
|
3278
3314
|
if (unescaped.startsWith("~")) return null;
|
|
3279
|
-
return groupDir === null ? null : { sourceTree: "<absolute>", path:
|
|
3315
|
+
return groupDir === null ? null : { sourceTree: "<absolute>", path: path29.join(groupDir, unescaped) };
|
|
3280
3316
|
};
|
|
3281
3317
|
const memberships = [];
|
|
3282
3318
|
const folders = [];
|
|
@@ -3287,7 +3323,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
3287
3323
|
const kind = text(entry.kind) ?? "file-reference";
|
|
3288
3324
|
const raw = text(entry.path) ?? "";
|
|
3289
3325
|
const located = raw === "" ? null : locate(raw, parent.dir);
|
|
3290
|
-
const name2 = text(entry.name) ??
|
|
3326
|
+
const name2 = text(entry.name) ?? path29.basename(raw);
|
|
3291
3327
|
const node = { id: "", name: name2, dir: null, parent, children: [] };
|
|
3292
3328
|
if (kind === "group" || kind === "variant-group" || kind === "version-group") {
|
|
3293
3329
|
node.dir = raw === "" ? parent.dir : located?.sourceTree === "<absolute>" ? located.path : null;
|
|
@@ -3408,7 +3444,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
3408
3444
|
if (!isObject(entry)) continue;
|
|
3409
3445
|
const repository = text(entry.repository);
|
|
3410
3446
|
const local = text(entry.path);
|
|
3411
|
-
const name2 = local !== void 0 ?
|
|
3447
|
+
const name2 = local !== void 0 ? path29.basename(path29.resolve(path29.dirname(xcodeproj), local)) : path29.basename(repository ?? "").replace(/\.git$/, "");
|
|
3412
3448
|
const id = text(entry.kind) === "local" && local !== void 0 ? add({ isa: "XCLocalSwiftPackageReference", relativePath: local }) : add({
|
|
3413
3449
|
isa: "XCRemoteSwiftPackageReference",
|
|
3414
3450
|
repositoryURL: repository ?? "",
|
|
@@ -3618,28 +3654,28 @@ var CONDITIONS = {
|
|
|
3618
3654
|
variant: "normal"
|
|
3619
3655
|
};
|
|
3620
3656
|
function walkFiles(dir) {
|
|
3621
|
-
if (!
|
|
3657
|
+
if (!fs16.existsSync(dir)) return [];
|
|
3622
3658
|
const out = [];
|
|
3623
|
-
for (const entry of
|
|
3659
|
+
for (const entry of fs16.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name))) {
|
|
3624
3660
|
if (entry.name.startsWith(".")) continue;
|
|
3625
|
-
const full =
|
|
3661
|
+
const full = path30.join(dir, entry.name);
|
|
3626
3662
|
if (entry.isDirectory()) out.push(...walkFiles(full));
|
|
3627
3663
|
else if (entry.isFile()) out.push(full);
|
|
3628
3664
|
}
|
|
3629
3665
|
return out;
|
|
3630
3666
|
}
|
|
3631
|
-
var isDirectory = (dir) =>
|
|
3667
|
+
var isDirectory = (dir) => fs16.existsSync(dir) && fs16.statSync(dir).isDirectory();
|
|
3632
3668
|
function readXcconfig(file, read) {
|
|
3633
|
-
if (read.includes(file) || !
|
|
3669
|
+
if (read.includes(file) || !fs16.existsSync(file)) return {};
|
|
3634
3670
|
read.push(file);
|
|
3635
3671
|
const settings = {};
|
|
3636
|
-
for (const raw of
|
|
3672
|
+
for (const raw of fs16.readFileSync(file, "utf8").split("\n")) {
|
|
3637
3673
|
const line = raw.replace(/\/\/.*$/, "").trim();
|
|
3638
3674
|
const include = /^#include\??\s+"([^"]+)"/.exec(line);
|
|
3639
3675
|
if (include) {
|
|
3640
3676
|
Object.assign(
|
|
3641
3677
|
settings,
|
|
3642
|
-
readXcconfig(
|
|
3678
|
+
readXcconfig(path30.resolve(path30.dirname(file), include[1]), read)
|
|
3643
3679
|
);
|
|
3644
3680
|
continue;
|
|
3645
3681
|
}
|
|
@@ -3689,22 +3725,22 @@ function decodeXml(text2) {
|
|
|
3689
3725
|
return text2.replaceAll(""", '"').replaceAll("'", "'").replaceAll("<", "<").replaceAll(">", ">").replaceAll("&", "&");
|
|
3690
3726
|
}
|
|
3691
3727
|
function workspaceReferences(workspace) {
|
|
3692
|
-
const data =
|
|
3693
|
-
if (!
|
|
3728
|
+
const data = path30.join(workspace, "contents.xcworkspacedata");
|
|
3729
|
+
if (!fs16.existsSync(data))
|
|
3694
3730
|
throw new Error(`${workspace} has no contents.xcworkspacedata`);
|
|
3695
|
-
const container =
|
|
3731
|
+
const container = path30.dirname(workspace);
|
|
3696
3732
|
const locate = (location, base) => {
|
|
3697
3733
|
const colon = location.indexOf(":");
|
|
3698
3734
|
const kind = location.slice(0, colon);
|
|
3699
3735
|
const rest = location.slice(colon + 1);
|
|
3700
|
-
if (kind === "group") return
|
|
3701
|
-
if (kind === "container" || kind === "self") return
|
|
3702
|
-
if (kind === "absolute") return
|
|
3703
|
-
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}`);
|
|
3704
3740
|
};
|
|
3705
3741
|
const groups = [container];
|
|
3706
3742
|
const references = [];
|
|
3707
|
-
for (const [, closing, tag, attributes, selfClosing] of
|
|
3743
|
+
for (const [, closing, tag, attributes, selfClosing] of fs16.readFileSync(data, "utf8").matchAll(/<(\/?)(Group|FileRef)\b([^>]*?)(\/?)>/g)) {
|
|
3708
3744
|
if (closing) {
|
|
3709
3745
|
if (tag === "Group") groups.pop();
|
|
3710
3746
|
continue;
|
|
@@ -3755,8 +3791,8 @@ function remotePackageRequirements(projects) {
|
|
|
3755
3791
|
var loaded = /* @__PURE__ */ new Map();
|
|
3756
3792
|
function xcodeProjectFile(xcodeproj) {
|
|
3757
3793
|
for (const name2 of ["project.pbxproj", "project.xcproj"]) {
|
|
3758
|
-
const file =
|
|
3759
|
-
if (
|
|
3794
|
+
const file = path30.join(xcodeproj, name2);
|
|
3795
|
+
if (fs16.existsSync(file)) return file;
|
|
3760
3796
|
}
|
|
3761
3797
|
return null;
|
|
3762
3798
|
}
|
|
@@ -3764,8 +3800,8 @@ function loadProject(xcodeproj) {
|
|
|
3764
3800
|
const projectFile = xcodeProjectFile(xcodeproj);
|
|
3765
3801
|
if (!projectFile)
|
|
3766
3802
|
throw new Error(`${xcodeproj} has no project.pbxproj or project.xcproj`);
|
|
3767
|
-
const source =
|
|
3768
|
-
const digest =
|
|
3803
|
+
const source = fs16.readFileSync(projectFile, "utf8");
|
|
3804
|
+
const digest = createHash15("sha256").update(source).digest("hex");
|
|
3769
3805
|
const cached = loaded.get(projectFile);
|
|
3770
3806
|
if (cached?.digest === digest) return cached.project;
|
|
3771
3807
|
const root = projectFile.endsWith(".xcproj") ? readXcodeJsonProject(xcodeproj, source) : parseOpenStepPlist(source);
|
|
@@ -3781,10 +3817,10 @@ function loadProject(xcodeproj) {
|
|
|
3781
3817
|
if (!project || project.isa !== "PBXProject") {
|
|
3782
3818
|
throw new Error(`${projectFile} has no PBXProject root`);
|
|
3783
3819
|
}
|
|
3784
|
-
const projectDir =
|
|
3785
|
-
|
|
3820
|
+
const projectDir = fs16.realpathSync(
|
|
3821
|
+
path30.resolve(path30.dirname(xcodeproj), str(project.projectDirPath) ?? "")
|
|
3786
3822
|
);
|
|
3787
|
-
const resolvePath = xcodePathResolver(objects, projectDir,
|
|
3823
|
+
const resolvePath = xcodePathResolver(objects, projectDir, path30.join);
|
|
3788
3824
|
const result = {
|
|
3789
3825
|
xcodeproj,
|
|
3790
3826
|
projectFile,
|
|
@@ -3821,8 +3857,8 @@ function targetSettings(ref, configuration, builtins, options = {}, overrides =
|
|
|
3821
3857
|
const relative2 = str(config.baseConfigurationReferenceRelativePath);
|
|
3822
3858
|
const own = isDict(config.buildSettings) ? config.buildSettings : {};
|
|
3823
3859
|
const directory = anchor ? project.resolvePath(anchor) : null;
|
|
3824
|
-
const baseFile = base ? project.resolvePath(base) : directory && relative2 ?
|
|
3825
|
-
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)))
|
|
3826
3862
|
throw new Error(
|
|
3827
3863
|
`Unable to open base configuration reference file '${baseFile ?? base ?? relative2 ?? anchor}'`
|
|
3828
3864
|
);
|
|
@@ -3915,26 +3951,26 @@ function scriptCommand(shell, script) {
|
|
|
3915
3951
|
return [executable, ...args, "-c", script];
|
|
3916
3952
|
}
|
|
3917
3953
|
function expandSearchPath(directory, rules2) {
|
|
3918
|
-
if (
|
|
3954
|
+
if (path30.basename(directory) !== "**") return [directory];
|
|
3919
3955
|
const expanded = [];
|
|
3920
3956
|
const seen = /* @__PURE__ */ new Set();
|
|
3921
|
-
const queue = [
|
|
3957
|
+
const queue = [path30.dirname(directory)];
|
|
3922
3958
|
for (let at = 0; at < queue.length; at++) {
|
|
3923
3959
|
const current = queue[at];
|
|
3924
3960
|
let real;
|
|
3925
3961
|
try {
|
|
3926
|
-
real =
|
|
3962
|
+
real = fs16.realpathSync(current);
|
|
3927
3963
|
} catch {
|
|
3928
3964
|
continue;
|
|
3929
3965
|
}
|
|
3930
|
-
if (!
|
|
3966
|
+
if (!fs16.statSync(real).isDirectory() || seen.has(real)) continue;
|
|
3931
3967
|
seen.add(real);
|
|
3932
3968
|
expanded.push(current);
|
|
3933
|
-
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)) {
|
|
3934
3970
|
if (entry.isSymbolicLink() ? !rules2.followLinks : !entry.isDirectory()) continue;
|
|
3935
3971
|
if (rules2.excluded.some((pattern) => pattern.test(entry.name)) && !rules2.included.some((pattern) => pattern.test(entry.name)))
|
|
3936
3972
|
continue;
|
|
3937
|
-
queue.push(
|
|
3973
|
+
queue.push(path30.join(current, entry.name));
|
|
3938
3974
|
}
|
|
3939
3975
|
}
|
|
3940
3976
|
return expanded;
|
|
@@ -4005,7 +4041,7 @@ function shellAssetCatalogs(script, settings, projectDir) {
|
|
|
4005
4041
|
for (const token of tokens) {
|
|
4006
4042
|
if (token.startsWith("-")) break;
|
|
4007
4043
|
const file = resolve(token);
|
|
4008
|
-
if (file?.endsWith(".xcassets")) catalogs.push(
|
|
4044
|
+
if (file?.endsWith(".xcassets")) catalogs.push(path30.resolve(projectDir, file));
|
|
4009
4045
|
}
|
|
4010
4046
|
}
|
|
4011
4047
|
return catalogs;
|
|
@@ -4050,14 +4086,14 @@ function shellCopies(script, settings, projectDir) {
|
|
|
4050
4086
|
if (operands.length !== 2 || operands.some((operand) => operand.startsWith("-")))
|
|
4051
4087
|
return [];
|
|
4052
4088
|
copies.push({
|
|
4053
|
-
from:
|
|
4054
|
-
to:
|
|
4089
|
+
from: path30.resolve(projectDir, operands[0]),
|
|
4090
|
+
to: path30.resolve(projectDir, operands[1])
|
|
4055
4091
|
});
|
|
4056
4092
|
}
|
|
4057
4093
|
return copies;
|
|
4058
4094
|
}
|
|
4059
4095
|
function fileListEntries(file, absolute) {
|
|
4060
|
-
return
|
|
4096
|
+
return fs16.readFileSync(file, "utf8").split(/\r?\n/).map((line) => line.trim()).filter((line) => line !== "" && !line.startsWith("#")).map(absolute);
|
|
4061
4097
|
}
|
|
4062
4098
|
function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
4063
4099
|
const { project, target, id: targetId } = ref;
|
|
@@ -4070,7 +4106,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
4070
4106
|
const copiedFiles = [];
|
|
4071
4107
|
let generatedInfoPlist = false;
|
|
4072
4108
|
const declaredInfoPlist = settings("INFOPLIST_FILE");
|
|
4073
|
-
const infoPlistOutput = declaredInfoPlist ?
|
|
4109
|
+
const infoPlistOutput = declaredInfoPlist ? path30.resolve(project.projectDir, declaredInfoPlist) : null;
|
|
4074
4110
|
const isPreparedOutput = (file) => file === infoPlistOutput || options.requireSources !== false && file.endsWith(".swift");
|
|
4075
4111
|
for (const phaseId of list(target.buildPhases)) {
|
|
4076
4112
|
const phase = project.object(phaseId);
|
|
@@ -4085,7 +4121,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
4085
4121
|
copiedFiles.push(
|
|
4086
4122
|
...shellCopies(str(phase.shellScript) ?? "", settings, project.projectDir)
|
|
4087
4123
|
);
|
|
4088
|
-
const absolute = (raw) =>
|
|
4124
|
+
const absolute = (raw) => path30.resolve(project.projectDir, expand(raw, settings));
|
|
4089
4125
|
const inputs = list(phase.inputPaths).map(absolute);
|
|
4090
4126
|
const outputs = list(phase.outputPaths).map(absolute);
|
|
4091
4127
|
const fileLists = /* @__PURE__ */ new Map();
|
|
@@ -4094,7 +4130,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
4094
4130
|
kind === "INPUT" ? phase.inputFileListPaths : phase.outputFileListPaths
|
|
4095
4131
|
).map((raw) => {
|
|
4096
4132
|
const file = absolute(raw);
|
|
4097
|
-
if (!
|
|
4133
|
+
if (!fs16.existsSync(file)) {
|
|
4098
4134
|
return { file, entries: [] };
|
|
4099
4135
|
}
|
|
4100
4136
|
return { file, entries: fileListEntries(file, absolute) };
|
|
@@ -4115,7 +4151,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
4115
4151
|
...fileLists.get("OUTPUT").map((item) => item.file)
|
|
4116
4152
|
];
|
|
4117
4153
|
if (allOutputs.some((file) => file.endsWith(".swift") || file === infoPlistOutput)) {
|
|
4118
|
-
for (const file of inputFiles) if (
|
|
4154
|
+
for (const file of inputFiles) if (fs16.existsSync(file)) projectInputs.add(file);
|
|
4119
4155
|
}
|
|
4120
4156
|
if (options.prepareGeneratedSources === true && allOutputs.some(isPreparedOutput)) {
|
|
4121
4157
|
const configuration = settings("CONFIGURATION");
|
|
@@ -4128,10 +4164,10 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
4128
4164
|
false
|
|
4129
4165
|
))
|
|
4130
4166
|
continue;
|
|
4131
|
-
const phaseDir =
|
|
4167
|
+
const phaseDir = path30.join(settings("TARGET_TEMP_DIR"), `Script-${phaseId}`);
|
|
4132
4168
|
for (const lists of fileLists.values())
|
|
4133
4169
|
for (const { file } of lists)
|
|
4134
|
-
if (!
|
|
4170
|
+
if (!fs16.existsSync(file))
|
|
4135
4171
|
throw new Error(
|
|
4136
4172
|
`${targetName}: Run Script "${script}" missing file list ${file}`
|
|
4137
4173
|
);
|
|
@@ -4150,25 +4186,25 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
4150
4186
|
const lists = fileLists.get(kind);
|
|
4151
4187
|
env[`SCRIPT_${kind}_FILE_LIST_COUNT`] = String(lists.length);
|
|
4152
4188
|
lists.forEach((_item, index) => {
|
|
4153
|
-
env[`SCRIPT_${kind}_FILE_LIST_${index}`] =
|
|
4189
|
+
env[`SCRIPT_${kind}_FILE_LIST_${index}`] = path30.join(
|
|
4154
4190
|
phaseDir,
|
|
4155
4191
|
`${kind}-${index}.xcfilelist`
|
|
4156
4192
|
);
|
|
4157
4193
|
});
|
|
4158
4194
|
}
|
|
4159
|
-
const signature =
|
|
4195
|
+
const signature = createHash15("sha256").update(
|
|
4160
4196
|
JSON.stringify([phase, [...settingKeys].map((key2) => [key2, settings(key2)])])
|
|
4161
4197
|
);
|
|
4162
4198
|
for (const file of inputFiles) {
|
|
4163
4199
|
signature.update(file);
|
|
4164
|
-
if (
|
|
4165
|
-
const stat =
|
|
4200
|
+
if (fs16.existsSync(file)) {
|
|
4201
|
+
const stat = fs16.statSync(file);
|
|
4166
4202
|
signature.update(`${stat.mtimeMs}:${stat.ctimeMs}:${stat.size}`);
|
|
4167
4203
|
} else signature.update("missing");
|
|
4168
4204
|
}
|
|
4169
4205
|
const stamp = signature.digest("hex");
|
|
4170
4206
|
const key = `${project.projectFile}:${targetId}:${phaseId}:${settings("CONFIGURATION")}`;
|
|
4171
|
-
if (preparedSourcePhases.get(key) === stamp && allOutputs.every((file) =>
|
|
4207
|
+
if (preparedSourcePhases.get(key) === stamp && allOutputs.every((file) => fs16.existsSync(file))) {
|
|
4172
4208
|
preparedXcodePhase(
|
|
4173
4209
|
project.projectFile,
|
|
4174
4210
|
targetId,
|
|
@@ -4179,14 +4215,14 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
4179
4215
|
);
|
|
4180
4216
|
continue;
|
|
4181
4217
|
}
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4218
|
+
fs16.mkdirSync(phaseDir, { recursive: true });
|
|
4219
|
+
fs16.mkdirSync(settings("BUILT_PRODUCTS_DIR"), { recursive: true });
|
|
4220
|
+
fs16.mkdirSync(settings("DERIVED_FILE_DIR"), { recursive: true });
|
|
4185
4221
|
for (const output2 of allOutputs)
|
|
4186
|
-
|
|
4222
|
+
fs16.mkdirSync(path30.dirname(output2), { recursive: true });
|
|
4187
4223
|
for (const [kind, lists] of fileLists)
|
|
4188
4224
|
lists.forEach((item, index) => {
|
|
4189
|
-
|
|
4225
|
+
fs16.writeFileSync(
|
|
4190
4226
|
env[`SCRIPT_${kind}_FILE_LIST_${index}`],
|
|
4191
4227
|
`${item.entries.join("\n")}
|
|
4192
4228
|
`
|
|
@@ -4213,7 +4249,7 @@ ${output2}`
|
|
|
4213
4249
|
);
|
|
4214
4250
|
}
|
|
4215
4251
|
const missing = allOutputs.filter(
|
|
4216
|
-
(file) => file === infoPlistOutput && !
|
|
4252
|
+
(file) => file === infoPlistOutput && !fs16.existsSync(file)
|
|
4217
4253
|
);
|
|
4218
4254
|
if (missing.length > 0)
|
|
4219
4255
|
throw new Error(
|
|
@@ -4233,8 +4269,8 @@ ${output2}`
|
|
|
4233
4269
|
project.visitMembers(
|
|
4234
4270
|
targetId,
|
|
4235
4271
|
project.resolvePath,
|
|
4236
|
-
(file) => isDirectory(file) ? walkFiles(file) :
|
|
4237
|
-
|
|
4272
|
+
(file) => isDirectory(file) ? walkFiles(file) : fs16.existsSync(file) ? [file] : [],
|
|
4273
|
+
path30.join,
|
|
4238
4274
|
(file, kind) => {
|
|
4239
4275
|
if (kind === "header") {
|
|
4240
4276
|
headers.add(file);
|
|
@@ -4244,9 +4280,9 @@ ${output2}`
|
|
|
4244
4280
|
resources.add(file);
|
|
4245
4281
|
return;
|
|
4246
4282
|
}
|
|
4247
|
-
if (!
|
|
4283
|
+
if (!fs16.existsSync(file)) {
|
|
4248
4284
|
if (options.requireSources === false) return;
|
|
4249
|
-
const script = scriptForOutput.get(
|
|
4285
|
+
const script = scriptForOutput.get(path30.normalize(file));
|
|
4250
4286
|
throw new Error(
|
|
4251
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}`
|
|
4252
4288
|
);
|
|
@@ -4267,37 +4303,37 @@ ${output2}`
|
|
|
4267
4303
|
function commonAncestor(dirs) {
|
|
4268
4304
|
let common = dirs[0];
|
|
4269
4305
|
for (const dir of dirs) {
|
|
4270
|
-
while (common !==
|
|
4271
|
-
common =
|
|
4306
|
+
while (common !== path30.dirname(common) && path30.relative(common, dir).startsWith(".."))
|
|
4307
|
+
common = path30.dirname(common);
|
|
4272
4308
|
}
|
|
4273
4309
|
return common;
|
|
4274
4310
|
}
|
|
4275
|
-
var isPodsProject = (xcodeproj) =>
|
|
4311
|
+
var isPodsProject = (xcodeproj) => path30.basename(xcodeproj) === "Pods.xcodeproj" && path30.basename(path30.dirname(xcodeproj)) === "Pods";
|
|
4276
4312
|
function installedPodsSandbox(pods) {
|
|
4277
|
-
const podfileLock =
|
|
4278
|
-
const manifestLock =
|
|
4279
|
-
if (!
|
|
4313
|
+
const podfileLock = path30.join(path30.dirname(pods), "Podfile.lock");
|
|
4314
|
+
const manifestLock = path30.join(pods, "Manifest.lock");
|
|
4315
|
+
if (!fs16.existsSync(podfileLock))
|
|
4280
4316
|
throw new Error(
|
|
4281
|
-
`${pods} has no ${podfileLock}: run \`pod install\` in ${
|
|
4317
|
+
`${pods} has no ${podfileLock}: run \`pod install\` in ${path30.dirname(pods)}`
|
|
4282
4318
|
);
|
|
4283
|
-
if (!
|
|
4319
|
+
if (!fs16.existsSync(manifestLock) || !fs16.readFileSync(manifestLock).equals(fs16.readFileSync(podfileLock)))
|
|
4284
4320
|
throw new Error(
|
|
4285
|
-
`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)}`
|
|
4286
4322
|
);
|
|
4287
4323
|
const specChecksums = {};
|
|
4288
|
-
const lines =
|
|
4324
|
+
const lines = fs16.readFileSync(manifestLock, "utf8").split("\n");
|
|
4289
4325
|
const start = lines.indexOf("SPEC CHECKSUMS:");
|
|
4290
4326
|
for (const line of start === -1 ? [] : lines.slice(start + 1)) {
|
|
4291
4327
|
const entry = /^ {2}"?([^":]+)"?: ([0-9a-f]+)$/.exec(line);
|
|
4292
4328
|
if (!entry) break;
|
|
4293
4329
|
specChecksums[entry[1]] = entry[2];
|
|
4294
4330
|
}
|
|
4295
|
-
const specs =
|
|
4331
|
+
const specs = path30.join(pods, "Local Podspecs");
|
|
4296
4332
|
return {
|
|
4297
4333
|
podfileLock,
|
|
4298
4334
|
manifestLock,
|
|
4299
4335
|
specChecksums,
|
|
4300
|
-
localPodspecs: isDirectory(specs) ?
|
|
4336
|
+
localPodspecs: isDirectory(specs) ? fs16.readdirSync(specs).filter((name2) => name2.endsWith(".podspec.json")).sort().map((name2) => path30.join(specs, name2)) : []
|
|
4301
4337
|
};
|
|
4302
4338
|
}
|
|
4303
4339
|
function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
|
|
@@ -4309,14 +4345,14 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
|
|
|
4309
4345
|
if (!xcodeProjectFile(xcodeproj)) {
|
|
4310
4346
|
if (installedPods && isPodsProject(xcodeproj))
|
|
4311
4347
|
throw new Error(
|
|
4312
|
-
`${
|
|
4348
|
+
`${path30.basename(xcodeprojOrWorkspace)} builds ${xcodeproj}, which is not installed: run \`pod install\` in ${path30.dirname(path30.dirname(xcodeproj))}`
|
|
4313
4349
|
);
|
|
4314
4350
|
return;
|
|
4315
4351
|
}
|
|
4316
|
-
const key =
|
|
4317
|
-
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"))
|
|
4318
4354
|
return;
|
|
4319
|
-
if (isPodsProject(key)) cocoapods = installedPodsSandbox(
|
|
4355
|
+
if (isPodsProject(key)) cocoapods = installedPodsSandbox(path30.dirname(key));
|
|
4320
4356
|
const project = loadProject(key);
|
|
4321
4357
|
projectAt.set(key, project);
|
|
4322
4358
|
projects.push(project);
|
|
@@ -4332,12 +4368,12 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
|
|
|
4332
4368
|
for (const reference of listed)
|
|
4333
4369
|
if (reference.endsWith(".xcodeproj")) addProject(reference);
|
|
4334
4370
|
if (projects.length === 0) {
|
|
4335
|
-
throw new Error(`${
|
|
4371
|
+
throw new Error(`${path30.basename(xcodeprojOrWorkspace)} lists no Xcode project`);
|
|
4336
4372
|
}
|
|
4337
|
-
const podfile =
|
|
4338
|
-
if (installedPods && !cocoapods &&
|
|
4373
|
+
const podfile = path30.join(path30.dirname(xcodeprojOrWorkspace), "Podfile");
|
|
4374
|
+
if (installedPods && !cocoapods && fs16.existsSync(podfile))
|
|
4339
4375
|
throw new Error(
|
|
4340
|
-
`${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`
|
|
4341
4377
|
);
|
|
4342
4378
|
return { listed, projects, projectAt, cocoapods };
|
|
4343
4379
|
}
|
|
@@ -4373,7 +4409,7 @@ function listXcodeAppTargets(xcodeprojOrWorkspace, options = {}) {
|
|
|
4373
4409
|
return workspaceProjects(xcodeprojOrWorkspace).projects.flatMap(projectTargets).filter((ref) => isIosAppTarget(ref, options)).map((ref) => str(ref.target.name) ?? ref.id);
|
|
4374
4410
|
}
|
|
4375
4411
|
function defaultXcodeAppTarget(xcodeproj) {
|
|
4376
|
-
const project = loadProject(
|
|
4412
|
+
const project = loadProject(fs16.realpathSync(xcodeproj));
|
|
4377
4413
|
for (const [id, target] of Object.entries(project.objects)) {
|
|
4378
4414
|
if (!isDict(target) || target.isa !== "PBXNativeTarget") continue;
|
|
4379
4415
|
if (isIosAppTarget({ project, id, target }, { requireSources: false }))
|
|
@@ -4381,30 +4417,30 @@ function defaultXcodeAppTarget(xcodeproj) {
|
|
|
4381
4417
|
}
|
|
4382
4418
|
}
|
|
4383
4419
|
function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
4384
|
-
const container =
|
|
4420
|
+
const container = fs16.realpathSync(xcodeprojOrWorkspace);
|
|
4385
4421
|
const { projects } = workspaceProjects(container);
|
|
4386
4422
|
const containers = [
|
|
4387
4423
|
.../* @__PURE__ */ new Set([container, ...projects.map((project2) => project2.xcodeproj)])
|
|
4388
4424
|
];
|
|
4389
4425
|
const found = containers.flatMap(
|
|
4390
4426
|
(dir) => [
|
|
4391
|
-
|
|
4392
|
-
...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)) : []
|
|
4393
4429
|
].map((data) => ({
|
|
4394
4430
|
dir,
|
|
4395
|
-
file:
|
|
4431
|
+
file: path30.join(data, "xcschemes", `${scheme}.xcscheme`)
|
|
4396
4432
|
}))
|
|
4397
|
-
).find((candidate) =>
|
|
4433
|
+
).find((candidate) => fs16.existsSync(candidate.file));
|
|
4398
4434
|
if (!found) {
|
|
4399
4435
|
const known = containers.flatMap(
|
|
4400
|
-
(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() : []
|
|
4401
4437
|
);
|
|
4402
4438
|
throw new Error(
|
|
4403
|
-
`${
|
|
4439
|
+
`${path30.basename(container)} has no scheme ${scheme}; it shares ${known.join(", ") || "none"}`
|
|
4404
4440
|
);
|
|
4405
4441
|
}
|
|
4406
4442
|
const launch = /<LaunchAction\b([^>]*)>([\s\S]*?)<\/LaunchAction>/.exec(
|
|
4407
|
-
|
|
4443
|
+
fs16.readFileSync(found.file, "utf8")
|
|
4408
4444
|
);
|
|
4409
4445
|
const attribute = (text2, name3) => {
|
|
4410
4446
|
const value = new RegExp(`\\b${name3}\\s*=\\s*"([^"]*)"`).exec(text2)?.[1];
|
|
@@ -4417,12 +4453,12 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
|
4417
4453
|
if (!configuration || !blueprint || !referenced?.startsWith("container:")) {
|
|
4418
4454
|
throw new Error(`scheme ${scheme} runs no application target`);
|
|
4419
4455
|
}
|
|
4420
|
-
const projectPath =
|
|
4421
|
-
|
|
4456
|
+
const projectPath = path30.resolve(
|
|
4457
|
+
path30.dirname(found.dir),
|
|
4422
4458
|
referenced.slice("container:".length)
|
|
4423
4459
|
);
|
|
4424
4460
|
const project = projects.find(
|
|
4425
|
-
(candidate) =>
|
|
4461
|
+
(candidate) => fs16.existsSync(projectPath) && candidate.xcodeproj === fs16.realpathSync(projectPath)
|
|
4426
4462
|
);
|
|
4427
4463
|
const target = project && projectTargets(project).find((ref) => ref.id === blueprint);
|
|
4428
4464
|
const name2 = target && str(target.target.name);
|
|
@@ -4432,9 +4468,9 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
|
4432
4468
|
var NativeAppTargetSelectionError = class extends Error {
|
|
4433
4469
|
};
|
|
4434
4470
|
function selectIosAppTarget(projectRoot, iosTarget) {
|
|
4435
|
-
const nested =
|
|
4436
|
-
const iosRoot =
|
|
4437
|
-
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"));
|
|
4438
4474
|
if (projects.length === 0) return null;
|
|
4439
4475
|
if (projects.length > 1 && !iosTarget) {
|
|
4440
4476
|
throw new NativeAppTargetSelectionError(
|
|
@@ -4444,7 +4480,7 @@ function selectIosAppTarget(projectRoot, iosTarget) {
|
|
|
4444
4480
|
let project = projects[0];
|
|
4445
4481
|
if (iosTarget && projects.length > 1) {
|
|
4446
4482
|
const matches = projects.filter(
|
|
4447
|
-
(entry) => listXcodeAppTargets(
|
|
4483
|
+
(entry) => listXcodeAppTargets(path30.join(iosRoot, entry.name), {
|
|
4448
4484
|
requireSources: false
|
|
4449
4485
|
}).includes(iosTarget)
|
|
4450
4486
|
);
|
|
@@ -4456,19 +4492,19 @@ function selectIosAppTarget(projectRoot, iosTarget) {
|
|
|
4456
4492
|
);
|
|
4457
4493
|
project = matches[0];
|
|
4458
4494
|
}
|
|
4459
|
-
const xcodeproj =
|
|
4495
|
+
const xcodeproj = path30.join(iosRoot, project.name);
|
|
4460
4496
|
const appTargets = listXcodeAppTargets(xcodeproj, { requireSources: false });
|
|
4461
4497
|
let target = iosTarget ?? defaultXcodeAppTarget(xcodeproj);
|
|
4462
4498
|
if (!target) throw new Error("native app identity has no iOS application target");
|
|
4463
4499
|
if (!iosTarget) {
|
|
4464
4500
|
const workspace = xcodeproj.replace(/\.xcodeproj$/, ".xcworkspace");
|
|
4465
|
-
const container =
|
|
4501
|
+
const container = fs16.existsSync(workspace) ? workspace : xcodeproj;
|
|
4466
4502
|
const hasScheme = [container, xcodeproj].some((dir) => {
|
|
4467
|
-
if (
|
|
4503
|
+
if (fs16.existsSync(path30.join(dir, "xcshareddata", "xcschemes", `${target}.xcscheme`)))
|
|
4468
4504
|
return true;
|
|
4469
|
-
const users =
|
|
4470
|
-
return
|
|
4471
|
-
(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`))
|
|
4472
4508
|
);
|
|
4473
4509
|
});
|
|
4474
4510
|
if (hasScheme) target = readXcodeScheme(container, target).target;
|
|
@@ -4477,8 +4513,8 @@ function selectIosAppTarget(projectRoot, iosTarget) {
|
|
|
4477
4513
|
throw new Error(`native app identity has no application target ${target}`);
|
|
4478
4514
|
return { xcodeproj, target };
|
|
4479
4515
|
}
|
|
4480
|
-
var workspaceResolvedFile = (xcodeprojOrWorkspace) =>
|
|
4481
|
-
xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace :
|
|
4516
|
+
var workspaceResolvedFile = (xcodeprojOrWorkspace) => path30.join(
|
|
4517
|
+
xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : path30.join(xcodeprojOrWorkspace, "project.xcworkspace"),
|
|
4482
4518
|
"xcshareddata",
|
|
4483
4519
|
"swiftpm",
|
|
4484
4520
|
"Package.resolved"
|
|
@@ -4493,7 +4529,7 @@ var SwiftPackageResolutionRequired = class extends Error {
|
|
|
4493
4529
|
}
|
|
4494
4530
|
};
|
|
4495
4531
|
function readXcodeAppTarget(input, targetName, configurationName, options = {}) {
|
|
4496
|
-
const xcodeprojOrWorkspace =
|
|
4532
|
+
const xcodeprojOrWorkspace = fs16.realpathSync(input);
|
|
4497
4533
|
const workspace = xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : null;
|
|
4498
4534
|
const { listed, projects, projectAt, cocoapods } = workspaceProjects(
|
|
4499
4535
|
xcodeprojOrWorkspace,
|
|
@@ -4502,7 +4538,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4502
4538
|
const allTargets = projects.flatMap(projectTargets);
|
|
4503
4539
|
const appTargets = allTargets.filter((ref) => isIosAppTarget(ref, options));
|
|
4504
4540
|
const appTargetNames = appTargets.map((ref) => str(ref.target.name) ?? ref.id);
|
|
4505
|
-
const container =
|
|
4541
|
+
const container = path30.basename(xcodeprojOrWorkspace);
|
|
4506
4542
|
const named = targetName ? appTargets.filter((ref) => ref.target.name === targetName) : appTargets;
|
|
4507
4543
|
if (named.length !== 1) {
|
|
4508
4544
|
if (appTargets.length === 0)
|
|
@@ -4523,15 +4559,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4523
4559
|
for (const ref of allTargets) {
|
|
4524
4560
|
const product = ref.project.object(str(ref.target.productReference));
|
|
4525
4561
|
const file = str(product?.path);
|
|
4526
|
-
if (file && !byProduct.has(
|
|
4527
|
-
byProduct.set(
|
|
4562
|
+
if (file && !byProduct.has(path30.basename(file)))
|
|
4563
|
+
byProduct.set(path30.basename(file), ref);
|
|
4528
4564
|
}
|
|
4529
4565
|
const proxied = (project, proxyId) => {
|
|
4530
4566
|
const proxy = project.object(proxyId);
|
|
4531
4567
|
if (proxy?.isa !== "PBXContainerItemProxy") return void 0;
|
|
4532
4568
|
const portal = str(proxy.containerPortal);
|
|
4533
4569
|
const portalPath = project.resolvePath(portal ?? "");
|
|
4534
|
-
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;
|
|
4535
4571
|
const remote = str(proxy.remoteGlobalIDString);
|
|
4536
4572
|
if (!owner || !remote) return void 0;
|
|
4537
4573
|
return projectTargets(owner).find(
|
|
@@ -4555,7 +4591,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4555
4591
|
const buildFile = project.object(buildFileId);
|
|
4556
4592
|
if (!buildFile || !xcodeBuildFileBuildsForIos(buildFile)) continue;
|
|
4557
4593
|
const file = project.object(str(buildFile.fileRef));
|
|
4558
|
-
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;
|
|
4559
4595
|
if (resolved) found.push(resolved);
|
|
4560
4596
|
}
|
|
4561
4597
|
}
|
|
@@ -4612,8 +4648,8 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4612
4648
|
ref.project.visitMembers(
|
|
4613
4649
|
ref.id,
|
|
4614
4650
|
ref.project.resolvePath,
|
|
4615
|
-
(file) => isDirectory(file) ? walkFiles(file) :
|
|
4616
|
-
|
|
4651
|
+
(file) => isDirectory(file) ? walkFiles(file) : fs16.existsSync(file) ? [file] : [],
|
|
4652
|
+
path30.join,
|
|
4617
4653
|
(file, kind) => {
|
|
4618
4654
|
if (kind === "header") found.push(file);
|
|
4619
4655
|
}
|
|
@@ -4629,12 +4665,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4629
4665
|
for (const ref of projectTargets(project)) {
|
|
4630
4666
|
const product = productName(ref);
|
|
4631
4667
|
for (const { file, visibility } of headerPhase(ref)) {
|
|
4632
|
-
const name2 =
|
|
4668
|
+
const name2 = path30.basename(file);
|
|
4633
4669
|
if (!entries.has(name2))
|
|
4634
4670
|
entries.set(name2, visibility !== "Project" ? `${product}/${name2}` : file);
|
|
4635
4671
|
}
|
|
4636
4672
|
for (const file of synchronizedHeaders(ref)) {
|
|
4637
|
-
const name2 =
|
|
4673
|
+
const name2 = path30.basename(file);
|
|
4638
4674
|
if (!entries.has(name2)) entries.set(name2, file);
|
|
4639
4675
|
}
|
|
4640
4676
|
}
|
|
@@ -4644,7 +4680,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4644
4680
|
if (folder === null) continue;
|
|
4645
4681
|
for (const file of walkFiles(folder)) {
|
|
4646
4682
|
if (!HEADER_FILE.test(file)) continue;
|
|
4647
|
-
const name2 =
|
|
4683
|
+
const name2 = path30.basename(file);
|
|
4648
4684
|
if (!entries.has(name2)) entries.set(name2, file);
|
|
4649
4685
|
}
|
|
4650
4686
|
}
|
|
@@ -4652,18 +4688,18 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4652
4688
|
for (const id of Object.keys(project.objects)) {
|
|
4653
4689
|
if (project.object(id)?.isa !== "PBXFileReference") continue;
|
|
4654
4690
|
const file = project.resolvePath(id);
|
|
4655
|
-
if (file && HEADER_FILE.test(file) && !entries.has(
|
|
4656
|
-
entries.set(
|
|
4691
|
+
if (file && HEADER_FILE.test(file) && !entries.has(path30.basename(file)))
|
|
4692
|
+
entries.set(path30.basename(file), file);
|
|
4657
4693
|
}
|
|
4658
4694
|
const map = [...entries];
|
|
4659
4695
|
projectHeaderMaps.set(project, map);
|
|
4660
4696
|
return map;
|
|
4661
4697
|
};
|
|
4662
4698
|
const xcconfigs = /* @__PURE__ */ new Set();
|
|
4663
|
-
const buildDir = (project) =>
|
|
4699
|
+
const buildDir = (project) => path30.join(project.projectDir, ".build/peach-xcode/Build");
|
|
4664
4700
|
const workspaceBuild = {
|
|
4665
|
-
SYMROOT:
|
|
4666
|
-
OBJROOT:
|
|
4701
|
+
SYMROOT: path30.join(buildDir(app.project), "Products"),
|
|
4702
|
+
OBJROOT: path30.join(buildDir(app.project), "Intermediates.noindex")
|
|
4667
4703
|
};
|
|
4668
4704
|
const moduleTarget = (ref) => {
|
|
4669
4705
|
const name2 = str(ref.target.name) ?? ref.id;
|
|
@@ -4678,15 +4714,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4678
4714
|
TARGET_NAME: name2,
|
|
4679
4715
|
TARGETNAME: "$(TARGET_NAME)",
|
|
4680
4716
|
PROJECT: "$(PROJECT_NAME)",
|
|
4681
|
-
PROJECT_NAME:
|
|
4717
|
+
PROJECT_NAME: path30.basename(ref.project.xcodeproj, ".xcodeproj"),
|
|
4682
4718
|
PROJECT_FILE_PATH: ref.project.xcodeproj,
|
|
4683
4719
|
SRCROOT: ref.project.projectDir,
|
|
4684
4720
|
SOURCE_ROOT: ref.project.projectDir,
|
|
4685
4721
|
PROJECT_DIR: ref.project.projectDir,
|
|
4686
|
-
SYMROOT:
|
|
4722
|
+
SYMROOT: path30.join(buildDir(ref.project), "Products"),
|
|
4687
4723
|
BUILD_DIR: "$(SYMROOT)",
|
|
4688
4724
|
BUILD_ROOT: "$(SYMROOT)",
|
|
4689
|
-
OBJROOT:
|
|
4725
|
+
OBJROOT: path30.join(buildDir(ref.project), "Intermediates.noindex"),
|
|
4690
4726
|
CONFIGURATION_BUILD_DIR: "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)",
|
|
4691
4727
|
BUILT_PRODUCTS_DIR: "$(CONFIGURATION_BUILD_DIR)",
|
|
4692
4728
|
TARGET_BUILD_DIR: "$(CONFIGURATION_BUILD_DIR)",
|
|
@@ -4728,7 +4764,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4728
4764
|
xcconfigs
|
|
4729
4765
|
);
|
|
4730
4766
|
const searchRules = recursiveSearchRules(settings2);
|
|
4731
|
-
const absolute = (file) =>
|
|
4767
|
+
const absolute = (file) => path30.resolve(ref.project.projectDir, file);
|
|
4732
4768
|
const framework = FRAMEWORK_PRODUCTS.has(str(ref.target.productType) ?? "");
|
|
4733
4769
|
const product = settings2("PRODUCT_NAME");
|
|
4734
4770
|
const moduleName = applyOperator(settings2("PRODUCT_MODULE_NAME"), "c99extidentifier");
|
|
@@ -4759,7 +4795,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4759
4795
|
`${name2}: Swift compatibility header phase has no Swift producer sources`
|
|
4760
4796
|
);
|
|
4761
4797
|
const building = options.prepareGeneratedSources && options.requireSources !== false;
|
|
4762
|
-
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;
|
|
4763
4799
|
if (versioning) {
|
|
4764
4800
|
const version = settings2("CURRENT_PROJECT_VERSION");
|
|
4765
4801
|
const custom = [
|
|
@@ -4772,7 +4808,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4772
4808
|
].filter((key) => settings2(key));
|
|
4773
4809
|
if (custom.length)
|
|
4774
4810
|
throw new Error(
|
|
4775
|
-
`${name2}: Xcode generates ${
|
|
4811
|
+
`${name2}: Xcode generates ${path30.basename(versioning)} with ${custom.join(", ")}; peach does not model VERSION_INFO_* overrides`
|
|
4776
4812
|
);
|
|
4777
4813
|
const symbol = product.replace(/^[^A-Za-z_]/, "_").replace(/[^A-Za-z0-9_]/g, "_");
|
|
4778
4814
|
const [major, minor] = version.split(".");
|
|
@@ -4785,9 +4821,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4785
4821
|
` const double ${symbol}VersionNumber __attribute__ ((used)) = (double)${number};`,
|
|
4786
4822
|
""
|
|
4787
4823
|
].join("\n");
|
|
4788
|
-
if (!
|
|
4789
|
-
|
|
4790
|
-
|
|
4824
|
+
if (!fs16.existsSync(versioning) || fs16.readFileSync(versioning, "utf8") !== unit) {
|
|
4825
|
+
fs16.mkdirSync(path30.dirname(versioning), { recursive: true });
|
|
4826
|
+
fs16.writeFileSync(versioning, unit);
|
|
4791
4827
|
}
|
|
4792
4828
|
allSources.push(versioning);
|
|
4793
4829
|
}
|
|
@@ -4806,7 +4842,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4806
4842
|
const headerFiles = headerPhase(ref);
|
|
4807
4843
|
const ownHeaders = /* @__PURE__ */ new Map();
|
|
4808
4844
|
for (const { file, visibility } of headerFiles) {
|
|
4809
|
-
const name3 =
|
|
4845
|
+
const name3 = path30.basename(file);
|
|
4810
4846
|
const published = visibility !== "Project";
|
|
4811
4847
|
if (!ownHeaders.has(name3))
|
|
4812
4848
|
ownHeaders.set(name3, published ? `${product}/${name3}` : file);
|
|
@@ -4814,7 +4850,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4814
4850
|
ownHeaders.set(`${product}/${name3}`, file);
|
|
4815
4851
|
}
|
|
4816
4852
|
for (const file of synchronizedHeaders(ref)) {
|
|
4817
|
-
const name3 =
|
|
4853
|
+
const name3 = path30.basename(file);
|
|
4818
4854
|
if (ownHeaders.has(name3)) continue;
|
|
4819
4855
|
ownHeaders.set(name3, file);
|
|
4820
4856
|
const qualified = `${product}/${name3}`;
|
|
@@ -4826,24 +4862,24 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4826
4862
|
const otherProduct = productName(other);
|
|
4827
4863
|
for (const { file, visibility } of headerPhase(other)) {
|
|
4828
4864
|
if (visibility === "Project") continue;
|
|
4829
|
-
const key = `${otherProduct}/${
|
|
4865
|
+
const key = `${otherProduct}/${path30.basename(file)}`;
|
|
4830
4866
|
if (!nonFrameworkHeaders.has(key)) nonFrameworkHeaders.set(key, file);
|
|
4831
4867
|
}
|
|
4832
4868
|
}
|
|
4833
|
-
const wrapper =
|
|
4869
|
+
const wrapper = path30.join(settings2("BUILT_PRODUCTS_DIR"), `${product}.framework`);
|
|
4834
4870
|
const moduleMap = (settings2("DEFINES_MODULE") === "YES" || !framework) && settings2("MODULEMAP_FILE") ? absolute(settings2("MODULEMAP_FILE")) : null;
|
|
4835
|
-
const frameworkUmbrella = !compatibility && framework && members.sources.length > 0 && moduleMap ?
|
|
4836
|
-
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) ? {
|
|
4837
4873
|
framework: true,
|
|
4838
4874
|
moduleMap,
|
|
4839
4875
|
umbrella: frameworkUmbrella,
|
|
4840
|
-
outputModuleMap:
|
|
4841
|
-
outputUmbrella:
|
|
4876
|
+
outputModuleMap: path30.join(wrapper, "Modules", "module.modulemap"),
|
|
4877
|
+
outputUmbrella: path30.join(
|
|
4842
4878
|
wrapper,
|
|
4843
4879
|
"Headers",
|
|
4844
|
-
|
|
4880
|
+
path30.basename(frameworkUmbrella)
|
|
4845
4881
|
),
|
|
4846
|
-
outputHeader:
|
|
4882
|
+
outputHeader: path30.join(
|
|
4847
4883
|
wrapper,
|
|
4848
4884
|
"Headers",
|
|
4849
4885
|
settings2("SWIFT_OBJC_INTERFACE_HEADER_NAME") || `${moduleName}-Swift.h`
|
|
@@ -4857,10 +4893,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4857
4893
|
outputUmbrella: compatibility.outputUmbrella,
|
|
4858
4894
|
outputHeader: compatibility.outputHeader
|
|
4859
4895
|
} : frameworkCompatibility;
|
|
4860
|
-
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) => {
|
|
4861
4897
|
if (!/\.(h|hh|hpp|hxx|modulemap)$/.test(entry)) return [];
|
|
4862
|
-
const file =
|
|
4863
|
-
return
|
|
4898
|
+
const file = path30.join(path30.dirname(moduleMap), entry);
|
|
4899
|
+
return fs16.existsSync(file) ? [file] : [];
|
|
4864
4900
|
}) : [];
|
|
4865
4901
|
const fileFlags = {};
|
|
4866
4902
|
for (const phaseId of list(ref.target.buildPhases)) {
|
|
@@ -4932,15 +4968,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4932
4968
|
// xcode searches its products' include directory before
|
|
4933
4969
|
// HEADER_SEARCH_PATHS and the target's derived sources after.
|
|
4934
4970
|
headerSearchPaths: [
|
|
4935
|
-
|
|
4971
|
+
path30.join(settings2("BUILT_PRODUCTS_DIR"), "include"),
|
|
4936
4972
|
...settingList(settings2("HEADER_SEARCH_PATHS")).flatMap(
|
|
4937
4973
|
(raw) => expandSearchPath(absolute(raw), searchRules)
|
|
4938
4974
|
),
|
|
4939
|
-
|
|
4975
|
+
path30.join(
|
|
4940
4976
|
`${settings2("DERIVED_FILE_DIR")}-normal`,
|
|
4941
4977
|
settings2("CURRENT_ARCH")
|
|
4942
4978
|
),
|
|
4943
|
-
|
|
4979
|
+
path30.join(settings2("DERIVED_FILE_DIR"), settings2("CURRENT_ARCH")),
|
|
4944
4980
|
settings2("DERIVED_FILE_DIR")
|
|
4945
4981
|
],
|
|
4946
4982
|
userHeaderSearchPaths: settingList(
|
|
@@ -4990,10 +5026,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
4990
5026
|
...headerFiles.flatMap(
|
|
4991
5027
|
({ file, visibility }) => visibility === "Project" ? [] : [
|
|
4992
5028
|
[
|
|
4993
|
-
|
|
5029
|
+
path30.join(
|
|
4994
5030
|
wrapper,
|
|
4995
5031
|
visibility === "Public" ? "Headers" : "PrivateHeaders",
|
|
4996
|
-
|
|
5032
|
+
path30.basename(file)
|
|
4997
5033
|
),
|
|
4998
5034
|
file
|
|
4999
5035
|
]
|
|
@@ -5007,7 +5043,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5007
5043
|
return [];
|
|
5008
5044
|
const destination = expand(
|
|
5009
5045
|
str(phase.dstPath) ?? "",
|
|
5010
|
-
(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)
|
|
5011
5047
|
);
|
|
5012
5048
|
return list(phase.files).flatMap((id) => {
|
|
5013
5049
|
const file = ref.project.resolvePath(
|
|
@@ -5015,17 +5051,17 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5015
5051
|
);
|
|
5016
5052
|
return file && HEADER_FILE.test(file) ? [
|
|
5017
5053
|
[
|
|
5018
|
-
|
|
5054
|
+
path30.resolve(
|
|
5019
5055
|
settings2("BUILT_PRODUCTS_DIR"),
|
|
5020
5056
|
destination,
|
|
5021
|
-
|
|
5057
|
+
path30.basename(file)
|
|
5022
5058
|
),
|
|
5023
5059
|
file
|
|
5024
5060
|
]
|
|
5025
5061
|
] : [];
|
|
5026
5062
|
});
|
|
5027
5063
|
}),
|
|
5028
|
-
...moduleMap ? [[
|
|
5064
|
+
...moduleMap ? [[path30.join(wrapper, "Modules", "module.modulemap"), moduleMap]] : []
|
|
5029
5065
|
]) : Object.fromEntries([
|
|
5030
5066
|
...podHeaders.map((file) => [file, file]),
|
|
5031
5067
|
...moduleMap ? [[moduleMap, moduleMap]] : []
|
|
@@ -5057,7 +5093,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5057
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 }));
|
|
5058
5094
|
const frameworks = frameworkTargets.map(({ framework }) => framework);
|
|
5059
5095
|
const podSourceDirs = builtTargets.slice(0, -1).flatMap(
|
|
5060
|
-
({ 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)) : []
|
|
5061
5097
|
);
|
|
5062
5098
|
const expandValue = (value, settings2) => {
|
|
5063
5099
|
if (typeof value === "string") return expand(value, settings2);
|
|
@@ -5078,7 +5114,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5078
5114
|
const phase = owner.ref.project.object(phaseId);
|
|
5079
5115
|
if (phase?.isa !== "PBXShellScriptBuildPhase" || str(phase.name) !== "[CP] Copy Pods Resources")
|
|
5080
5116
|
continue;
|
|
5081
|
-
const absolute = (raw) =>
|
|
5117
|
+
const absolute = (raw) => path30.resolve(owner.ref.project.projectDir, expand(raw, owner.settings));
|
|
5082
5118
|
const entries = (paths) => paths.flatMap((raw) => {
|
|
5083
5119
|
const file = absolute(raw);
|
|
5084
5120
|
xcconfigs.add(file);
|
|
@@ -5094,7 +5130,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5094
5130
|
].filter((file) => file.endsWith(".bundle"));
|
|
5095
5131
|
if (inputs.length !== outputs.length)
|
|
5096
5132
|
throw new Error(`${owner.module.name}: resource bundle copy lists differ`);
|
|
5097
|
-
const destinationRoot =
|
|
5133
|
+
const destinationRoot = path30.join(
|
|
5098
5134
|
owner.settings("TARGET_BUILD_DIR"),
|
|
5099
5135
|
owner.settings("UNLOCALIZED_RESOURCES_FOLDER_PATH")
|
|
5100
5136
|
);
|
|
@@ -5103,24 +5139,24 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5103
5139
|
const file = str(
|
|
5104
5140
|
target.ref.project.object(str(target.ref.target.productReference))?.path
|
|
5105
5141
|
);
|
|
5106
|
-
return file &&
|
|
5142
|
+
return file && path30.join(target.settings("TARGET_BUILD_DIR"), file) === input2;
|
|
5107
5143
|
});
|
|
5108
5144
|
if (!product && !isDirectory(input2))
|
|
5109
5145
|
throw new Error(
|
|
5110
5146
|
`${owner.module.name}: resource bundle input has no selected producer: ${input2}`
|
|
5111
5147
|
);
|
|
5112
|
-
const destination =
|
|
5113
|
-
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))
|
|
5114
5150
|
throw new Error(
|
|
5115
5151
|
`${owner.module.name}: invalid resource bundle copy destination`
|
|
5116
5152
|
);
|
|
5117
|
-
const infoFile = product ?
|
|
5153
|
+
const infoFile = product ? path30.resolve(
|
|
5118
5154
|
product.ref.project.projectDir,
|
|
5119
5155
|
product.settings("INFOPLIST_FILE")
|
|
5120
5156
|
) : null;
|
|
5121
5157
|
if (infoFile) xcconfigs.add(infoFile);
|
|
5122
5158
|
const prefix = owner.ref === app ? "" : `Frameworks/${owner.module.moduleName}.framework/`;
|
|
5123
|
-
const bundlePath = prefix + destination.split(
|
|
5159
|
+
const bundlePath = prefix + destination.split(path30.sep).join("/");
|
|
5124
5160
|
if (resourceProducts.some((resource) => resource.path === bundlePath))
|
|
5125
5161
|
throw new Error(
|
|
5126
5162
|
`${owner.module.name}: duplicate resource bundle destination ${bundlePath}`
|
|
@@ -5131,21 +5167,21 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5131
5167
|
resources: product.module.resources,
|
|
5132
5168
|
infoPlist: plist2.build(
|
|
5133
5169
|
expandValue(
|
|
5134
|
-
plist2.parse(
|
|
5170
|
+
plist2.parse(fs16.readFileSync(infoFile, "utf8")),
|
|
5135
5171
|
product.settings
|
|
5136
5172
|
)
|
|
5137
5173
|
)
|
|
5138
5174
|
} : {
|
|
5139
|
-
resources:
|
|
5175
|
+
resources: fs16.readdirSync(input2, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => path30.join(entry.parentPath, entry.name)).sort(),
|
|
5140
5176
|
sourceRoot: input2
|
|
5141
5177
|
}
|
|
5142
5178
|
});
|
|
5143
5179
|
}
|
|
5144
5180
|
}
|
|
5145
5181
|
}
|
|
5146
|
-
const infoPlistFile = settings("INFOPLIST_FILE") ?
|
|
5182
|
+
const infoPlistFile = settings("INFOPLIST_FILE") ? path30.resolve(app.project.projectDir, settings("INFOPLIST_FILE")) : null;
|
|
5147
5183
|
const infoPlistPending = module.generatedInfoPlist && !options.prepareGeneratedSources;
|
|
5148
|
-
const sourceInfo = infoPlistFile && !infoPlistPending ? plist2.parse(
|
|
5184
|
+
const sourceInfo = infoPlistFile && !infoPlistPending ? plist2.parse(fs16.readFileSync(infoPlistFile, "utf8")) : {};
|
|
5149
5185
|
if (!sourceInfo || typeof sourceInfo !== "object" || Array.isArray(sourceInfo) || sourceInfo instanceof Date || Buffer.isBuffer(sourceInfo)) {
|
|
5150
5186
|
throw new Error(`${module.name} Info.plist must contain a dictionary`);
|
|
5151
5187
|
}
|
|
@@ -5191,7 +5227,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5191
5227
|
};
|
|
5192
5228
|
}
|
|
5193
5229
|
const localPackageDirs = [
|
|
5194
|
-
...listed.filter((reference) =>
|
|
5230
|
+
...listed.filter((reference) => fs16.existsSync(path30.join(reference, "Package.swift"))),
|
|
5195
5231
|
...projects.flatMap(
|
|
5196
5232
|
(project) => Object.entries(project.objects).flatMap(([id, entry]) => {
|
|
5197
5233
|
if (!isDict(entry)) return [];
|
|
@@ -5201,19 +5237,19 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5201
5237
|
const packages = [];
|
|
5202
5238
|
while (pending.length > 0) {
|
|
5203
5239
|
const dir = pending.pop();
|
|
5204
|
-
if (
|
|
5240
|
+
if (fs16.existsSync(path30.join(dir, "Package.swift"))) {
|
|
5205
5241
|
packages.push(dir);
|
|
5206
5242
|
continue;
|
|
5207
5243
|
}
|
|
5208
5244
|
if (!isDirectory(dir)) continue;
|
|
5209
|
-
for (const child of
|
|
5245
|
+
for (const child of fs16.readdirSync(dir, { withFileTypes: true }))
|
|
5210
5246
|
if (child.isDirectory() && !child.name.startsWith("."))
|
|
5211
|
-
pending.push(
|
|
5247
|
+
pending.push(path30.join(dir, child.name));
|
|
5212
5248
|
}
|
|
5213
5249
|
return packages;
|
|
5214
5250
|
}
|
|
5215
|
-
const candidate = entry.isa === "XCLocalSwiftPackageReference" ?
|
|
5216
|
-
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] : [];
|
|
5217
5253
|
})
|
|
5218
5254
|
)
|
|
5219
5255
|
];
|
|
@@ -5236,7 +5272,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5236
5272
|
const searchedFrameworks = /* @__PURE__ */ new Map();
|
|
5237
5273
|
const frameworkSearchDirectories = /* @__PURE__ */ new Set();
|
|
5238
5274
|
for (const { ref, settings: settings2 } of builtTargets) {
|
|
5239
|
-
const absolute = (raw) =>
|
|
5275
|
+
const absolute = (raw) => path30.resolve(ref.project.projectDir, expand(raw, settings2));
|
|
5240
5276
|
const requested = options.nativeModules;
|
|
5241
5277
|
const includeBinary = (name2, dir) => {
|
|
5242
5278
|
if (!requested || nativeTargets.has(ref) || requested.includes(name2) || dir.endsWith(".xcframework") && localSwiftBinaryModules(dir).some((module2) => requested.includes(module2)))
|
|
@@ -5248,14 +5284,14 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5248
5284
|
for (const directory of expandSearchPath(absolute(raw), searchRules)) {
|
|
5249
5285
|
if (frameworkSearchDirectories.has(directory)) continue;
|
|
5250
5286
|
frameworkSearchDirectories.add(directory);
|
|
5251
|
-
if (!
|
|
5287
|
+
if (!fs16.statSync(directory, { throwIfNoEntry: false })?.isDirectory() || /\.sdk\/(?:System|Developer)\/Library\/Frameworks\/?$/.test(directory))
|
|
5252
5288
|
continue;
|
|
5253
|
-
for (const entry of
|
|
5289
|
+
for (const entry of fs16.readdirSync(directory, { withFileTypes: true })) {
|
|
5254
5290
|
const name2 = /^(.+)\.framework$/.exec(entry.name)?.[1];
|
|
5255
5291
|
if (!name2 || byProduct.has(entry.name) || searchedFrameworks.has(name2))
|
|
5256
5292
|
continue;
|
|
5257
|
-
const file =
|
|
5258
|
-
if (
|
|
5293
|
+
const file = path30.join(directory, entry.name);
|
|
5294
|
+
if (fs16.statSync(file, { throwIfNoEntry: false })?.isDirectory())
|
|
5259
5295
|
searchedFrameworks.set(name2, file);
|
|
5260
5296
|
}
|
|
5261
5297
|
}
|
|
@@ -5263,9 +5299,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5263
5299
|
}
|
|
5264
5300
|
for (const raw of settingList(settings2("SWIFT_INCLUDE_PATHS"))) {
|
|
5265
5301
|
const dir = absolute(raw);
|
|
5266
|
-
const modulemap =
|
|
5267
|
-
if (!
|
|
5268
|
-
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"));
|
|
5269
5305
|
if (name2 && !binaryFrameworks.has(name2)) includeBinary(name2, dir);
|
|
5270
5306
|
}
|
|
5271
5307
|
for (const phaseId of list(ref.target.buildPhases)) {
|
|
@@ -5274,7 +5310,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5274
5310
|
const inputs = list(phase.inputPaths).map(absolute);
|
|
5275
5311
|
for (const raw of list(phase.inputFileListPaths)) {
|
|
5276
5312
|
const file = absolute(raw);
|
|
5277
|
-
if (!
|
|
5313
|
+
if (!fs16.existsSync(file)) continue;
|
|
5278
5314
|
xcconfigs.add(file);
|
|
5279
5315
|
inputs.push(...fileListEntries(file, absolute));
|
|
5280
5316
|
}
|
|
@@ -5323,7 +5359,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5323
5359
|
product,
|
|
5324
5360
|
source: reference?.isa === "XCRemoteSwiftPackageReference" ? { kind: "remote", url: str(reference.repositoryURL) ?? "" } : reference?.isa === "XCLocalSwiftPackageReference" ? {
|
|
5325
5361
|
kind: "local",
|
|
5326
|
-
dir:
|
|
5362
|
+
dir: path30.resolve(
|
|
5327
5363
|
project.projectDir,
|
|
5328
5364
|
str(reference.relativePath) ?? ""
|
|
5329
5365
|
)
|
|
@@ -5356,10 +5392,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5356
5392
|
// however it is rooted: xcode links -framework <name> from the sdk
|
|
5357
5393
|
// and a stale group-relative path to it contributes nothing.
|
|
5358
5394
|
/\/System\/Library\/Frameworks\/[^/]+$/.test(`/${rawPath}`) || // a target in the workspace builds it, so it exists only after that build
|
|
5359
|
-
byProduct.has(
|
|
5395
|
+
byProduct.has(path30.basename(rawPath)))
|
|
5360
5396
|
continue;
|
|
5361
5397
|
const resolved = fileId ? project.resolvePath(fileId) : null;
|
|
5362
|
-
if (fileId && resolved !== null && !
|
|
5398
|
+
if (fileId && resolved !== null && !fs16.existsSync(resolved))
|
|
5363
5399
|
throw new Error(
|
|
5364
5400
|
`${str(target.name) ?? "target"}: linked framework ${name2} (${fileId}) points at missing ${resolved} in ${project.projectFile}`
|
|
5365
5401
|
);
|
|
@@ -5382,7 +5418,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5382
5418
|
({ product }) => !options.nativeModules || nativeTargets.has(built.ref) || options.nativeModules.includes(product)
|
|
5383
5419
|
);
|
|
5384
5420
|
const resolvedFile = workspaceResolvedFile(xcodeprojOrWorkspace);
|
|
5385
|
-
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();
|
|
5386
5422
|
if (packageResolved.length === 0) {
|
|
5387
5423
|
const requirements = remotePackageRequirements(projects);
|
|
5388
5424
|
if (requirements.length > 0) {
|
|
@@ -5408,14 +5444,14 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5408
5444
|
} : {},
|
|
5409
5445
|
rootDir: commonAncestor(
|
|
5410
5446
|
[
|
|
5411
|
-
workspace ?
|
|
5447
|
+
workspace ? path30.dirname(workspace) : app.project.projectDir,
|
|
5412
5448
|
...used.map((project) => project.projectDir),
|
|
5413
5449
|
...localPackageDirs,
|
|
5414
5450
|
...linkedProducts.flatMap(
|
|
5415
|
-
({ source }) => source.kind === "local" &&
|
|
5451
|
+
({ source }) => source.kind === "local" && fs16.existsSync(source.dir) ? [source.dir] : []
|
|
5416
5452
|
),
|
|
5417
5453
|
...new Set(podSourceDirs)
|
|
5418
|
-
].map((dir) =>
|
|
5454
|
+
].map((dir) => fs16.realpathSync(dir))
|
|
5419
5455
|
),
|
|
5420
5456
|
projectFiles: [
|
|
5421
5457
|
.../* @__PURE__ */ new Set([
|
|
@@ -5434,7 +5470,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
5434
5470
|
resourceProducts,
|
|
5435
5471
|
linkedProducts,
|
|
5436
5472
|
localPackageDirs: [
|
|
5437
|
-
...new Set(localPackageDirs.map((dir) =>
|
|
5473
|
+
...new Set(localPackageDirs.map((dir) => fs16.realpathSync(dir)))
|
|
5438
5474
|
].sort(),
|
|
5439
5475
|
binaryFrameworks: [...binaryFrameworks].map(([name2, file]) => ({ name: name2, path: file })).sort((left, right) => left.name.localeCompare(right.name)),
|
|
5440
5476
|
packageResolved,
|
|
@@ -5524,7 +5560,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
5524
5560
|
const rtcAppGroupIdentifier = nonEmptyString2(dictionary.RTCAppGroupIdentifier);
|
|
5525
5561
|
const screenShareExtensionBundleId = typeof dictionary.ScreenShareExtensionBundleId === "string" ? dictionary.ScreenShareExtensionBundleId : void 0;
|
|
5526
5562
|
const rootModuleName = readRootModuleName(
|
|
5527
|
-
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"))
|
|
5528
5564
|
);
|
|
5529
5565
|
return stampNativeBuildSdk({
|
|
5530
5566
|
applicationName,
|
|
@@ -5545,7 +5581,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
5545
5581
|
googleSignIn: readGoogleSignInConfiguration(
|
|
5546
5582
|
dictionary,
|
|
5547
5583
|
Object.fromEntries(
|
|
5548
|
-
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"))])
|
|
5549
5585
|
)
|
|
5550
5586
|
),
|
|
5551
5587
|
supportedInterfaceOrientations,
|
|
@@ -5554,11 +5590,11 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
5554
5590
|
alternateIconNames: [...alternateIconNames],
|
|
5555
5591
|
appIconArtwork: resolveNativeAppIconArtwork(
|
|
5556
5592
|
app.resources,
|
|
5557
|
-
(file) =>
|
|
5593
|
+
(file) => fs17.readFileSync(file, "utf8"),
|
|
5558
5594
|
(file) => {
|
|
5559
|
-
const extension =
|
|
5595
|
+
const extension = path31.extname(file).toLowerCase();
|
|
5560
5596
|
const contentType = extension === ".jpg" || extension === ".jpeg" ? "image/jpeg" : extension === ".webp" ? "image/webp" : "image/png";
|
|
5561
|
-
return `data:${contentType};base64,${
|
|
5597
|
+
return `data:${contentType};base64,${fs17.readFileSync(file).toString("base64")}`;
|
|
5562
5598
|
},
|
|
5563
5599
|
icons,
|
|
5564
5600
|
app.appIconName,
|
|
@@ -5587,23 +5623,23 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
|
|
|
5587
5623
|
const read = selectNativeAppIdentityReader(platform, {
|
|
5588
5624
|
android: () => null,
|
|
5589
5625
|
ios: () => {
|
|
5590
|
-
const nested =
|
|
5591
|
-
const iosRoot =
|
|
5626
|
+
const nested = path31.join(projectRoot, "ios");
|
|
5627
|
+
const iosRoot = fs17.existsSync(nested) ? nested : projectRoot;
|
|
5592
5628
|
const prefix = iosRoot === nested ? "ios/" : "";
|
|
5593
5629
|
const files = {};
|
|
5594
|
-
for (const entry of
|
|
5630
|
+
for (const entry of fs17.readdirSync(iosRoot, { withFileTypes: true })) {
|
|
5595
5631
|
if (entry.name === "Pods") continue;
|
|
5596
5632
|
if (entry.isDirectory()) {
|
|
5597
5633
|
const names = entry.name.endsWith(".xcodeproj") ? ["project.pbxproj"] : ["Info.plist", "AppDelegate.swift", "AppDelegate.mm", "AppDelegate.m"];
|
|
5598
5634
|
for (const name2 of names) {
|
|
5599
5635
|
const relative2 = `${prefix}${entry.name}/${name2}`;
|
|
5600
|
-
const file =
|
|
5601
|
-
if (
|
|
5636
|
+
const file = path31.join(projectRoot, relative2);
|
|
5637
|
+
if (fs17.existsSync(file)) files[relative2] = fs17.readFileSync(file, "utf8");
|
|
5602
5638
|
}
|
|
5603
5639
|
} else if (/AppDelegate\.(?:swift|mm|m)$/.test(entry.name)) {
|
|
5604
5640
|
const relative2 = `${prefix}${entry.name}`;
|
|
5605
|
-
const file =
|
|
5606
|
-
if (
|
|
5641
|
+
const file = path31.join(projectRoot, relative2);
|
|
5642
|
+
if (fs17.existsSync(file)) files[relative2] = fs17.readFileSync(file, "utf8");
|
|
5607
5643
|
}
|
|
5608
5644
|
}
|
|
5609
5645
|
const identity = extractNativeAppIdentityFromFiles(
|
|
@@ -5620,41 +5656,41 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
|
|
|
5620
5656
|
function readAndroidNativeAppIdentity(projectRoot, androidMergedManifest) {
|
|
5621
5657
|
const files = {};
|
|
5622
5658
|
if (androidMergedManifest) {
|
|
5623
|
-
const file =
|
|
5624
|
-
if (!
|
|
5625
|
-
files[androidMergedManifest] =
|
|
5659
|
+
const file = path31.resolve(projectRoot, androidMergedManifest);
|
|
5660
|
+
if (!fs17.existsSync(file)) return null;
|
|
5661
|
+
files[androidMergedManifest] = fs17.readFileSync(file, "utf8");
|
|
5626
5662
|
} else {
|
|
5627
|
-
const androidRoot =
|
|
5628
|
-
if (!
|
|
5663
|
+
const androidRoot = path31.join(projectRoot, "android");
|
|
5664
|
+
if (!fs17.existsSync(androidRoot)) return null;
|
|
5629
5665
|
const collect = (directory) => {
|
|
5630
|
-
for (const entry of
|
|
5631
|
-
const file =
|
|
5666
|
+
for (const entry of fs17.readdirSync(directory, { withFileTypes: true })) {
|
|
5667
|
+
const file = path31.join(directory, entry.name);
|
|
5632
5668
|
if (entry.isDirectory()) collect(file);
|
|
5633
5669
|
else if (entry.isFile() && entry.name === "AndroidManifest.xml")
|
|
5634
|
-
files[
|
|
5670
|
+
files[path31.relative(projectRoot, file).split(path31.sep).join("/")] = fs17.readFileSync(file, "utf8");
|
|
5635
5671
|
}
|
|
5636
5672
|
};
|
|
5637
|
-
for (const module of
|
|
5673
|
+
for (const module of fs17.readdirSync(androidRoot, { withFileTypes: true })) {
|
|
5638
5674
|
if (!module.isDirectory()) continue;
|
|
5639
|
-
const outputs =
|
|
5675
|
+
const outputs = path31.join(
|
|
5640
5676
|
androidRoot,
|
|
5641
5677
|
module.name,
|
|
5642
5678
|
"build/intermediates/merged_manifests"
|
|
5643
5679
|
);
|
|
5644
|
-
if (
|
|
5680
|
+
if (fs17.existsSync(outputs)) collect(outputs);
|
|
5645
5681
|
}
|
|
5646
5682
|
}
|
|
5647
5683
|
for (const manifest of Object.keys(files)) {
|
|
5648
5684
|
const resourceDirectory = androidMergedResourceValuesDirectory(manifest);
|
|
5649
5685
|
if (!resourceDirectory) continue;
|
|
5650
|
-
const absolute =
|
|
5651
|
-
if (!
|
|
5652
|
-
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 })) {
|
|
5653
5689
|
if (!entry.isDirectory() || !/^values(?:-|$)/.test(entry.name)) continue;
|
|
5654
|
-
for (const resource of
|
|
5690
|
+
for (const resource of fs17.readdirSync(path31.join(absolute, entry.name))) {
|
|
5655
5691
|
if (!resource.endsWith(".xml")) continue;
|
|
5656
5692
|
const file = `${resourceDirectory}/${entry.name}/${resource}`;
|
|
5657
|
-
files[file] =
|
|
5693
|
+
files[file] = fs17.readFileSync(path31.resolve(projectRoot, file), "utf8");
|
|
5658
5694
|
}
|
|
5659
5695
|
}
|
|
5660
5696
|
}
|
|
@@ -5671,7 +5707,7 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget, enviro
|
|
|
5671
5707
|
const app = readIosAppTarget(projectRoot, iosTarget, environment);
|
|
5672
5708
|
if (!app) return null;
|
|
5673
5709
|
const identity = readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist);
|
|
5674
|
-
const projectManifestPath =
|
|
5710
|
+
const projectManifestPath = path31.join(projectRoot, "package.json");
|
|
5675
5711
|
const projectRequire = createRequire(projectManifestPath);
|
|
5676
5712
|
let reanimatedManifestPath;
|
|
5677
5713
|
try {
|
|
@@ -5685,22 +5721,22 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget, enviro
|
|
|
5685
5721
|
throw error;
|
|
5686
5722
|
}
|
|
5687
5723
|
const installedManifest = JSON.parse(
|
|
5688
|
-
|
|
5724
|
+
fs17.readFileSync(reanimatedManifestPath, "utf8")
|
|
5689
5725
|
);
|
|
5690
5726
|
const installedVersion = isRecord(installedManifest) ? nonEmptyString2(installedManifest.version) : void 0;
|
|
5691
5727
|
if (!installedVersion) throw new Error("Reanimated package version is malformed");
|
|
5692
5728
|
if (Number.parseInt(installedVersion, 10) < 4) return identity;
|
|
5693
5729
|
const defaults = JSON.parse(
|
|
5694
|
-
|
|
5695
|
-
|
|
5696
|
-
|
|
5730
|
+
fs17.readFileSync(
|
|
5731
|
+
path31.join(
|
|
5732
|
+
path31.dirname(reanimatedManifestPath),
|
|
5697
5733
|
"src/featureFlags/staticFlags.json"
|
|
5698
5734
|
),
|
|
5699
5735
|
"utf8"
|
|
5700
5736
|
)
|
|
5701
5737
|
);
|
|
5702
5738
|
if (!isRecord(defaults)) throw new Error("Reanimated static flags are malformed");
|
|
5703
|
-
const manifest = JSON.parse(
|
|
5739
|
+
const manifest = JSON.parse(fs17.readFileSync(projectManifestPath, "utf8"));
|
|
5704
5740
|
const reanimated = isRecord(manifest) ? manifest.reanimated : void 0;
|
|
5705
5741
|
const overrides = isRecord(reanimated) ? reanimated.staticFeatureFlags : void 0;
|
|
5706
5742
|
if (overrides !== void 0 && !isRecord(overrides)) {
|