Swift Package Manager: How to build a framework?

Viewed 32

I am trying to use a Swift Package Manager to produce a framework.

I have a target, and then a library product for the platform of iOS 13.

let package = Package(
    name: "SPMBasedA",
    platforms: [.iOS(.v13)],
    products: [
        .library(name: "SPMBasedA",
                 type: .dynamic,
                 targets: ["SPMBasedA"])
    ],
    targets: [
        .target(name: "SPMBasedA")
    ]
)

My problem is that, when I swift build, the library product produces either an archive .a or a dynamically loadable library, .dylib.

But I want a static Swift framework. How do I make an SPM project to compile into a .framework?

0 Answers
Related