peachsim 0.1.1659 → 0.1.1667
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/cli/bridge-flow-runner.ts +2 -2
- package/cli/commands/box.ts +2 -0
- package/cli/commands/control.ts +56 -17
- package/cli/commands/debug.ts +100 -9
- package/cli/commands/flow.ts +2 -2
- package/cli/commands/inspect/settle.ts +4 -2
- package/cli/commands/inspect/settling.ts +17 -14
- package/cli/commands/platform.ts +3 -0
- package/cli/current-sim.ts +21 -1
- package/cli/dev-build-freshness.ts +36 -2
- package/cli/maestro-compare.ts +44 -14
- package/cli/main.ts +3 -0
- package/cli/material-symbol-fonts.ts +3 -100
- package/cli/output-redaction.ts +21 -6
- package/cli/parent-pid.ts +2 -2
- package/cli/ws-bridge.ts +19 -1
- package/detox/attempt-events.cjs +48 -18
- package/detox/index.ts +0 -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 +2156 -25785
- 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 +85 -37
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +1747 -25394
- 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 +2195 -25834
- package/dist-lib/host/fetch-proxy-handler.cjs +7 -7
- 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 +190 -45
- 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 +81 -9
- package/dist-lib/native-app-identity-project.cjs +81 -9
- package/dist-lib/native-app-identity-project.mjs +81 -9
- 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/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 +26 -24
- package/dist-lib/public-origins-lib.json +79 -53
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +18 -15
- package/dist-lib/sdk.mjs +18 -15
- package/dist-lib/skills.cjs +2995 -26434
- package/dist-lib/swift-compile.cjs +985 -24728
- package/dist-lib/swift-compile.mjs +914 -24657
- 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 +28 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +1780 -25372
- package/dist-lib/vite.cjs +73 -21
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-gesture-handler.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/demo/demo-bundle-platform.d.ts +29 -0
- package/dist-types/packages/peach-engine/src/engine/app-font-registry.d.ts +13 -1
- package/dist-types/packages/peach-engine/src/engine/clipboardContract.d.ts +17 -0
- package/dist-types/packages/peach-engine/src/engine/fontDataContract.d.ts +73 -0
- package/dist-types/packages/peach-engine/src/engine/glass-material.d.ts +1 -2
- package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +19 -3
- package/dist-types/packages/peach-engine/src/engine/liquid-glass.d.ts +0 -4
- package/dist-types/packages/peach-engine/src/engine/node.d.ts +0 -1
- package/dist-types/packages/peach-engine/src/ios/aux-shell-animated-sources.d.ts +6 -0
- package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +68 -0
- package/dist-types/packages/peach-engine/src/render-worker/host-service-protocol.d.ts +4 -0
- package/dist-types/packages/peach-engine/src/render-worker/nativeSyncReplyContract.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/render-worker/shell-protocol.d.ts +8 -1
- package/dist-types/packages/peach-engine/src/render-worker/shell-scene-schema.d.ts +10 -2
- package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +3 -0
- package/dist-types/packages/peach-globals/src/accessibilityBridgeContract.d.ts +11 -0
- package/dist-types/packages/peach-globals/src/androidDateTimePickerBridgeContract.d.ts +41 -0
- package/dist-types/packages/peach-globals/src/appLifecycleBridgeContract.d.ts +22 -0
- package/dist-types/packages/peach-globals/src/audioBridgeContract.d.ts +33 -0
- package/dist-types/packages/peach-globals/src/bridgeContract.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/cameraBridgeContract.d.ts +94 -0
- package/dist-types/packages/peach-globals/src/captureBridgeContract.d.ts +36 -0
- package/dist-types/packages/peach-globals/src/clipboardBridgeContract.d.ts +27 -0
- package/dist-types/packages/peach-globals/src/compositorBridgeContract.d.ts +31 -0
- package/dist-types/packages/peach-globals/src/debugBridgeContract.d.ts +27 -0
- package/dist-types/packages/peach-globals/src/electronBridgeContract.d.ts +29 -0
- package/dist-types/packages/peach-globals/src/eventBridgeContract.d.ts +200 -0
- package/dist-types/packages/peach-globals/src/globalsContract.d.ts +462 -0
- package/dist-types/packages/peach-globals/src/hostStorageBridgeContract.d.ts +3 -0
- package/dist-types/packages/peach-globals/src/imagePickerBridgeContract.d.ts +47 -0
- package/dist-types/packages/peach-globals/src/index.d.ts +47 -3334
- package/dist-types/packages/peach-globals/src/interactionBridgeContract.d.ts +21 -0
- package/dist-types/packages/peach-globals/src/keyboardBridgeContract.d.ts +44 -0
- package/dist-types/packages/peach-globals/src/lockstepCaptureBridgeContract.d.ts +77 -0
- package/dist-types/packages/peach-globals/src/nativeViewContract.d.ts +28 -0
- package/dist-types/packages/peach-globals/src/navigationBridgeContract.d.ts +11 -0
- package/dist-types/packages/peach-globals/src/nodeContract.d.ts +664 -0
- package/dist-types/packages/peach-globals/src/performanceBridgeContract.d.ts +100 -0
- package/dist-types/packages/peach-globals/src/permissionsBridgeContract.d.ts +152 -0
- package/dist-types/packages/peach-globals/src/photoLibraryBridgeContract.d.ts +36 -0
- package/dist-types/packages/peach-globals/src/portalBridgeContract.d.ts +9 -0
- package/dist-types/packages/peach-globals/src/recordingBridgeContract.d.ts +131 -0
- package/dist-types/packages/peach-globals/src/replayBridgeContract.d.ts +125 -0
- package/dist-types/packages/peach-globals/src/sceneStreamBridgeContract.d.ts +37 -0
- package/dist-types/packages/peach-globals/src/settingsBridgeContract.d.ts +7 -0
- package/dist-types/packages/peach-globals/src/shareSheetBridgeContract.d.ts +14 -0
- package/dist-types/packages/peach-globals/src/shellBridgeContract.d.ts +82 -0
- package/dist-types/packages/peach-globals/src/shellHostBridgeContract.d.ts +28 -0
- package/dist-types/packages/peach-globals/src/speechSynthesisBridgeContract.d.ts +25 -0
- package/dist-types/packages/peach-globals/src/testBridgeContract.d.ts +278 -0
- package/dist-types/packages/peach-globals/src/timelineBridgeContract.d.ts +58 -0
- package/dist-types/packages/peach-globals/src/videoBridgeContract.d.ts +80 -0
- package/dist-types/packages/peach-globals/src/webViewBridgeContract.d.ts +331 -0
- package/dist-types/packages/peach-globals/src/windowBridgeContract.d.ts +5 -0
- package/dist-types/packages/peach-kit/src/ui/popover-placement.d.ts +3 -5
- package/package.json +2 -1
- package/runtime-companion.json +1 -1
- package/sdk/ios/System/Library/Frameworks/AVFoundation.framework/Headers/AVAsset.h +20 -0
- package/sdk/ios/System/Library/Frameworks/AVFoundation.framework/Headers/AVAsynchronousKeyValueLoading.h +15 -0
- package/sdk/ios/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.h +5 -0
- package/sdk/ios/System/Library/Frameworks/AVFoundation.framework/Headers/AVMetadataFormat.h +13 -0
- package/sdk/ios/System/Library/Frameworks/AVFoundation.framework/Headers/AVMetadataItem.h +16 -0
- package/sdk/ios/System/Library/Frameworks/AVFoundation.framework/Headers/AVTimedMetadataGroup.h +13 -0
- package/sdk/ios/System/Library/Frameworks/AVFoundation.framework/Modules/module.modulemap +4 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Conversion.h +19 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Convolution.h +11 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Geometry.h +17 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage.h +13 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Types.h +307 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Utilities.h +174 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.h +7 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/CoreData.h +5 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSFetchRequest.h +21 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSFetchedResultsController.h +39 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObject.h +10 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObjectContext.h +9 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObjectID.h +7 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObjectModel.h +5 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentStoreCoordinator.h +5 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentStoreRequest.h +5 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Modules/module.modulemap +5 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h +185 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBase.h +2 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h +316 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Modules/module.modulemap +4 -0
- package/sdk/ios/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.h +46 -0
- package/sdk/ios/System/Library/Frameworks/CoreImage.framework/Modules/module.modulemap +4 -0
- package/sdk/ios/System/Library/Frameworks/CoreMedia.framework/Headers/CMTime.h +31 -0
- package/sdk/ios/System/Library/Frameworks/CoreMedia.framework/Headers/CMTimeRange.h +8 -0
- package/sdk/ios/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.h +3 -0
- package/sdk/ios/System/Library/Frameworks/CoreMedia.framework/Modules/module.modulemap +4 -0
- package/sdk/ios/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h +12 -0
- package/sdk/ios/System/Library/Frameworks/CoreServices.framework/Headers/UTCoreTypes.h +1276 -0
- package/sdk/ios/System/Library/Frameworks/CoreServices.framework/Headers/UTType.h +644 -0
- package/sdk/ios/System/Library/Frameworks/CoreText.framework/Headers/CTFontManager.h +20 -0
- package/sdk/ios/System/Library/Frameworks/CoreText.framework/Headers/CoreText.h +2 -0
- package/sdk/ios/System/Library/Frameworks/CoreText.framework/Modules/module.modulemap +4 -0
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +1441 -0
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Modules/module.modulemap +4 -0
- package/sdk/ios/System/Library/Frameworks/ImageIO.framework/Headers/CGImageAnimation.h +106 -0
- package/sdk/ios/System/Library/Frameworks/ImageIO.framework/Headers/CGImageDestination.h +429 -0
- package/sdk/ios/System/Library/Frameworks/ImageIO.framework/Headers/CGImageMetadata.h +665 -0
- package/sdk/ios/System/Library/Frameworks/ImageIO.framework/Headers/CGImageProperties.h +2504 -0
- package/sdk/ios/System/Library/Frameworks/ImageIO.framework/Headers/CGImageSource.h +634 -0
- package/sdk/ios/System/Library/Frameworks/ImageIO.framework/Headers/ImageIO.h +22 -0
- package/sdk/ios/System/Library/Frameworks/ImageIO.framework/Headers/ImageIOBase.h +18 -0
- package/sdk/ios/System/Library/Frameworks/ImageIO.framework/Modules/module.modulemap +4 -0
- package/sdk/ios/System/Library/Frameworks/MobileCoreServices.framework/Headers/MobileCoreServices.h +9 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h +40 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Modules/module.modulemap +4 -0
- package/sdk/ios/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariViewController.h +14 -0
- package/sdk/ios/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariViewControllerConfiguration.h +9 -0
- package/sdk/ios/System/Library/Frameworks/SafariServices.framework/Headers/SafariServices.h +2 -0
- package/sdk/ios/System/Library/Frameworks/SafariServices.framework/Modules/module.modulemap +5 -0
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecBase.h +3 -0
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecItem.h +30 -0
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/Security.h +3 -0
- package/sdk/ios/System/Library/Frameworks/Security.framework/Modules/module.modulemap +5 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIAppearance.h +5 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIColor.h +2 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h +817 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Modules/module.modulemap +4 -0
- package/sdk/ios/usr/include/Availability.h +630 -0
- package/sdk/ios/usr/include/AvailabilityInternal.h +556 -0
- package/sdk/ios/usr/include/AvailabilityInternalLegacy.h +4346 -0
- package/sdk/ios/usr/include/AvailabilityVersions.h +547 -0
- package/sdk/ios/usr/include/CommonCrypto/CommonDigest.h +130 -0
- package/sdk/ios/usr/include/MacTypes.h +3 -0
- package/sdk/ios/usr/include/TargetConditionals.h +14 -0
- package/sdk/ios/usr/include/__xlocale.h +41 -0
- package/sdk/ios/usr/include/_bounds.h +67 -0
- package/sdk/ios/usr/include/_ctermid.h +42 -0
- package/sdk/ios/usr/include/_mb_cur_max.h +39 -0
- package/sdk/ios/usr/include/_printf.h +38 -0
- package/sdk/ios/usr/include/_stdio.h +510 -0
- package/sdk/ios/usr/include/_types/_intmax_t.h +40 -0
- package/sdk/ios/usr/include/_types/_locale_t.h +38 -0
- package/sdk/ios/usr/include/_types/_uint16_t.h +32 -0
- package/sdk/ios/usr/include/_types/_uint32_t.h +32 -0
- package/sdk/ios/usr/include/_types/_uint64_t.h +32 -0
- package/sdk/ios/usr/include/_types/_uint8_t.h +32 -0
- package/sdk/ios/usr/include/_types/_uintmax_t.h +40 -0
- package/sdk/ios/usr/include/_types.h +72 -0
- package/sdk/ios/usr/include/arm/_endian.h +105 -0
- package/sdk/ios/usr/include/arm/_mcontext.h +95 -0
- package/sdk/ios/usr/include/arm/_param.h +25 -0
- package/sdk/ios/usr/include/arm/_types.h +125 -0
- package/sdk/ios/usr/include/arm/endian.h +65 -0
- package/sdk/ios/usr/include/arm/signal.h +22 -0
- package/sdk/ios/usr/include/arm/types.h +110 -0
- package/sdk/ios/usr/include/asl.h +160 -0
- package/sdk/ios/usr/include/assert.h +14 -0
- package/sdk/ios/usr/include/dirent.h +224 -0
- package/sdk/ios/usr/include/dispatch/dispatch.h +114 -0
- package/sdk/ios/usr/include/dlfcn.h +16 -0
- package/sdk/ios/usr/include/errno.h +24 -0
- package/sdk/ios/usr/include/execinfo.h +11 -0
- package/sdk/ios/usr/include/fcntl.h +23 -0
- package/sdk/ios/usr/include/i386/_endian.h +105 -0
- package/sdk/ios/usr/include/i386/_mcontext.h +216 -0
- package/sdk/ios/usr/include/i386/_param.h +49 -0
- package/sdk/ios/usr/include/i386/_types.h +149 -0
- package/sdk/ios/usr/include/i386/endian.h +89 -0
- package/sdk/ios/usr/include/i386/signal.h +47 -0
- package/sdk/ios/usr/include/libkern/OSAtomic.h +51 -0
- package/sdk/ios/usr/include/libkern/OSAtomicDeprecated.h +1267 -0
- package/sdk/ios/usr/include/libkern/OSAtomicQueue.h +115 -0
- package/sdk/ios/usr/include/libkern/OSSpinLockDeprecated.h +212 -0
- package/sdk/ios/usr/include/libkern/_OSByteOrder.h +125 -0
- package/sdk/ios/usr/include/libkern/arm/_OSByteOrder.h +99 -0
- package/sdk/ios/usr/include/libkern/i386/_OSByteOrder.h +110 -0
- package/sdk/ios/usr/include/limits.h +4 -0
- package/sdk/ios/usr/include/mach/arm/_structs.h +741 -0
- package/sdk/ios/usr/include/mach/boolean.h +4 -0
- package/sdk/ios/usr/include/mach/exception_types.h +40 -0
- package/sdk/ios/usr/include/mach/host_info.h +200 -0
- package/sdk/ios/usr/include/mach/i386/_structs.h +1316 -0
- package/sdk/ios/usr/include/mach/kern_return.h +61 -0
- package/sdk/ios/usr/include/mach/mach.h +16 -0
- package/sdk/ios/usr/include/mach/mach_error.h +10 -0
- package/sdk/ios/usr/include/mach/mach_host.h +18 -0
- package/sdk/ios/usr/include/mach/mach_init.h +15 -0
- package/sdk/ios/usr/include/mach/mach_port.h +11 -0
- package/sdk/ios/usr/include/mach/mach_time.h +14 -0
- package/sdk/ios/usr/include/mach/mach_types.h +20 -0
- package/sdk/ios/usr/include/mach/machine/_structs.h +40 -0
- package/sdk/ios/usr/include/mach/machine.h +144 -0
- package/sdk/ios/usr/include/mach/task.h +14 -0
- package/sdk/ios/usr/include/mach/task_info.h +23 -0
- package/sdk/ios/usr/include/mach/task_policy.h +29 -0
- package/sdk/ios/usr/include/mach/thread_act.h +12 -0
- package/sdk/ios/usr/include/mach/thread_info.h +32 -0
- package/sdk/ios/usr/include/mach/time_value.h +4 -0
- package/sdk/ios/usr/include/mach/vm_prot.h +8 -0
- package/sdk/ios/usr/include/mach/vm_region.h +43 -0
- package/sdk/ios/usr/include/mach/vm_statistics.h +491 -0
- package/sdk/ios/usr/include/mach/vm_types.h +8 -0
- package/sdk/ios/usr/include/mach-o/arch.h +21 -0
- package/sdk/ios/usr/include/mach-o/dyld.h +16 -0
- package/sdk/ios/usr/include/mach-o/dyld_images.h +71 -0
- package/sdk/ios/usr/include/mach-o/getsect.h +17 -0
- package/sdk/ios/usr/include/mach-o/loader.h +158 -0
- package/sdk/ios/usr/include/mach-o/nlist.h +38 -0
- package/sdk/ios/usr/include/mach-o/stab.h +33 -0
- package/sdk/ios/usr/include/mach-o/utils.h +10 -0
- package/sdk/ios/usr/include/machine/_endian.h +42 -0
- package/sdk/ios/usr/include/machine/_mcontext.h +39 -0
- package/sdk/ios/usr/include/machine/_param.h +39 -0
- package/sdk/ios/usr/include/machine/_types.h +39 -0
- package/sdk/ios/usr/include/machine/endian.h +42 -0
- package/sdk/ios/usr/include/machine/signal.h +39 -0
- package/sdk/ios/usr/include/machine/types.h +42 -0
- package/sdk/ios/usr/include/math.h +5 -0
- package/sdk/ios/usr/include/module.modulemap +4 -0
- package/sdk/ios/usr/include/net/if.h +20 -0
- package/sdk/ios/usr/include/net/if_dl.h +10 -0
- package/sdk/ios/usr/include/net/if_var.h +15 -0
- package/sdk/ios/usr/include/net/net_kev.h +100 -0
- package/sdk/ios/usr/include/netdb.h +5 -0
- package/sdk/ios/usr/include/netinet/in.h +670 -0
- package/sdk/ios/usr/include/netinet6/in6.h +676 -0
- package/sdk/ios/usr/include/notify.h +45 -0
- package/sdk/ios/usr/include/notify_keys.h +17 -0
- package/sdk/ios/usr/include/objc/NSObject.h +79 -0
- package/sdk/ios/usr/include/os/availability.h +140 -0
- package/sdk/ios/usr/include/os/lock.h +24 -0
- package/sdk/ios/usr/include/os/log.h +77 -0
- package/sdk/ios/usr/include/os/object.h +13 -0
- package/sdk/ios/usr/include/peach/darwin.h +6 -0
- package/sdk/ios/usr/include/peach/netdb.h +316 -0
- package/sdk/ios/usr/include/peach/pthread.h +19 -0
- package/sdk/ios/usr/include/pthread.h +4 -0
- package/sdk/ios/usr/include/secure/_common.h +45 -0
- package/sdk/ios/usr/include/secure/_stdio.h +130 -0
- package/sdk/ios/usr/include/signal.h +132 -0
- package/sdk/ios/usr/include/stdint.h +205 -0
- package/sdk/ios/usr/include/stdio.h +65 -0
- package/sdk/ios/usr/include/stdlib.h +17 -0
- package/sdk/ios/usr/include/string.h +8 -0
- package/sdk/ios/usr/include/sys/__endian.h +108 -0
- package/sdk/ios/usr/include/sys/_endian.h +152 -0
- package/sdk/ios/usr/include/sys/_posix_availability.h +73 -0
- package/sdk/ios/usr/include/sys/_pthread/_pthread_attr_t.h +32 -0
- package/sdk/ios/usr/include/sys/_pthread/_pthread_t.h +32 -0
- package/sdk/ios/usr/include/sys/_pthread/_pthread_types.h +120 -0
- package/sdk/ios/usr/include/sys/_symbol_aliasing.h +1093 -0
- package/sdk/ios/usr/include/sys/_types/_errno_t.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_filesec_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_gid_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_in_addr_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_in_port_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_ino_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_int16_t.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_int32_t.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_int64_t.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_int8_t.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_intptr_t.h +33 -0
- package/sdk/ios/usr/include/sys/_types/_iovec_t.h +35 -0
- package/sdk/ios/usr/include/sys/_types/_mode_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_null.h +54 -0
- package/sdk/ios/usr/include/sys/_types/_o_dsync.h +30 -0
- package/sdk/ios/usr/include/sys/_types/_o_sync.h +30 -0
- package/sdk/ios/usr/include/sys/_types/_off_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_pid_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_ptrdiff_t.h +56 -0
- package/sdk/ios/usr/include/sys/_types/_s_ifmt.h +74 -0
- package/sdk/ios/usr/include/sys/_types/_sa_family_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_seek_set.h +51 -0
- package/sdk/ios/usr/include/sys/_types/_sigaltstack.h +50 -0
- package/sdk/ios/usr/include/sys/_types/_sigset_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_size_t.h +56 -0
- package/sdk/ios/usr/include/sys/_types/_socklen_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_ssize_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_timespec.h +38 -0
- package/sdk/ios/usr/include/sys/_types/_timeval32.h +3 -0
- package/sdk/ios/usr/include/sys/_types/_u_int16_t.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_u_int32_t.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_u_int64_t.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_u_int8_t.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_ucontext.h +59 -0
- package/sdk/ios/usr/include/sys/_types/_uid_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_uintptr_t.h +37 -0
- package/sdk/ios/usr/include/sys/_types/_va_list.h +49 -0
- package/sdk/ios/usr/include/sys/_types/_wchar_t.h +59 -0
- package/sdk/ios/usr/include/sys/_types.h +103 -0
- package/sdk/ios/usr/include/sys/appleapiopts.h +61 -0
- package/sdk/ios/usr/include/sys/cdefs.h +341 -0
- package/sdk/ios/usr/include/sys/constrained_ctypes.h +622 -0
- package/sdk/ios/usr/include/sys/dirent.h +141 -0
- package/sdk/ios/usr/include/sys/errno.h +271 -0
- package/sdk/ios/usr/include/sys/fcntl.h +649 -0
- package/sdk/ios/usr/include/sys/mman.h +273 -0
- package/sdk/ios/usr/include/sys/proc.h +65 -0
- package/sdk/ios/usr/include/sys/qos.h +61 -0
- package/sdk/ios/usr/include/sys/signal.h +394 -0
- package/sdk/ios/usr/include/sys/socket.h +752 -0
- package/sdk/ios/usr/include/sys/stdio.h +61 -0
- package/sdk/ios/usr/include/sys/sysctl.h +74 -0
- package/sdk/ios/usr/include/sys/syslimits.h +11 -0
- package/sdk/ios/usr/include/sys/time.h +5 -0
- package/sdk/ios/usr/include/sys/types.h +21 -0
- package/sdk/ios/usr/include/sys/ucontext.h +41 -0
- package/sdk/ios/usr/include/sys/xattr.h +50 -0
- package/sdk/ios/usr/include/time.h +2 -0
- package/sdk/ios/usr/include/unistd.h +3 -0
- package/sdk/ios/usr/include/uuid/uuid.h +19 -0
- package/sdk/ios/usr/include/xlocale/_stdio.h +85 -0
- package/sdk/ios/usr/lib/swift/CoreGraphics.swiftmodule/arm64-apple-ios-simulator.swiftinterface +8 -0
- package/sdk/ios/usr/lib/swift/Foundation.swiftmodule/arm64-apple-ios-simulator.swiftinterface +51 -0
- package/sdk/ios/usr/lib/swift/ObjectiveC.swiftmodule/arm64-apple-ios-simulator.swiftinterface +20 -0
- package/sdk/ios/wasm/include/dlfcn.h +3 -0
- package/sdk/ios/wasm/include/netdb.h +4 -0
- package/sdk/ios/wasm/include/pthread.h +3 -0
- package/sdk/ios/wasm/include/stdlib.h +3 -0
- package/sdk/ios/wasm/include/string.h +3 -0
- package/sdk/ios/wasm/include/sys/socket.h +7 -0
- package/sdk/ios/wasm/include/sys/types.h +4 -0
- package/sdk/ios/wasm/include/sys/ucontext.h +38 -0
- package/src/cli-runtime.ts +5 -5
- package/src/conformance-comparison-contract.ts +146 -0
- package/src/conformance-pixel-comparison.ts +327 -0
- package/src/device-catalog.ts +12 -3
- package/src/material-symbol-fonts.ts +107 -0
- package/src/stub-pattern-matcher.ts +4 -0
- package/src/swift-compile.ts +517 -189
- package/src/swift-compiler-digest.ts +6 -2
- package/src/swift-distribution.ts +2 -1
- package/src/swift-host.ts +26 -3
- package/src/swift-objc-compile.ts +72 -97
- package/src/swift-objc-import.ts +47 -11
- package/src/swift-objc-metadata.ts +54 -7
- package/src/swift-objc-sdk-tree.ts +17 -0
- package/src/swift-objc-sdk.ts +27 -24178
- package/src/swift-objc-standin.ts +4 -2
- package/src/swift-standins.ts +2 -2
- package/src/swift-toolchain.ts +36 -0
- package/src/swift-vite-lifetime.ts +42 -0
- package/src/swiftContract.ts +54 -0
- package/src/vite-plugin-one.ts +36 -15
- package/src/vite-plugin-swift.ts +21 -2
- package/src/xcode-header-search.ts +114 -0
- package/src/xcode-project.ts +103 -9
|
@@ -475,7 +475,7 @@ export function objcView(
|
|
|
475
475
|
),
|
|
476
476
|
}
|
|
477
477
|
: {}),
|
|
478
|
-
values: enumValues(graphs, surface, framework, toolchainBin, search, work),
|
|
478
|
+
values: enumValues(graphs, surface, framework, toolchainBin, search, work, original),
|
|
479
479
|
imports: [...imports].sort(),
|
|
480
480
|
}
|
|
481
481
|
}
|
|
@@ -605,6 +605,7 @@ function enumValues(
|
|
|
605
605
|
toolchainBin: string,
|
|
606
606
|
search: string[],
|
|
607
607
|
work: string,
|
|
608
|
+
original?: { flags: readonly string[]; target: string },
|
|
608
609
|
): Map<string, string> {
|
|
609
610
|
const wanted = new Map<string, string>()
|
|
610
611
|
for (const graph of graphs)
|
|
@@ -647,8 +648,9 @@ function enumValues(
|
|
|
647
648
|
`-fmodule-name=${surface.module}`,
|
|
648
649
|
'-fsyntax-only',
|
|
649
650
|
'-target',
|
|
650
|
-
IOS_SDK_TARGET,
|
|
651
|
+
original?.target ?? IOS_SDK_TARGET,
|
|
651
652
|
...flags,
|
|
653
|
+
...(original?.flags ?? []),
|
|
652
654
|
`-fmodules-cache-path=${path.join(work, 'clang-modules')}`,
|
|
653
655
|
'-Xclang',
|
|
654
656
|
'-ast-dump=json',
|
package/src/swift-standins.ts
CHANGED
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
type SwiftStandinBehaviors,
|
|
45
45
|
type StandinBehavior,
|
|
46
46
|
} from './swift-standin-emit'
|
|
47
|
-
import { swiftEnvironment, swiftSdkOptions } from './swift-toolchain'
|
|
47
|
+
import { sourceSwiftCheckout, swiftEnvironment, swiftSdkOptions } from './swift-toolchain'
|
|
48
48
|
import type { SwiftPackageBinary } from './swift-packages'
|
|
49
49
|
|
|
50
50
|
const TRIPLE = 'wasm32-unknown-wasip1'
|
|
@@ -1551,7 +1551,7 @@ export function swiftStandins(
|
|
|
1551
1551
|
process.env.TM_EXEC_BUILD_PLATFORM !== 'mac' &&
|
|
1552
1552
|
process.env.TM_SESSION &&
|
|
1553
1553
|
process.env.CI !== 'true' &&
|
|
1554
|
-
toolchain.moduleRoot ===
|
|
1554
|
+
toolchain.moduleRoot === sourceSwiftCheckout() &&
|
|
1555
1555
|
!swiftDistributionAt(toolchain.moduleRoot)
|
|
1556
1556
|
)
|
|
1557
1557
|
return sourceStandins(requested, toolchain, provided, behavior)
|
package/src/swift-toolchain.ts
CHANGED
|
@@ -12,6 +12,22 @@ import os from 'node:os'
|
|
|
12
12
|
import path from 'node:path'
|
|
13
13
|
import { fileURLToPath } from 'node:url'
|
|
14
14
|
|
|
15
|
+
/** the peachsim package directory. source runs sit in packages/peachsim/src,
|
|
16
|
+
* the bundled cli in dist-cli/chunks and library entries at varying depths
|
|
17
|
+
* under dist-lib, so it is found by its package.json, not a fixed number of
|
|
18
|
+
* levels up. */
|
|
19
|
+
export function peachsimPackageRoot(): string {
|
|
20
|
+
let dir = import.meta.dirname
|
|
21
|
+
while (!fs.existsSync(path.join(dir, 'package.json')) && dir !== path.dirname(dir))
|
|
22
|
+
dir = path.dirname(dir)
|
|
23
|
+
return dir
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** the Swift module checkout beside a source peach. */
|
|
27
|
+
export function sourceSwiftCheckout(): string {
|
|
28
|
+
return path.resolve(peachsimPackageRoot(), '../sootsim-swift')
|
|
29
|
+
}
|
|
30
|
+
|
|
15
31
|
/** swiftpm's SDK directory option, shared by discovery and compilation. */
|
|
16
32
|
export function swiftSdkOptions(): string[] {
|
|
17
33
|
const directory = process.env.PEACH_SWIFT_SDKS_PATH
|
|
@@ -202,6 +218,26 @@ export interface SwiftWasmSdk {
|
|
|
202
218
|
wasmSdkChecksum: string
|
|
203
219
|
}
|
|
204
220
|
|
|
221
|
+
// source module builds read the pin without loading the application compiler.
|
|
222
|
+
export function swiftSourceSdk(root: string): SwiftWasmSdk {
|
|
223
|
+
const pin: unknown = JSON.parse(
|
|
224
|
+
fs.readFileSync(path.join(root, 'toolchain.json'), 'utf8'),
|
|
225
|
+
)
|
|
226
|
+
if (
|
|
227
|
+
!pin ||
|
|
228
|
+
typeof pin !== 'object' ||
|
|
229
|
+
typeof Reflect.get(pin, 'wasmSdkId') !== 'string' ||
|
|
230
|
+
typeof Reflect.get(pin, 'wasmSdkUrl') !== 'string' ||
|
|
231
|
+
typeof Reflect.get(pin, 'wasmSdkChecksum') !== 'string'
|
|
232
|
+
)
|
|
233
|
+
throw new Error(`${root} pins no wasm SDK id, url and checksum`)
|
|
234
|
+
return {
|
|
235
|
+
wasmSdkId: String(Reflect.get(pin, 'wasmSdkId')),
|
|
236
|
+
wasmSdkUrl: String(Reflect.get(pin, 'wasmSdkUrl')),
|
|
237
|
+
wasmSdkChecksum: String(Reflect.get(pin, 'wasmSdkChecksum')),
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
205
241
|
/**
|
|
206
242
|
* swiftToolchainBin, checked: its swift is exactly `release` and has the
|
|
207
243
|
* pinned wasm SDK installed. anything else fails with one message naming the
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ViteDevServer } from 'vite'
|
|
2
|
+
|
|
3
|
+
interface SwiftViteLifetime {
|
|
4
|
+
signal: AbortSignal
|
|
5
|
+
compiles: Set<Promise<unknown>>
|
|
6
|
+
projects: Set<string>
|
|
7
|
+
close(): Promise<void>
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// the adapters ship as separate bundles, so the server carries their shared owner.
|
|
11
|
+
const LIFETIME = Symbol.for('peach.swift-vite-lifetime')
|
|
12
|
+
|
|
13
|
+
export function swiftViteLifetime(
|
|
14
|
+
server: ViteDevServer & { [LIFETIME]?: SwiftViteLifetime },
|
|
15
|
+
): SwiftViteLifetime {
|
|
16
|
+
const existing = server[LIFETIME]
|
|
17
|
+
if (existing && !existing.signal.aborted) return existing
|
|
18
|
+
const controller = new AbortController()
|
|
19
|
+
const compiles = new Set<Promise<unknown>>()
|
|
20
|
+
const projects = new Set<string>()
|
|
21
|
+
let closing: Promise<void> | undefined
|
|
22
|
+
const lifetime: SwiftViteLifetime = {
|
|
23
|
+
signal: controller.signal,
|
|
24
|
+
compiles,
|
|
25
|
+
projects,
|
|
26
|
+
close() {
|
|
27
|
+
closing ??= (async () => {
|
|
28
|
+
controller.abort(new Error('Swift dev server closed'))
|
|
29
|
+
await Promise.allSettled(compiles)
|
|
30
|
+
if (projects.size > 0) {
|
|
31
|
+
const host = await import('peachsim/vite-swift')
|
|
32
|
+
for (const packagePath of projects)
|
|
33
|
+
host.disposeSwiftProject(packagePath, controller.signal)
|
|
34
|
+
projects.clear()
|
|
35
|
+
}
|
|
36
|
+
})()
|
|
37
|
+
return closing
|
|
38
|
+
},
|
|
39
|
+
}
|
|
40
|
+
server[LIFETIME] = lifetime
|
|
41
|
+
return lifetime
|
|
42
|
+
}
|
package/src/swiftContract.ts
CHANGED
|
@@ -20,6 +20,12 @@ export interface SwiftResourceBundle {
|
|
|
20
20
|
export interface SwiftObjCPeerClass {
|
|
21
21
|
name: string
|
|
22
22
|
header: string
|
|
23
|
+
/**
|
|
24
|
+
* a framework-private class no public header declares, measured on native:
|
|
25
|
+
* its superclass is a header class in the same list and `swift` names the
|
|
26
|
+
* exact Swift metatype that stands for it, which the importer cannot expose.
|
|
27
|
+
*/
|
|
28
|
+
private?: { superclass: string; swift: string }
|
|
23
29
|
}
|
|
24
30
|
|
|
25
31
|
/** generated registration source whose call must precede the application entry. */
|
|
@@ -54,6 +60,15 @@ export interface SwiftProjectPreparation {
|
|
|
54
60
|
objcImplementations?: SwiftObjCImplementationPlan
|
|
55
61
|
}
|
|
56
62
|
|
|
63
|
+
/**
|
|
64
|
+
* one header map xcode generates for a target. a value is a header, written as
|
|
65
|
+
* a path under SWIFT_NATIVE_INPUT_ROOT, or a framework include `Product/Header.h`.
|
|
66
|
+
*/
|
|
67
|
+
export interface SwiftNativeHeaderMap {
|
|
68
|
+
flag: '-I' | '-iquote'
|
|
69
|
+
entries: [string, string][]
|
|
70
|
+
}
|
|
71
|
+
|
|
57
72
|
/** project-relative original clang inputs; no host paths cross the compile boundary. */
|
|
58
73
|
export interface SwiftNativeTarget {
|
|
59
74
|
name: string
|
|
@@ -63,7 +78,13 @@ export interface SwiftNativeTarget {
|
|
|
63
78
|
bridgingHeader: string | null
|
|
64
79
|
prefixHeader: string | null
|
|
65
80
|
headerSearchPaths: string[]
|
|
81
|
+
/** USER_HEADER_SEARCH_PATHS, which xcode searches as `-iquote` after the project map. */
|
|
82
|
+
userHeaderSearchPaths: string[]
|
|
66
83
|
frameworkSearchPaths: string[]
|
|
84
|
+
/** the own-target and project header maps, in xcode's search order. */
|
|
85
|
+
headerMaps: SwiftNativeHeaderMap[]
|
|
86
|
+
/** the product header overlay: each framework product path and the original file it names. */
|
|
87
|
+
productHeaders: Record<string, string>
|
|
67
88
|
flags: string[]
|
|
68
89
|
cxxFlags: string[]
|
|
69
90
|
fileFlags: Record<string, string[]>
|
|
@@ -87,7 +108,14 @@ export function isSwiftNativeTargets(value: unknown): value is SwiftNativeTarget
|
|
|
87
108
|
const perFile = field('fileFlags')
|
|
88
109
|
const directories = field('sourceDirectories')
|
|
89
110
|
const searches = field('headerSearchPaths')
|
|
111
|
+
const userSearches = field('userHeaderSearchPaths')
|
|
90
112
|
const frameworks = field('frameworkSearchPaths')
|
|
113
|
+
const maps = field('headerMaps')
|
|
114
|
+
const products = field('productHeaders')
|
|
115
|
+
const inputPath = (value: unknown) =>
|
|
116
|
+
typeof value === 'string' &&
|
|
117
|
+
value.startsWith(`${SWIFT_NATIVE_INPUT_ROOT}/`) &&
|
|
118
|
+
isSwiftResourcePath(value.slice(SWIFT_NATIVE_INPUT_ROOT.length + 1))
|
|
91
119
|
const deployment = field('deploymentTarget')
|
|
92
120
|
return (
|
|
93
121
|
typeof field('name') === 'string' &&
|
|
@@ -100,8 +128,34 @@ export function isSwiftNativeTargets(value: unknown): value is SwiftNativeTarget
|
|
|
100
128
|
nullablePath('prefixHeader') &&
|
|
101
129
|
strings(searches) &&
|
|
102
130
|
searches.every((item) => item === '.' || isSwiftResourcePath(item)) &&
|
|
131
|
+
strings(userSearches) &&
|
|
132
|
+
userSearches.every((item) => item === '.' || isSwiftResourcePath(item)) &&
|
|
103
133
|
strings(frameworks) &&
|
|
104
134
|
frameworks.every((item) => item === '.' || isSwiftResourcePath(item)) &&
|
|
135
|
+
Array.isArray(maps) &&
|
|
136
|
+
maps.every((map: unknown) => {
|
|
137
|
+
if (!map || typeof map !== 'object') return false
|
|
138
|
+
const flag: unknown = Reflect.get(map, 'flag')
|
|
139
|
+
const entries: unknown = Reflect.get(map, 'entries')
|
|
140
|
+
return (
|
|
141
|
+
(flag === '-I' || flag === '-iquote') &&
|
|
142
|
+
Array.isArray(entries) &&
|
|
143
|
+
entries.every(
|
|
144
|
+
(entry: unknown) =>
|
|
145
|
+
Array.isArray(entry) &&
|
|
146
|
+
entry.length === 2 &&
|
|
147
|
+
typeof entry[0] === 'string' &&
|
|
148
|
+
!entry[0].includes('\0') &&
|
|
149
|
+
(inputPath(entry[1]) || isSwiftResourcePath(entry[1])),
|
|
150
|
+
)
|
|
151
|
+
)
|
|
152
|
+
}) &&
|
|
153
|
+
!!products &&
|
|
154
|
+
typeof products === 'object' &&
|
|
155
|
+
!Array.isArray(products) &&
|
|
156
|
+
Object.entries(products).every(
|
|
157
|
+
([product, file]) => isSwiftResourcePath(product) && isSwiftResourcePath(file),
|
|
158
|
+
) &&
|
|
105
159
|
strings(field('flags')) &&
|
|
106
160
|
strings(field('cxxFlags')) &&
|
|
107
161
|
!!perFile &&
|
package/src/vite-plugin-one.ts
CHANGED
|
@@ -39,6 +39,7 @@ import {
|
|
|
39
39
|
SOOTSIM_RUNTIME_MISSING_MESSAGE,
|
|
40
40
|
} from './runtime-assets'
|
|
41
41
|
import { SWIFT_HMR_PATH, SWIFT_PACKAGE_PATH } from './swift-submit'
|
|
42
|
+
import { swiftViteLifetime } from './swift-vite-lifetime'
|
|
42
43
|
import type { OneWidgetPackage } from './oneWidgetContract'
|
|
43
44
|
import type { PeachPluginOptions } from './vite'
|
|
44
45
|
import type { IncomingMessage, ServerResponse } from 'node:http'
|
|
@@ -70,6 +71,7 @@ const loadKotlinHost = () => (kotlinHost ??= import('peachsim/kotlin-host'))
|
|
|
70
71
|
|
|
71
72
|
export function peachPlugin(options: PeachPluginOptions = {}): Plugin {
|
|
72
73
|
const prefix = options.prefix || '/__peachsim'
|
|
74
|
+
let closeSwiftHost: (() => Promise<void>) | undefined
|
|
73
75
|
|
|
74
76
|
return {
|
|
75
77
|
name: 'sootsim-one',
|
|
@@ -106,8 +108,15 @@ export function peachPlugin(options: PeachPluginOptions = {}): Plugin {
|
|
|
106
108
|
return { optimizeDeps: { include: ['use-latest-callback'] } }
|
|
107
109
|
},
|
|
108
110
|
|
|
111
|
+
async closeBundle() {
|
|
112
|
+
await closeSwiftHost?.()
|
|
113
|
+
},
|
|
114
|
+
|
|
109
115
|
async configureServer(server) {
|
|
110
116
|
if (options.enabled === false) return
|
|
117
|
+
const lifetime = swiftViteLifetime(server)
|
|
118
|
+
const { signal, compiles: swiftCompiles, projects: swiftProjects } = lifetime
|
|
119
|
+
closeSwiftHost = () => lifetime.close()
|
|
111
120
|
// a native bundle carries the install it was built from, as hosted
|
|
112
121
|
// bundles do: any shell that launches it, including one that found this
|
|
113
122
|
// server by scanning, learns the installed native package versions. a
|
|
@@ -231,21 +240,33 @@ export function peachPlugin(options: PeachPluginOptions = {}): Plugin {
|
|
|
231
240
|
packageName: string,
|
|
232
241
|
moduleRoot: string | undefined,
|
|
233
242
|
) => {
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
packagePath
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
243
|
+
const pending = (async () => {
|
|
244
|
+
signal.throwIfAborted()
|
|
245
|
+
const packagePath = await servedPackage(packageName)
|
|
246
|
+
if (!packagePath) throw new Error(`swift package ${packageName} was not found`)
|
|
247
|
+
swiftProjects.add(packagePath)
|
|
248
|
+
const host = await loadSwiftHost()
|
|
249
|
+
const metadata = await host.swiftPackageMetadata(
|
|
250
|
+
packagePath,
|
|
251
|
+
packageName,
|
|
252
|
+
moduleRoot,
|
|
253
|
+
devOrigin(),
|
|
254
|
+
undefined,
|
|
255
|
+
signal,
|
|
256
|
+
)
|
|
257
|
+
return {
|
|
258
|
+
...metadata,
|
|
259
|
+
hmrPath,
|
|
260
|
+
...(packageName === host.ONE_WIDGET_PACKAGE && widgetPackage
|
|
261
|
+
? { widget: widgetPackage.widget }
|
|
262
|
+
: {}),
|
|
263
|
+
}
|
|
264
|
+
})()
|
|
265
|
+
swiftCompiles.add(pending)
|
|
266
|
+
try {
|
|
267
|
+
return await pending
|
|
268
|
+
} finally {
|
|
269
|
+
swiftCompiles.delete(pending)
|
|
249
270
|
}
|
|
250
271
|
}
|
|
251
272
|
const wsOptions = server.config.server.ws
|
package/src/vite-plugin-swift.ts
CHANGED
|
@@ -18,12 +18,14 @@ import {
|
|
|
18
18
|
type SwiftProject,
|
|
19
19
|
} from './swift-host'
|
|
20
20
|
import { swiftNativeEntry } from './swift-submit'
|
|
21
|
+
import { swiftViteLifetime } from './swift-vite-lifetime'
|
|
21
22
|
import type { Plugin, ViteDevServer } from 'vite'
|
|
22
23
|
|
|
23
24
|
export {
|
|
24
25
|
buildSwiftBundleFiles,
|
|
25
26
|
buildSwiftResourceTable,
|
|
26
27
|
compileInput,
|
|
28
|
+
disposeSwiftProject,
|
|
27
29
|
entryRootId,
|
|
28
30
|
linkedModuleRoots,
|
|
29
31
|
serveSwiftPackageAsset,
|
|
@@ -82,6 +84,7 @@ export interface SwiftPluginOptions {
|
|
|
82
84
|
}
|
|
83
85
|
|
|
84
86
|
export function swiftPlugin(options: SwiftPluginOptions = {}): Plugin {
|
|
87
|
+
let lifetime: ReturnType<typeof swiftViteLifetime> | undefined
|
|
85
88
|
return {
|
|
86
89
|
name: 'rnx-swift',
|
|
87
90
|
enforce: 'pre',
|
|
@@ -118,13 +121,16 @@ export function swiftPlugin(options: SwiftPluginOptions = {}): Plugin {
|
|
|
118
121
|
|
|
119
122
|
async load(id) {
|
|
120
123
|
if (!id.startsWith(VIRTUAL_PREFIX)) return null
|
|
124
|
+
const owner = lifetime
|
|
125
|
+
owner?.signal.throwIfAborted()
|
|
121
126
|
const file = id.slice(VIRTUAL_PREFIX.length)
|
|
122
127
|
// the module is the whole package's artifact, so an import of a file
|
|
123
128
|
// that was deleted would keep answering with it. a deleted .tsx fails
|
|
124
129
|
// its importer; so does a deleted .swift.
|
|
125
130
|
if (!fs.existsSync(file)) throw new Error(`swift source ${file} no longer exists`)
|
|
126
131
|
const packagePath = options.packagePath ?? packageFor(file)
|
|
127
|
-
const project = projectFor(packagePath)
|
|
132
|
+
const project = projectFor(packagePath, undefined, owner?.signal)
|
|
133
|
+
owner?.projects.add(project.packagePath)
|
|
128
134
|
const entry = path.relative(packagePath, file).split(path.sep).join(path.posix.sep)
|
|
129
135
|
// every source in the package is a dependency of this module, so a
|
|
130
136
|
// bundler watching this module learns about a `.swift` edit and re-runs
|
|
@@ -148,17 +154,25 @@ export function swiftPlugin(options: SwiftPluginOptions = {}): Plugin {
|
|
|
148
154
|
this.addWatchFile(path.join(moduleRoot, relative))
|
|
149
155
|
let artifact: SwiftArtifact
|
|
150
156
|
try {
|
|
151
|
-
|
|
157
|
+
const pending = artifactFor(project, entry)
|
|
158
|
+
owner?.compiles.add(pending)
|
|
159
|
+
try {
|
|
160
|
+
artifact = await pending
|
|
161
|
+
} finally {
|
|
162
|
+
owner?.compiles.delete(pending)
|
|
163
|
+
}
|
|
152
164
|
} catch (error) {
|
|
153
165
|
// a compile error must not fail this module. a module whose load threw
|
|
154
166
|
// leaves the graph unwatched, so the edit that fixes the error would
|
|
155
167
|
// never rebuild it and the app would sit on a stale frame until the
|
|
156
168
|
// dev server restarted. the previous artifact keeps rendering, and the
|
|
157
169
|
// error is reported here instead.
|
|
170
|
+
owner?.signal.throwIfAborted()
|
|
158
171
|
if (!project.artifact) throw error
|
|
159
172
|
this.warn(error instanceof Error ? error.message : String(error))
|
|
160
173
|
artifact = project.artifact
|
|
161
174
|
}
|
|
175
|
+
owner?.signal.throwIfAborted()
|
|
162
176
|
const resources = resolveSwiftImageResourceUrls(
|
|
163
177
|
artifact.package.resources.table,
|
|
164
178
|
serverOrigin(),
|
|
@@ -190,8 +204,13 @@ export function swiftPlugin(options: SwiftPluginOptions = {}): Plugin {
|
|
|
190
204
|
})
|
|
191
205
|
},
|
|
192
206
|
|
|
207
|
+
async closeBundle() {
|
|
208
|
+
await lifetime?.close()
|
|
209
|
+
},
|
|
210
|
+
|
|
193
211
|
configureServer(server) {
|
|
194
212
|
devServer = server
|
|
213
|
+
lifetime = swiftViteLifetime(server)
|
|
195
214
|
|
|
196
215
|
server.middlewares.use((req, res, next) => {
|
|
197
216
|
if (!serveSwiftPackageAsset((req.url ?? '').split('?')[0], res)) next()
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
// xcode's generated header search inputs, written once for every compile that
|
|
2
|
+
// consumes them: each target's header maps and the project's product header
|
|
3
|
+
// overlay, in the order xcode passes them to clang.
|
|
4
|
+
|
|
5
|
+
import fs from 'node:fs'
|
|
6
|
+
import path from 'node:path'
|
|
7
|
+
import type { SwiftNativeHeaderMap } from './swiftContract'
|
|
8
|
+
|
|
9
|
+
// clang's header map format: case-insensitive keys hashed into a power-of-two
|
|
10
|
+
// bucket table, each value split into a prefix and suffix string.
|
|
11
|
+
function headerMap(entries: readonly (readonly [string, string])[]): Buffer {
|
|
12
|
+
const unique = new Map<string, readonly [string, string]>()
|
|
13
|
+
for (const entry of entries)
|
|
14
|
+
if (!unique.has(entry[0].toLowerCase())) unique.set(entry[0].toLowerCase(), entry)
|
|
15
|
+
let buckets = 8
|
|
16
|
+
while (buckets < unique.size * 2) buckets *= 2
|
|
17
|
+
const strings: Buffer[] = [Buffer.alloc(1)]
|
|
18
|
+
let length = 1
|
|
19
|
+
const offsets = new Map<string, number>()
|
|
20
|
+
const offset = (text: string): number => {
|
|
21
|
+
const known = offsets.get(text)
|
|
22
|
+
if (known !== undefined) return known
|
|
23
|
+
const at = length
|
|
24
|
+
const bytes = Buffer.from(`${text}\0`)
|
|
25
|
+
offsets.set(text, at)
|
|
26
|
+
strings.push(bytes)
|
|
27
|
+
length += bytes.length
|
|
28
|
+
return at
|
|
29
|
+
}
|
|
30
|
+
const table = Buffer.alloc(24 + buckets * 12)
|
|
31
|
+
let longest = 0
|
|
32
|
+
for (const [lower, [key, value]] of unique) {
|
|
33
|
+
let bucket = 0
|
|
34
|
+
for (const character of Buffer.from(lower)) bucket = (bucket + character * 13) >>> 0
|
|
35
|
+
bucket &= buckets - 1
|
|
36
|
+
while (table.readUInt32LE(24 + bucket * 12) !== 0)
|
|
37
|
+
bucket = (bucket + 1) & (buckets - 1)
|
|
38
|
+
const split = value.lastIndexOf('/') + 1
|
|
39
|
+
table.writeUInt32LE(offset(key), 24 + bucket * 12)
|
|
40
|
+
table.writeUInt32LE(offset(value.slice(0, split)), 28 + bucket * 12)
|
|
41
|
+
table.writeUInt32LE(offset(value.slice(split)), 32 + bucket * 12)
|
|
42
|
+
longest = Math.max(longest, Buffer.byteLength(value))
|
|
43
|
+
}
|
|
44
|
+
table.writeUInt32LE(0x686d6170, 0)
|
|
45
|
+
table.writeUInt16LE(1, 4)
|
|
46
|
+
table.writeUInt32LE(table.length, 8)
|
|
47
|
+
table.writeUInt32LE(unique.size, 12)
|
|
48
|
+
table.writeUInt32LE(buckets, 16)
|
|
49
|
+
table.writeUInt32LE(longest, 20)
|
|
50
|
+
return Buffer.concat([table, ...strings])
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* writes the overlay and maps into `directory` and returns each target's
|
|
55
|
+
* flags: `-I` maps, the overlay, `-iquote` maps, then user header search
|
|
56
|
+
* paths as `-iquote`. every path is already where the compile reads it; a map
|
|
57
|
+
* value that is not absolute is a framework include and stays as written.
|
|
58
|
+
*/
|
|
59
|
+
export function writeXcodeHeaderSearch(
|
|
60
|
+
directory: string,
|
|
61
|
+
targets: readonly {
|
|
62
|
+
headerMaps: readonly SwiftNativeHeaderMap[]
|
|
63
|
+
productHeaders: Readonly<Record<string, string>>
|
|
64
|
+
userHeaderSearchPaths: readonly string[]
|
|
65
|
+
}[],
|
|
66
|
+
): { files: string[]; flags: string[][] } {
|
|
67
|
+
fs.mkdirSync(directory, { recursive: true })
|
|
68
|
+
// each framework directory lists the original headers and module map it
|
|
69
|
+
// publishes, so a header reached by its framework path and by its own path
|
|
70
|
+
// is one file.
|
|
71
|
+
const productDirectories = new Map<string, { name: string; file: string }[]>()
|
|
72
|
+
for (const target of targets)
|
|
73
|
+
for (const [product, file] of Object.entries(target.productHeaders)) {
|
|
74
|
+
const listed = productDirectories.get(path.dirname(product)) ?? []
|
|
75
|
+
productDirectories.set(path.dirname(product), listed)
|
|
76
|
+
listed.push({ name: path.basename(product), file })
|
|
77
|
+
}
|
|
78
|
+
const overlay = path.join(directory, 'all-product-headers.yaml')
|
|
79
|
+
fs.writeFileSync(
|
|
80
|
+
overlay,
|
|
81
|
+
JSON.stringify({
|
|
82
|
+
'case-sensitive': 'false',
|
|
83
|
+
roots: [...productDirectories].map(([name, files]) => ({
|
|
84
|
+
contents: files.map((entry) => ({
|
|
85
|
+
'external-contents': entry.file,
|
|
86
|
+
name: entry.name,
|
|
87
|
+
type: 'file',
|
|
88
|
+
})),
|
|
89
|
+
name,
|
|
90
|
+
type: 'directory',
|
|
91
|
+
})),
|
|
92
|
+
version: 0,
|
|
93
|
+
}),
|
|
94
|
+
)
|
|
95
|
+
const files = [overlay]
|
|
96
|
+
const flags = targets.map((target, index) => {
|
|
97
|
+
const maps = target.headerMaps.map((map, order) => {
|
|
98
|
+
const file = path.join(directory, `${index}-${order}.hmap`)
|
|
99
|
+
fs.writeFileSync(file, headerMap(map.entries))
|
|
100
|
+
files.push(file)
|
|
101
|
+
return { flag: map.flag, file }
|
|
102
|
+
})
|
|
103
|
+
return [
|
|
104
|
+
...maps.filter((map) => map.flag === '-I').flatMap((map) => [map.flag, map.file]),
|
|
105
|
+
'-ivfsoverlay',
|
|
106
|
+
overlay,
|
|
107
|
+
...maps
|
|
108
|
+
.filter((map) => map.flag === '-iquote')
|
|
109
|
+
.flatMap((map) => [map.flag, map.file]),
|
|
110
|
+
...target.userHeaderSearchPaths.flatMap((directory) => ['-iquote', directory]),
|
|
111
|
+
]
|
|
112
|
+
})
|
|
113
|
+
return { files, flags }
|
|
114
|
+
}
|
package/src/xcode-project.ts
CHANGED
|
@@ -15,6 +15,7 @@ import plist from 'plist'
|
|
|
15
15
|
import { readXcodeJsonProject } from './xcode-json-project'
|
|
16
16
|
import { visitXcodeTargetMembers, xcodePathResolver } from './xcode-target-members'
|
|
17
17
|
import type { SwiftLinkedProduct } from './swift-packages'
|
|
18
|
+
import type { SwiftNativeHeaderMap } from './swiftContract'
|
|
18
19
|
|
|
19
20
|
export {
|
|
20
21
|
parseOpenStepPlist,
|
|
@@ -57,6 +58,8 @@ export interface XcodeModuleTarget {
|
|
|
57
58
|
prefixHeader: string | null
|
|
58
59
|
bridgingHeader: string | null
|
|
59
60
|
headerSearchPaths: string[]
|
|
61
|
+
/** USER_HEADER_SEARCH_PATHS, which xcode searches as `-iquote` after the project map. */
|
|
62
|
+
userHeaderSearchPaths: string[]
|
|
60
63
|
frameworkSearchPaths: string[]
|
|
61
64
|
flags: string[]
|
|
62
65
|
cxxFlags: string[]
|
|
@@ -66,7 +69,7 @@ export interface XcodeModuleTarget {
|
|
|
66
69
|
* own-target map as `-I`, then the project map as `-iquote`. a value is
|
|
67
70
|
* an absolute header or a framework include `Product/Header.h`.
|
|
68
71
|
*/
|
|
69
|
-
headerMaps:
|
|
72
|
+
headerMaps: SwiftNativeHeaderMap[]
|
|
70
73
|
/** what xcode publishes in the target's framework product: product path to original file. */
|
|
71
74
|
productHeaders: Record<string, string>
|
|
72
75
|
}
|
|
@@ -1276,14 +1279,91 @@ export function readXcodeAppTarget(
|
|
|
1276
1279
|
)
|
|
1277
1280
|
for (const file of read) xcconfigs.add(file)
|
|
1278
1281
|
const swiftVersion = Number.parseFloat(settings('SWIFT_VERSION') || '5')
|
|
1279
|
-
const { headers, ...members } = targetMembers(
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1282
|
+
const { headers, allSources, ...members } = targetMembers(
|
|
1283
|
+
ref,
|
|
1284
|
+
settings,
|
|
1285
|
+
options,
|
|
1286
|
+
keys,
|
|
1287
|
+
xcconfigs,
|
|
1283
1288
|
)
|
|
1289
|
+
const searchRules = recursiveSearchRules(settings)
|
|
1284
1290
|
const absolute = (file: string) => path.resolve(ref.project.projectDir, file)
|
|
1285
1291
|
const framework = FRAMEWORK_PRODUCTS.has(str(ref.target.productType) ?? '')
|
|
1286
1292
|
const product = settings('PRODUCT_NAME')
|
|
1293
|
+
const building = options.prepareGeneratedSources && options.requireSources !== false
|
|
1294
|
+
// apple-generic versioning compiles one more unit xcode writes into
|
|
1295
|
+
// DERIVED_FILE_DIR, defining the product's version string and number, for
|
|
1296
|
+
// every target that compiles sources, swift-only ones included.
|
|
1297
|
+
const versioning =
|
|
1298
|
+
building &&
|
|
1299
|
+
allSources.length > 0 &&
|
|
1300
|
+
settings('VERSIONING_SYSTEM') === 'apple-generic'
|
|
1301
|
+
? path.join(settings('DERIVED_FILE_DIR'), `${product}_vers.c`)
|
|
1302
|
+
: null
|
|
1303
|
+
if (versioning) {
|
|
1304
|
+
const version = settings('CURRENT_PROJECT_VERSION')
|
|
1305
|
+
const custom = [
|
|
1306
|
+
'VERSION_INFO_FILE',
|
|
1307
|
+
'VERSION_INFO_STRING',
|
|
1308
|
+
'VERSION_INFO_BUILDER',
|
|
1309
|
+
'VERSION_INFO_EXPORT_DECL',
|
|
1310
|
+
'VERSION_INFO_PREFIX',
|
|
1311
|
+
'VERSION_INFO_SUFFIX',
|
|
1312
|
+
].filter((key) => settings(key))
|
|
1313
|
+
if (!/^\d+$/.test(version) || !/^[A-Za-z_]\w*$/.test(product) || custom.length)
|
|
1314
|
+
throw new Error(
|
|
1315
|
+
`${name}: Xcode generates ${path.basename(versioning)} for VERSIONING_SYSTEM=apple-generic; peach writes it only for an integer CURRENT_PROJECT_VERSION (${JSON.stringify(version)}), an identifier PRODUCT_NAME (${JSON.stringify(product)}) and no ${custom.length ? custom.join(', ') : 'VERSION_INFO_* override'}`,
|
|
1316
|
+
)
|
|
1317
|
+
const unit = [
|
|
1318
|
+
` extern const unsigned char ${product}VersionString[];`,
|
|
1319
|
+
` extern const double ${product}VersionNumber;`,
|
|
1320
|
+
'',
|
|
1321
|
+
` const unsigned char ${product}VersionString[] __attribute__ ((used)) = "@(#)PROGRAM:${product} PROJECT:${settings('PROJECT_NAME')}-${version}" "\\n";`,
|
|
1322
|
+
` const double ${product}VersionNumber __attribute__ ((used)) = (double)${version}.;`,
|
|
1323
|
+
'',
|
|
1324
|
+
].join('\n')
|
|
1325
|
+
if (!fs.existsSync(versioning) || fs.readFileSync(versioning, 'utf8') !== unit) {
|
|
1326
|
+
fs.mkdirSync(path.dirname(versioning), { recursive: true })
|
|
1327
|
+
fs.writeFileSync(versioning, unit)
|
|
1328
|
+
}
|
|
1329
|
+
allSources.push(versioning)
|
|
1330
|
+
}
|
|
1331
|
+
// any c-family unit, the versioning unit included, takes the objective-c
|
|
1332
|
+
// implementation route.
|
|
1333
|
+
const implementations = allSources.filter((file) =>
|
|
1334
|
+
/\.(c|cc|cpp|cxx|m|mm)$/.test(file),
|
|
1335
|
+
)
|
|
1336
|
+
const native = implementations.length > 0
|
|
1337
|
+
// the header search xcode generates that peach does not model refuses
|
|
1338
|
+
// here, before any unit compiles without it.
|
|
1339
|
+
if (native && building) {
|
|
1340
|
+
const generatedHeaders = list(ref.target.buildPhases).flatMap((phaseId) => {
|
|
1341
|
+
const phase = ref.project.object(phaseId)
|
|
1342
|
+
return phase?.isa === 'PBXShellScriptBuildPhase'
|
|
1343
|
+
? list(phase.outputPaths).filter((output) => HEADER_FILE.test(output))
|
|
1344
|
+
: []
|
|
1345
|
+
})
|
|
1346
|
+
if (generatedHeaders.length > 0 || list(ref.target.buildRules).length > 0)
|
|
1347
|
+
throw new Error(
|
|
1348
|
+
`${name}: Xcode's generated-files header map, which lists headers its build rules and Run Script phases generate (${generatedHeaders.join(', ') || 'build rules'}), is not modeled`,
|
|
1349
|
+
)
|
|
1350
|
+
const nonFramework = nativeTargets(ref.project).find(
|
|
1351
|
+
(other) =>
|
|
1352
|
+
!FRAMEWORK_PRODUCTS.has(str(other.target.productType) ?? '') &&
|
|
1353
|
+
headerPhase(other).length > 0,
|
|
1354
|
+
)
|
|
1355
|
+
if (nonFramework && settings('USE_HEADERMAP') !== 'NO')
|
|
1356
|
+
throw new Error(
|
|
1357
|
+
`${name}: Xcode's all-non-framework-target-headers map, which lists the headers of ${str(nonFramework.target.name) ?? nonFramework.id}, is not modeled`,
|
|
1358
|
+
)
|
|
1359
|
+
if (
|
|
1360
|
+
settings('ALWAYS_SEARCH_USER_PATHS') === 'YES' &&
|
|
1361
|
+
settings('USER_HEADER_SEARCH_PATHS').trim()
|
|
1362
|
+
)
|
|
1363
|
+
throw new Error(
|
|
1364
|
+
`${name}: ALWAYS_SEARCH_USER_PATHS=YES also searches USER_HEADER_SEARCH_PATHS for angle-bracket includes, which is not modeled`,
|
|
1365
|
+
)
|
|
1366
|
+
}
|
|
1287
1367
|
const headerFiles = headerPhase(ref)
|
|
1288
1368
|
// the own-target map: a published header by its framework include, a
|
|
1289
1369
|
// project header by its path under both its name and the framework's.
|
|
@@ -1325,11 +1405,12 @@ export function readXcodeAppTarget(
|
|
|
1325
1405
|
name,
|
|
1326
1406
|
moduleName: applyOperator(settings('PRODUCT_MODULE_NAME'), 'c99extidentifier'),
|
|
1327
1407
|
...members,
|
|
1408
|
+
allSources,
|
|
1328
1409
|
languageMode: swiftVersion >= 6 ? 6 : 5,
|
|
1329
1410
|
mainActorIsolation: settings('SWIFT_DEFAULT_ACTOR_ISOLATION') === 'MainActor',
|
|
1330
1411
|
defines: compilationConditions(settings),
|
|
1331
1412
|
iosDeploymentTarget: settings('IPHONEOS_DEPLOYMENT_TARGET') || null,
|
|
1332
|
-
...(
|
|
1413
|
+
...(native
|
|
1333
1414
|
? {
|
|
1334
1415
|
objc: {
|
|
1335
1416
|
publicHeaders: headerFiles.flatMap(({ file, visibility }) =>
|
|
@@ -1352,10 +1433,23 @@ export function readXcodeAppTarget(
|
|
|
1352
1433
|
bridgingHeader: settings('SWIFT_OBJC_BRIDGING_HEADER')
|
|
1353
1434
|
? absolute(settings('SWIFT_OBJC_BRIDGING_HEADER'))
|
|
1354
1435
|
: null,
|
|
1436
|
+
// xcode searches its products' include directory before
|
|
1437
|
+
// HEADER_SEARCH_PATHS and the target's derived sources after.
|
|
1355
1438
|
headerSearchPaths: [
|
|
1356
|
-
|
|
1357
|
-
...settingList(settings('
|
|
1358
|
-
|
|
1439
|
+
path.join(settings('BUILT_PRODUCTS_DIR'), 'include'),
|
|
1440
|
+
...settingList(settings('HEADER_SEARCH_PATHS')).flatMap((raw) =>
|
|
1441
|
+
expandSearchPath(absolute(raw), searchRules),
|
|
1442
|
+
),
|
|
1443
|
+
path.join(
|
|
1444
|
+
`${settings('DERIVED_FILE_DIR')}-normal`,
|
|
1445
|
+
settings('CURRENT_ARCH'),
|
|
1446
|
+
),
|
|
1447
|
+
path.join(settings('DERIVED_FILE_DIR'), settings('CURRENT_ARCH')),
|
|
1448
|
+
settings('DERIVED_FILE_DIR'),
|
|
1449
|
+
],
|
|
1450
|
+
userHeaderSearchPaths: settingList(
|
|
1451
|
+
settings('USER_HEADER_SEARCH_PATHS'),
|
|
1452
|
+
).flatMap((raw) => expandSearchPath(absolute(raw), searchRules)),
|
|
1359
1453
|
// xcode searches the target's own products directory first
|
|
1360
1454
|
frameworkSearchPaths: [
|
|
1361
1455
|
settings('BUILT_PRODUCTS_DIR'),
|