|
1 | 1 | // swift-tools-version: 5.9 |
2 | 2 | import PackageDescription |
3 | 3 |
|
| 4 | +// Module layout — the iOS app is Xcode-built (Columba.xcodeproj), with |
| 5 | +// configure-xcodeproj.rb pulling files in by path. This SwiftPM manifest |
| 6 | +// exists for two reasons: |
| 7 | +// |
| 8 | +// 1. The Xcode project references this manifest as a LOCAL package |
| 9 | +// (XCLocalSwiftPackageReference) so RNSAPI / SwiftBLEBridge get built by |
| 10 | +// SwiftPM rather than hand-written pbxproj entries. |
| 11 | +// 2. `swift build` (used by tooling + CI) can still typecheck the pure-Swift |
| 12 | +// libraries without the Python.xcframework bridging header. |
| 13 | +// |
| 14 | +// The LXST voice stack (LXSTSwift + the Opus/Codec2 codec C trees) is no longer |
| 15 | +// vendored here — it lives in the standalone, transport-agnostic LXST-swift |
| 16 | +// package (consumed via SwiftPM, wired to RNS through Columba's |
| 17 | +// PythonNetworkTransport). See `dependencies` below. |
| 18 | +// |
| 19 | +// Targets that DO require the bridging header (PythonBridge, RNSBackendPy, |
| 20 | +// ColumbaApp) live ONLY in the pbxproj — they're not declared here. |
4 | 21 | let package = Package( |
5 | 22 | name: "ColumbaApp", |
6 | 23 | platforms: [ |
7 | 24 | .iOS(.v17), |
8 | 25 | .macOS(.v14) |
9 | 26 | ], |
10 | 27 | products: [ |
11 | | - .executable( |
12 | | - name: "ColumbaApp", |
13 | | - targets: ["ColumbaApp"] |
14 | | - ) |
| 28 | + .library(name: "RNSAPI", targets: ["RNSAPI"]), |
| 29 | + .library(name: "SwiftBLEBridge", targets: ["SwiftBLEBridge"]), |
15 | 30 | ], |
16 | 31 | dependencies: [ |
17 | | - // SPM resolves these from GitHub on every fresh checkout. To work |
18 | | - // against an in-progress local clone of any of these libraries |
19 | | - // without committing a path-override, drop a per-machine |
20 | | - // `.swiftpm/configuration/mirrors.json` mapping the URL to a local |
21 | | - // directory — see README "Local development against unreleased |
22 | | - // library changes" for the exact recipe. |
23 | | - .package(url: "https://github.com/torlando-tech/LXMF-swift.git", from: "0.4.0"), |
24 | | - .package(url: "https://github.com/torlando-tech/LXST-swift.git", from: "0.2.0"), |
25 | | - .package(url: "https://github.com/torlando-tech/reticulum-swift.git", from: "0.3.0"), |
26 | | - .package(url: "https://github.com/maplibre/maplibre-gl-native-distribution", from: "6.9.0"), |
| 32 | + // Transport-agnostic LXST voice library (owns the Opus/Codec2 codecs |
| 33 | + // and the NetworkTransport seam; no Reticulum dependency). Columba |
| 34 | + // provides the implementation via PythonNetworkTransport. Tracking the |
| 35 | + // branch until a release is tagged — same model as the RNS fork. |
| 36 | + .package(url: "https://github.com/torlando-tech/LXST-swift.git", branch: "feat/transport-agnostic"), |
27 | 37 | ], |
28 | 38 | targets: [ |
29 | | - .executableTarget( |
30 | | - name: "ColumbaApp", |
31 | | - dependencies: [ |
32 | | - .product(name: "LXMFSwift", package: "LXMF-swift"), |
33 | | - .product(name: "LXSTSwift", package: "LXST-swift"), |
34 | | - // ReticulumSwift is imported directly by several view |
35 | | - // models (e.g. NomadNetBrowserViewModel, |
36 | | - // MessagingViewModel) — listed here as a direct product |
37 | | - // dep so the version constraint on the package above is |
38 | | - // actually exercised by SPM at resolution time. |
39 | | - .product(name: "ReticulumSwift", package: "reticulum-swift"), |
40 | | - .product(name: "MapLibre", package: "maplibre-gl-native-distribution"), |
41 | | - ], |
42 | | - path: "Sources/ColumbaApp" |
43 | | - ) |
| 39 | + // ──────── RNSAPI: pure-interface protocol surface ──────── |
| 40 | + .target( |
| 41 | + name: "RNSAPI", |
| 42 | + path: "Sources/RNSAPI", |
| 43 | + // libsqlite3 (system) backs LXMFDatabase's on-disk persistence. |
| 44 | + linkerSettings: [.linkedLibrary("sqlite3")] |
| 45 | + ), |
| 46 | + |
| 47 | + // ──────── SwiftBLEBridge: CoreBluetooth wrapper for ble-reticulum ── |
| 48 | + // Mirror of Columba Android's reticulum/ble module. Holds CBCentralManager |
| 49 | + // + CBPeripheralManager state and exposes a Swift API that the iOS BLE |
| 50 | + // driver (app/ble/ios_ble_driver.py) calls into. The Python ↔ Swift |
| 51 | + // callback invocation path lives separately in the pbxproj-only |
| 52 | + // `PythonBLECallbackBridge.swift` (which needs Python.h); SwiftBLEBridge |
| 53 | + // itself is pure CoreBluetooth so `swift build` compiles it cleanly. |
| 54 | + .target( |
| 55 | + name: "SwiftBLEBridge", |
| 56 | + dependencies: ["RNSAPI"], |
| 57 | + path: "Sources/SwiftBLEBridge" |
| 58 | + ), |
| 59 | + // Pure-Swift unit tests for RNSAPI (msgpack, AppDataParser, |
| 60 | + // PropagationNodeInfo). Runs natively via `swift test` on macOS — no |
| 61 | + // simulator / Xcode test target needed (RNSAPI has no UIKit/Python deps). |
| 62 | + .testTarget( |
| 63 | + name: "RNSAPITests", |
| 64 | + dependencies: ["RNSAPI"], |
| 65 | + path: "Tests/RNSAPITests" |
| 66 | + ), |
44 | 67 | ] |
45 | 68 | ) |
0 commit comments