peachsim 0.1.2190 → 0.1.2191
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +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 +65 -132
- 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 +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +58 -130
- 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 +65 -132
- package/dist-lib/host/fetch-proxy-handler.cjs +4 -4
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +7 -5
- 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 +7 -2
- 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 +7 -5
- package/dist-lib/native-app-identity-project.cjs +6 -4
- package/dist-lib/native-app-identity-project.mjs +6 -4
- 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 +24 -24
- package/dist-lib/public-origins-lib.json +53 -53
- 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 +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +65 -132
- package/dist-lib/swift-compile.cjs +14 -117
- package/dist-lib/swift-compile.mjs +14 -117
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +57 -129
- package/dist-lib/vite.cjs +4 -4
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/node.d.ts +3 -0
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/src/kotlin-host.ts +6 -1
- package/src/swift-compile.ts +21 -114
- package/src/swift-host.ts +12 -8
- package/src/swift-interface-bodies.ts +7 -1
- package/src/swift-objc-standin.ts +46 -8
- package/src/swift-packages.ts +1 -0
- package/src/xcode-project.ts +6 -4
package/src/kotlin-host.ts
CHANGED
|
@@ -170,7 +170,7 @@ function entrySource(ids: string[]): string {
|
|
|
170
170
|
].join('\n')
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
const BUILD_FORMAT =
|
|
173
|
+
const BUILD_FORMAT = 20
|
|
174
174
|
const builds = new Map<string, Promise<KotlinArtifact>>()
|
|
175
175
|
|
|
176
176
|
function buildsDir(): string {
|
|
@@ -1342,6 +1342,7 @@ async function compileKotlin(
|
|
|
1342
1342
|
[
|
|
1343
1343
|
...common,
|
|
1344
1344
|
'-nowarn',
|
|
1345
|
+
'-Xpartial-linkage-loglevel=error',
|
|
1345
1346
|
`-Xinclude=${path.join(work, 'klib')}`,
|
|
1346
1347
|
'-Xir-produce-js',
|
|
1347
1348
|
'-ir-output-dir',
|
|
@@ -1449,6 +1450,10 @@ async function compileKotlin(
|
|
|
1449
1450
|
path.join(work, 'java-abi', `Spec${index}.kt`),
|
|
1450
1451
|
spec.file,
|
|
1451
1452
|
)
|
|
1453
|
+
output = output.replace(
|
|
1454
|
+
/^error: <app> @ (.+\.kt:\d+:\d+): (.*)$/gm,
|
|
1455
|
+
'$1: error: $2',
|
|
1456
|
+
)
|
|
1452
1457
|
throw new Error(
|
|
1453
1458
|
`kotlin compile failed:\n${output.trim() || (error instanceof Error ? error.message : String(error))}`,
|
|
1454
1459
|
)
|
package/src/swift-compile.ts
CHANGED
|
@@ -2255,6 +2255,11 @@ export function emitSwiftPackageManifest(args: {
|
|
|
2255
2255
|
...(!native?.clang && target.publicHeadersPath !== undefined
|
|
2256
2256
|
? [` publicHeadersPath: ${JSON.stringify(target.publicHeadersPath)},`]
|
|
2257
2257
|
: []),
|
|
2258
|
+
// swiftpm appends the root package's name after a target's own flags
|
|
2259
|
+
// unless the target opts out of package access
|
|
2260
|
+
...(!clang && target.swiftFlags?.includes('-package-name')
|
|
2261
|
+
? [' packageAccess: false,']
|
|
2262
|
+
: []),
|
|
2258
2263
|
// the native backend supplies dependency module maps without their
|
|
2259
2264
|
// compiled modules. textual c++ includes keep those dependencies usable.
|
|
2260
2265
|
` ${clang ? nativeSettings : swiftSettings}${link}`,
|
|
@@ -2733,117 +2738,6 @@ const FOUNDATION_OVERLAY_GLOBALS = new Set([
|
|
|
2733
2738
|
'NSFileErrorMinimum',
|
|
2734
2739
|
'NSFormattingErrorMaximum',
|
|
2735
2740
|
'NSFormattingErrorMinimum',
|
|
2736
|
-
'NSFoundationVersionNumber',
|
|
2737
|
-
'NSFoundationVersionNumber10_0',
|
|
2738
|
-
'NSFoundationVersionNumber10_1',
|
|
2739
|
-
'NSFoundationVersionNumber10_10',
|
|
2740
|
-
'NSFoundationVersionNumber10_10_1',
|
|
2741
|
-
'NSFoundationVersionNumber10_10_2',
|
|
2742
|
-
'NSFoundationVersionNumber10_10_3',
|
|
2743
|
-
'NSFoundationVersionNumber10_10_4',
|
|
2744
|
-
'NSFoundationVersionNumber10_10_5',
|
|
2745
|
-
'NSFoundationVersionNumber10_10_Max',
|
|
2746
|
-
'NSFoundationVersionNumber10_11',
|
|
2747
|
-
'NSFoundationVersionNumber10_11_1',
|
|
2748
|
-
'NSFoundationVersionNumber10_11_2',
|
|
2749
|
-
'NSFoundationVersionNumber10_11_3',
|
|
2750
|
-
'NSFoundationVersionNumber10_11_4',
|
|
2751
|
-
'NSFoundationVersionNumber10_11_Max',
|
|
2752
|
-
'NSFoundationVersionNumber10_1_1',
|
|
2753
|
-
'NSFoundationVersionNumber10_1_2',
|
|
2754
|
-
'NSFoundationVersionNumber10_1_3',
|
|
2755
|
-
'NSFoundationVersionNumber10_1_4',
|
|
2756
|
-
'NSFoundationVersionNumber10_2',
|
|
2757
|
-
'NSFoundationVersionNumber10_2_1',
|
|
2758
|
-
'NSFoundationVersionNumber10_2_2',
|
|
2759
|
-
'NSFoundationVersionNumber10_2_3',
|
|
2760
|
-
'NSFoundationVersionNumber10_2_4',
|
|
2761
|
-
'NSFoundationVersionNumber10_2_5',
|
|
2762
|
-
'NSFoundationVersionNumber10_2_6',
|
|
2763
|
-
'NSFoundationVersionNumber10_2_7',
|
|
2764
|
-
'NSFoundationVersionNumber10_2_8',
|
|
2765
|
-
'NSFoundationVersionNumber10_3',
|
|
2766
|
-
'NSFoundationVersionNumber10_3_1',
|
|
2767
|
-
'NSFoundationVersionNumber10_3_2',
|
|
2768
|
-
'NSFoundationVersionNumber10_3_3',
|
|
2769
|
-
'NSFoundationVersionNumber10_3_4',
|
|
2770
|
-
'NSFoundationVersionNumber10_3_5',
|
|
2771
|
-
'NSFoundationVersionNumber10_3_6',
|
|
2772
|
-
'NSFoundationVersionNumber10_3_7',
|
|
2773
|
-
'NSFoundationVersionNumber10_3_8',
|
|
2774
|
-
'NSFoundationVersionNumber10_3_9',
|
|
2775
|
-
'NSFoundationVersionNumber10_4',
|
|
2776
|
-
'NSFoundationVersionNumber10_4_1',
|
|
2777
|
-
'NSFoundationVersionNumber10_4_10',
|
|
2778
|
-
'NSFoundationVersionNumber10_4_11',
|
|
2779
|
-
'NSFoundationVersionNumber10_4_2',
|
|
2780
|
-
'NSFoundationVersionNumber10_4_3',
|
|
2781
|
-
'NSFoundationVersionNumber10_4_4_Intel',
|
|
2782
|
-
'NSFoundationVersionNumber10_4_4_PowerPC',
|
|
2783
|
-
'NSFoundationVersionNumber10_4_5',
|
|
2784
|
-
'NSFoundationVersionNumber10_4_6',
|
|
2785
|
-
'NSFoundationVersionNumber10_4_7',
|
|
2786
|
-
'NSFoundationVersionNumber10_4_8',
|
|
2787
|
-
'NSFoundationVersionNumber10_4_9',
|
|
2788
|
-
'NSFoundationVersionNumber10_5',
|
|
2789
|
-
'NSFoundationVersionNumber10_5_1',
|
|
2790
|
-
'NSFoundationVersionNumber10_5_2',
|
|
2791
|
-
'NSFoundationVersionNumber10_5_3',
|
|
2792
|
-
'NSFoundationVersionNumber10_5_4',
|
|
2793
|
-
'NSFoundationVersionNumber10_5_5',
|
|
2794
|
-
'NSFoundationVersionNumber10_5_6',
|
|
2795
|
-
'NSFoundationVersionNumber10_5_7',
|
|
2796
|
-
'NSFoundationVersionNumber10_5_8',
|
|
2797
|
-
'NSFoundationVersionNumber10_6',
|
|
2798
|
-
'NSFoundationVersionNumber10_6_1',
|
|
2799
|
-
'NSFoundationVersionNumber10_6_2',
|
|
2800
|
-
'NSFoundationVersionNumber10_6_3',
|
|
2801
|
-
'NSFoundationVersionNumber10_6_4',
|
|
2802
|
-
'NSFoundationVersionNumber10_6_5',
|
|
2803
|
-
'NSFoundationVersionNumber10_6_6',
|
|
2804
|
-
'NSFoundationVersionNumber10_6_7',
|
|
2805
|
-
'NSFoundationVersionNumber10_6_8',
|
|
2806
|
-
'NSFoundationVersionNumber10_7',
|
|
2807
|
-
'NSFoundationVersionNumber10_7_1',
|
|
2808
|
-
'NSFoundationVersionNumber10_7_2',
|
|
2809
|
-
'NSFoundationVersionNumber10_7_3',
|
|
2810
|
-
'NSFoundationVersionNumber10_7_4',
|
|
2811
|
-
'NSFoundationVersionNumber10_8',
|
|
2812
|
-
'NSFoundationVersionNumber10_8_1',
|
|
2813
|
-
'NSFoundationVersionNumber10_8_2',
|
|
2814
|
-
'NSFoundationVersionNumber10_8_3',
|
|
2815
|
-
'NSFoundationVersionNumber10_8_4',
|
|
2816
|
-
'NSFoundationVersionNumber10_9',
|
|
2817
|
-
'NSFoundationVersionNumber10_9_1',
|
|
2818
|
-
'NSFoundationVersionNumber10_9_2',
|
|
2819
|
-
'NSFoundationVersionNumber_iOS_4_0',
|
|
2820
|
-
'NSFoundationVersionNumber_iOS_4_1',
|
|
2821
|
-
'NSFoundationVersionNumber_iOS_4_2',
|
|
2822
|
-
'NSFoundationVersionNumber_iOS_4_3',
|
|
2823
|
-
'NSFoundationVersionNumber_iOS_5_0',
|
|
2824
|
-
'NSFoundationVersionNumber_iOS_5_1',
|
|
2825
|
-
'NSFoundationVersionNumber_iOS_6_0',
|
|
2826
|
-
'NSFoundationVersionNumber_iOS_6_1',
|
|
2827
|
-
'NSFoundationVersionNumber_iOS_7_0',
|
|
2828
|
-
'NSFoundationVersionNumber_iOS_7_1',
|
|
2829
|
-
'NSFoundationVersionNumber_iOS_8_0',
|
|
2830
|
-
'NSFoundationVersionNumber_iOS_8_1',
|
|
2831
|
-
'NSFoundationVersionNumber_iOS_8_2',
|
|
2832
|
-
'NSFoundationVersionNumber_iOS_8_3',
|
|
2833
|
-
'NSFoundationVersionNumber_iOS_8_4',
|
|
2834
|
-
'NSFoundationVersionNumber_iOS_8_x_Max',
|
|
2835
|
-
'NSFoundationVersionNumber_iOS_9_0',
|
|
2836
|
-
'NSFoundationVersionNumber_iOS_9_1',
|
|
2837
|
-
'NSFoundationVersionNumber_iOS_9_2',
|
|
2838
|
-
'NSFoundationVersionNumber_iOS_9_3',
|
|
2839
|
-
'NSFoundationVersionNumber_iOS_9_4',
|
|
2840
|
-
'NSFoundationVersionNumber_iOS_9_x_Max',
|
|
2841
|
-
'NSFoundationVersionNumber_iPhoneOS_2_0',
|
|
2842
|
-
'NSFoundationVersionNumber_iPhoneOS_2_1',
|
|
2843
|
-
'NSFoundationVersionNumber_iPhoneOS_2_2',
|
|
2844
|
-
'NSFoundationVersionNumber_iPhoneOS_3_0',
|
|
2845
|
-
'NSFoundationVersionNumber_iPhoneOS_3_1',
|
|
2846
|
-
'NSFoundationVersionNumber_iPhoneOS_3_2',
|
|
2847
2741
|
'NSFoundationVersionWithFileManagerResourceForkSupport',
|
|
2848
2742
|
'NSFreeHashTable',
|
|
2849
2743
|
'NSFreeMapTable',
|
|
@@ -4328,7 +4222,13 @@ export function writeSwiftProject(
|
|
|
4328
4222
|
for (const file of Object.keys(input.files)) {
|
|
4329
4223
|
if (!file.endsWith('.swift')) continue
|
|
4330
4224
|
const target = bySourcePath.find(
|
|
4331
|
-
(candidate) =>
|
|
4225
|
+
(candidate) =>
|
|
4226
|
+
(candidate.path === '.' || file.startsWith(`${candidate.path}/`)) &&
|
|
4227
|
+
(candidate.sources === undefined ||
|
|
4228
|
+
candidate.sources.some((source) => {
|
|
4229
|
+
const selected = path.posix.join(candidate.path, source)
|
|
4230
|
+
return file === selected || file.startsWith(`${selected}/`)
|
|
4231
|
+
})),
|
|
4332
4232
|
)
|
|
4333
4233
|
// swiftpm never compiles an excluded file (a prebuilt core's Swift)
|
|
4334
4234
|
const excluded = target?.exclude?.some(
|
|
@@ -4401,9 +4301,17 @@ export function writeSwiftProject(
|
|
|
4401
4301
|
}
|
|
4402
4302
|
const targetEntries = (target: SwiftPackageTarget) => {
|
|
4403
4303
|
const prefix = target.path === '.' ? '' : `${target.path}/`
|
|
4304
|
+
// targets may share a directory and pick their compiled files with `sources`;
|
|
4305
|
+
// swiftpm leaves every header on disk for relative includes
|
|
4404
4306
|
return Object.entries(input.files).filter(
|
|
4405
4307
|
([file]) =>
|
|
4406
4308
|
file.startsWith(prefix) &&
|
|
4309
|
+
(target.sources === undefined ||
|
|
4310
|
+
!(file.endsWith('.swift') || isSwiftNativeTranslationUnit(file)) ||
|
|
4311
|
+
target.sources.some((source) => {
|
|
4312
|
+
const selected = path.posix.join(prefix, source)
|
|
4313
|
+
return file === selected || file.startsWith(`${selected}/`)
|
|
4314
|
+
})) &&
|
|
4407
4315
|
!target.exclude?.some(
|
|
4408
4316
|
(excluded) =>
|
|
4409
4317
|
file === `${prefix}${excluded}` || file.startsWith(`${prefix}${excluded}/`),
|
|
@@ -4615,8 +4523,7 @@ export function writeSwiftProject(
|
|
|
4615
4523
|
)) {
|
|
4616
4524
|
const include = match[1]!
|
|
4617
4525
|
const producer = /(?:^|\/)([^/]+)-Swift\.h$/.exec(include)?.[1]
|
|
4618
|
-
if (producer &&
|
|
4619
|
-
producers.add(producer)
|
|
4526
|
+
if (producer && swiftTargets.has(producer)) producers.add(producer)
|
|
4620
4527
|
const local = [
|
|
4621
4528
|
path.posix.join(path.posix.dirname(file), include),
|
|
4622
4529
|
`${includes}${include}`,
|
package/src/swift-host.ts
CHANGED
|
@@ -1078,13 +1078,17 @@ async function buildXcodeLayout(root: string): Promise<XcodeLayout | null> {
|
|
|
1078
1078
|
feature.configuration === packageConfiguration,
|
|
1079
1079
|
)
|
|
1080
1080
|
.map((feature) => feature.name),
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1081
|
+
// the flat build gives every module one package; swiftpm names each
|
|
1082
|
+
// module for its own package, which `@retroactive` and `package` read
|
|
1083
|
+
swiftFlags: ['-package-name', swiftPackageIdentity(target.packageDir)].concat(
|
|
1084
|
+
target.packageSwiftFlags
|
|
1085
|
+
.filter(
|
|
1086
|
+
(setting) =>
|
|
1087
|
+
setting.configuration === null ||
|
|
1088
|
+
setting.configuration === packageConfiguration,
|
|
1089
|
+
)
|
|
1090
|
+
.flatMap((setting) => setting.flags),
|
|
1091
|
+
),
|
|
1088
1092
|
linkedLibraries: target.packageLibraries
|
|
1089
1093
|
.filter(
|
|
1090
1094
|
(library) =>
|
|
@@ -1575,7 +1579,7 @@ function xcodeManifest(layout: XcodeLayout): string {
|
|
|
1575
1579
|
...layout.targets.map((target) =>
|
|
1576
1580
|
target.systemLibrary
|
|
1577
1581
|
? ` .systemLibrary(name: "${target.name}", path: "${target.path}"),`
|
|
1578
|
-
: ` .target(name: "${target.name}", ${target.dependencies === undefined ? '' : `dependencies: [${dependencies(target)}], `}path: "${target.path}", ${target.exclude.length > 0 ? `exclude: ${JSON.stringify(target.exclude)}, ` : ''}${target.resources ? 'resources: [], ' : ''}${target.publicHeadersPath === undefined ? '' : `publicHeadersPath: ${JSON.stringify(target.publicHeadersPath)}, `}${clangSettings(target)}${swiftManifestSettings(target)}${libraries(target)}),`,
|
|
1582
|
+
: ` .target(name: "${target.name}", ${target.dependencies === undefined ? '' : `dependencies: [${dependencies(target)}], `}path: "${target.path}", ${target.exclude.length > 0 ? `exclude: ${JSON.stringify(target.exclude)}, ` : ''}${target.sources === undefined ? '' : `sources: ${JSON.stringify(target.sources)}, `}${target.resources ? 'resources: [], ' : ''}${target.publicHeadersPath === undefined ? '' : `publicHeadersPath: ${JSON.stringify(target.publicHeadersPath)}, `}${clangSettings(target)}${swiftManifestSettings(target)}${libraries(target)}),`,
|
|
1579
1583
|
),
|
|
1580
1584
|
'])',
|
|
1581
1585
|
'',
|
|
@@ -119,7 +119,13 @@ export function swiftInterfaceWithoutBodies(text: string, keepDefaults = false):
|
|
|
119
119
|
continue
|
|
120
120
|
}
|
|
121
121
|
const char = text[i]!
|
|
122
|
-
if (
|
|
122
|
+
if (
|
|
123
|
+
!keepDefaults &&
|
|
124
|
+
char === '=' &&
|
|
125
|
+
parens > 0 &&
|
|
126
|
+
text[i - 1] === ' ' &&
|
|
127
|
+
text[i + 1] === ' '
|
|
128
|
+
) {
|
|
123
129
|
out = out.trimEnd()
|
|
124
130
|
i = skipExpression(text, i + 1)
|
|
125
131
|
continue
|
|
@@ -800,10 +800,11 @@ export function objcView(
|
|
|
800
800
|
'-module-cache-path',
|
|
801
801
|
moduleCache,
|
|
802
802
|
'-minimum-access-level',
|
|
803
|
-
// symbol graphs hide public underscored names at the public threshold
|
|
804
|
-
//
|
|
805
|
-
//
|
|
806
|
-
|
|
803
|
+
// symbol graphs hide public underscored names at the public threshold,
|
|
804
|
+
// including a function with an underscored parameter. clang headers
|
|
805
|
+
// remain the declaration boundary, and a swift overlay names its
|
|
806
|
+
// underscored and spi declarations.
|
|
807
|
+
'internal',
|
|
807
808
|
...(surface.interface ? ['-include-spi-symbols'] : []),
|
|
808
809
|
'-skip-synthesized-members',
|
|
809
810
|
'-omit-extension-block-symbols',
|
|
@@ -928,6 +929,16 @@ export function objcView(
|
|
|
928
929
|
// clang's builtin typedefs (stddef's size_t), which an apple sdk keeps in
|
|
929
930
|
// their own builtin modules.
|
|
930
931
|
const ownHeaders = new Set(headerFiles(headersDir).map((name) => path.basename(name)))
|
|
932
|
+
// the graph prints a c function pointer typedef as a plain function type,
|
|
933
|
+
// whose function-typed parameters swift treats as non-escaping; the importer
|
|
934
|
+
// gives every c function pointer @convention(c), which always escapes
|
|
935
|
+
const functionPointers = new Set(
|
|
936
|
+
[...originals.values()].flatMap((text) =>
|
|
937
|
+
[...text.matchAll(/\btypedef\b[^;{}]*?\(\s*\*\s*(\w+)\s*\)\s*\(/g)].map(
|
|
938
|
+
(match) => match[1]!,
|
|
939
|
+
),
|
|
940
|
+
),
|
|
941
|
+
)
|
|
931
942
|
const graphs = fs
|
|
932
943
|
.readdirSync(out)
|
|
933
944
|
.filter((name) => name.endsWith('.symbols.json'))
|
|
@@ -936,10 +947,37 @@ export function objcView(
|
|
|
936
947
|
const graph: SymbolGraph = JSON.parse(fs.readFileSync(path.join(out, name), 'utf8'))
|
|
937
948
|
return {
|
|
938
949
|
...graph,
|
|
939
|
-
symbols: graph.symbols
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
950
|
+
symbols: graph.symbols
|
|
951
|
+
.filter((symbol) => {
|
|
952
|
+
const header = /^c:([^@]+\.h)@/.exec(symbol.identifier.precise)?.[1]
|
|
953
|
+
return !header || ownHeaders.has(header)
|
|
954
|
+
})
|
|
955
|
+
.map((symbol) => {
|
|
956
|
+
if (
|
|
957
|
+
symbol.kind.identifier !== 'swift.typealias' ||
|
|
958
|
+
!symbol.identifier.precise.startsWith('c:') ||
|
|
959
|
+
!functionPointers.has(symbol.pathComponents.at(-1) ?? '')
|
|
960
|
+
)
|
|
961
|
+
return symbol
|
|
962
|
+
const fragments = symbol.declarationFragments ?? []
|
|
963
|
+
const equals = fragments.findIndex((fragment) =>
|
|
964
|
+
fragment.spelling.includes('='),
|
|
965
|
+
)
|
|
966
|
+
const arrow = fragments.findLastIndex((fragment) =>
|
|
967
|
+
fragment.spelling.includes('->'),
|
|
968
|
+
)
|
|
969
|
+
return {
|
|
970
|
+
...symbol,
|
|
971
|
+
declarationFragments: fragments.map((fragment, index) =>
|
|
972
|
+
index > equals &&
|
|
973
|
+
index < arrow &&
|
|
974
|
+
fragment.kind === 'typeIdentifier' &&
|
|
975
|
+
functionPointers.has(fragment.spelling)
|
|
976
|
+
? { ...fragment, spelling: `@escaping ${fragment.spelling}` }
|
|
977
|
+
: fragment,
|
|
978
|
+
),
|
|
979
|
+
}
|
|
980
|
+
}),
|
|
943
981
|
}
|
|
944
982
|
})
|
|
945
983
|
inheritedDefaultInits(stagedSurface, graphs, toolchainBin, search, moduleCache, work)
|
package/src/swift-packages.ts
CHANGED
|
@@ -687,6 +687,7 @@ export function resolveSwiftPackages(options: {
|
|
|
687
687
|
dir: target.dir,
|
|
688
688
|
files,
|
|
689
689
|
exclude: target.exclude,
|
|
690
|
+
...(target.sources ? { sources: target.sources } : {}),
|
|
690
691
|
packageDir: pkg.manifest.dir,
|
|
691
692
|
remote: pkg.remote,
|
|
692
693
|
iosDeployment: pkg.manifest.iosDeployment,
|
package/src/xcode-project.ts
CHANGED
|
@@ -1509,7 +1509,9 @@ function projectTargets(project: LoadedProject): TargetRef[] {
|
|
|
1509
1509
|
}
|
|
1510
1510
|
|
|
1511
1511
|
// an application target peach builds, for the iOS simulator like every
|
|
1512
|
-
// target here.
|
|
1512
|
+
// target here. xcode builds a multiplatform target for an iOS destination
|
|
1513
|
+
// whenever its SUPPORTED_PLATFORMS lists one, whatever SDKROOT names; without
|
|
1514
|
+
// that list, a target whose SDKROOT names another platform, such as a watchOS
|
|
1513
1515
|
// app beside the iOS one, is never the app peach runs.
|
|
1514
1516
|
function isIosAppTarget(
|
|
1515
1517
|
ref: TargetRef,
|
|
@@ -1524,10 +1526,10 @@ function isIosAppTarget(
|
|
|
1524
1526
|
},
|
|
1525
1527
|
options,
|
|
1526
1528
|
)
|
|
1529
|
+
const platforms = settingList(get('SUPPORTED_PLATFORMS'))
|
|
1530
|
+
if (platforms.length > 0) return platforms.some(isIosPlatform)
|
|
1527
1531
|
const sdk = get('SDKROOT')
|
|
1528
|
-
return sdk === '
|
|
1529
|
-
? settingList(get('SUPPORTED_PLATFORMS')).some(isIosPlatform)
|
|
1530
|
-
: sdk === '' || isIosPlatform(sdk)
|
|
1532
|
+
return sdk === '' || isIosPlatform(sdk)
|
|
1531
1533
|
}
|
|
1532
1534
|
|
|
1533
1535
|
// the device or simulator sdk, bare or versioned such as iphonesimulator18.0.
|