flowsdk 0.5.2

Safety-first, realistic, behavior-predictable messaging SDK for MQTT and more.
Documentation
// swift-tools-version: 5.8
// SPDX-License-Identifier: MPL-2.0

import PackageDescription

let package = Package(
    name: "FlowSDK",
    platforms: [
        .macOS(.v12),
        .iOS(.v14),
    ],
    products: [
        .library(name: "FlowSDK", targets: ["FlowSDK"]),
        .executable(name: "TcpClientExample", targets: ["TcpClientExample"]),
        .executable(name: "QuicClientExample", targets: ["QuicClientExample"]),
    ],
    targets: [
        // C bridging target — wraps the raw FFI header generated by UniFFI.
        // SPM auto-generates a module map from flowsdk_ffi.h so the Swift
        // layer can `import flowsdk_ffi`.
        // The libflowsdk_ffi dylib/static lib must be on LIBRARY_PATH at link time;
        // run `./scripts/build_swift_bindings.sh` first to populate swift/lib/.
        .target(
            name: "flowsdk_ffi",
            path: "Sources/flowsdk_ffi",
            publicHeadersPath: "."
        ),

        // Swift UniFFI bindings — auto-generated by `uniffi-bindgen`.
        // Re-generate with: ./scripts/build_swift_bindings.sh
        .target(
            name: "FlowSDK",
            dependencies: ["flowsdk_ffi"],
            path: "Sources/FlowSDK",
            linkerSettings: [
                .linkedLibrary("flowsdk_ffi"),
            ]
        ),

        // Examples
        .executableTarget(
            name: "TcpClientExample",
            dependencies: ["FlowSDK"],
            path: "Examples/TcpClientExample"
        ),
        .executableTarget(
            name: "QuicClientExample",
            dependencies: ["FlowSDK"],
            path: "Examples/QuicClientExample"
        ),
    ]
)