Distribute different binary target in SwiftPM using different configuration

I have multiple Flutter xcframework that I want to version by creating a Swift Package. However I have two binaries for each configuration. One for release and one for debug. How do I create a package that chooses the target depending on the configuration?

If it helps to visualize:

let package = Package(
    name: "MyPackage",
    products: [
        .library(
            name: "MyPackage",
            targets: ["MyPackage",
                      "App-Release" /* if config is debug, chooses App-Debug */]),
    ],
    dependencies: [],
    targets: [
 depends on.
        .target(
            name: "MyPackages",
            dependencies: []),
        .binaryTarget(name: "App-Release",
                      path: "Sources/Release/App.xcframework"),
        .binaryTarget(name: "App-Debug",
                      path: "Sources/Debug/App.xcframework")
    ]
)

This isn't possible at this time.

Are there any news on this topic.
We are using a security framework which has different version for debug and release builds.

Or are there any other ways to achieve this?

I have the same problem with an SDK with Debug and Release versions. Couldn't find any solution yet.

1 Like