@@ -6,7 +6,12 @@ let package = Package(
66 defaultLocalization: " en " ,
77 platforms: [ . iOS( . v18) , . macOS( . v15) ] ,
88 products: [
9- . library( name: " BluetoothExplorer " , type: . dynamic, targets: [ " BluetoothExplorer " ] )
9+ . library( name: " BluetoothExplorer " , type: . dynamic, targets: [ " BluetoothExplorer " ] ) ,
10+ // Guest-side SDK for authoring parser plugins, so consumers can depend on this package and
11+ // `import BLEPluginSDK` from their wasm plugin. It is not a dependency of the app, so the app
12+ // and the iOS archive never build it. Sources are shared with the standalone
13+ // `PluginSDK/BLEPluginSDK` package that the in-repo example plugins use.
14+ . library( name: " BLEPluginSDK " , targets: [ " BLEPluginSDK " ] )
1015 ] ,
1116 dependencies: [
1217 . package ( url: " https://github.com/PureSwift/GATT.git " , branch: " master " ) ,
@@ -87,6 +92,18 @@ let package = Package(
8792 ] ,
8893 resources: [ . process( " Resources " ) ]
8994 ) ,
95+ // Embedded-Swift-safe helpers for plugin authors: envelope decoding, a payload cursor, a
96+ // CBOR field builder, and the allocation/return glue. Built in Embedded mode (it compiles
97+ // for the host too, though nothing runs it there).
98+ . target(
99+ name: " BLEPluginSDK " ,
100+ path: " PluginSDK/BLEPluginSDK/Sources/BLEPluginSDK " ,
101+ swiftSettings: [
102+ . enableExperimentalFeature( " Embedded " ) ,
103+ . enableExperimentalFeature( " Extern " ) ,
104+ . unsafeFlags( [ " -wmo " ] )
105+ ]
106+ ) ,
90107 . testTarget(
91108 name: " BluetoothExplorerPluginEngineTests " ,
92109 dependencies: [
0 commit comments