From 2327fbb6e7ff5288a9742a55f0a9d7881913de6d Mon Sep 17 00:00:00 2001 From: serpixel <5087962+serpixel@users.noreply.github.com> Date: Mon, 5 Oct 2026 20:10:41 +0200 Subject: [PATCH] Add Swift Package Manager manifest Declares the iOS sources the CocoaPods podspec already ships as a two-target library (pure-Swift body + the single marker ObjC file). Needed so react-native-ble-plx can consume this adapter under React Native 0.87 SwiftPM autolinking, where pods without a manifest cannot participate in the package graph. --- Package.swift | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Package.swift diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..1f6f20c --- /dev/null +++ b/Package.swift @@ -0,0 +1,48 @@ +// swift-tools-version: 6.0 +import PackageDescription + +// Swift Package Manager manifest for the iOS sources the CocoaPods podspec +// ships (`source_files = "iOS/classes/**/*.{h,m,swift}", "iOS/RxBluetoothKit/**", +// "iOS/RxSwift/**"`). The single ObjC file is an empty marker class, so the +// manifest splits it from the pure-Swift body into a two-target library; no +// source changes are needed. RxSwift and RxBluetoothKit are vendored in-tree +// exactly as the podspec compiles them (Swift 5 language mode). +let package = Package( + name: "MultiplatformBleAdapter", + platforms: [.iOS(.v13)], + products: [ + .library( + name: "MultiplatformBleAdapter", + targets: ["MultiplatformBleAdapterKit", "MultiplatformBleAdapter"] + ), + ], + targets: [ + .target( + name: "MultiplatformBleAdapterKit", + path: "iOS", + exclude: [ + "MultiPlatformBLEAdapter-Bridging-Header.h", + "MultiPlatformBLEAdapter.xcodeproj", + "classes/MultiPlatformBLEAdapter.h", + "classes/MultiPlatformBLEAdapter.m", + ], + sources: ["classes", "RxBluetoothKit", "RxSwift"], + linkerSettings: [ + .linkedFramework("CoreBluetooth"), + .linkedFramework("Foundation"), + ] + ), + .target( + name: "MultiplatformBleAdapter", + dependencies: ["MultiplatformBleAdapterKit"], + path: "iOS/classes", + sources: ["MultiPlatformBLEAdapter.h", "MultiPlatformBLEAdapter.m"], + publicHeadersPath: ".", + linkerSettings: [ + .linkedFramework("CoreBluetooth"), + .linkedFramework("Foundation"), + ] + ), + ], + swiftLanguageModes: [.v5] +)