akkyie / XPM

[WIP] Generate XCFrameworks from Package.swift

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

XPM

Swift 5.1 Swift Package Manager GitHub Actions

Generate XCFrameworks from Swift Package Manager dependency.

XPM utilizes Swift Package Manager to resolve the dependency graph and checking repositories out. Packages/frameworks maintainers have to do nothing other than putting Package.swift in the repository.

Usage

When you have a package:

let package = Package(
    name: "Some",
    dependencies: [
        .package(url: "https://github.com/Foo/Foo.git", from: "..."),
        .package(url: "https://github.com/Bar/Bar.git", from: "..."),
    ],
    targets: [
        .target(
            name: "SomeKit",
            dependencies: ["Foo"]
        ),
        .target(
            name: "SomeCore",
            dependencies: ["Bar"]
        ),
    ]
)

Build XCFrameworks from the package

Run xpm build to export SomeKit.xcframework and SomeCore.xcframework, along with Foo.xcframework and Bar.xcframework.

$ swift run xpm build --platforms ios,iphonesimulator,macos --output Frameworks

Build XCFrameworks from dependencies of a target

Run xpm build with --dependency-of <targetName> option to export just Foo.xcframework.

$ swift run xpm build --dependency-of SomeKit --platforms ios,iphonesimulator,macos --output Frameworks

About

[WIP] Generate XCFrameworks from Package.swift

License:MIT License


Languages

Language:Swift 99.5%Language:Shell 0.5%