touchlab / KMMBridge

KMMBridge is a tool that helps publish Kotlin Multiplatform (KMP) Xcode binaries for use from Swift Package Manager (SPM) and CocoaPods.
https://touchlab.co/kmmbridge/
Apache License 2.0
357 stars 20 forks source link

spm should support custom tools version and platforms #235

Closed hanrw closed 5 months ago

hanrw commented 10 months ago

config

kmmbridge {
    mavenPublishArtifacts()
    frameworkName.set("shared")
    spm {
        swiftToolsVersion = "5.9"
        platforms = listOf(".iOS(.v13)", ".macOS(.v13)")
    }
    //etc
}

or

kmmbridge {
    spm {
        swiftToolsVersion = "5.9"
        platforms {
            iOS { v("14") }
            macOS { v("13") }
            watchOS { v("7") }
            tvOS { v("14") }
        }
    }
}

should generate Package.swift

let package = Package(
    name: packageName,
    platforms: [
        .iOS(.v13),
        .macOS(.v13)
    ],
    products: [
        .library(
            name: packageName,
            targets: [packageName]
        ),
    ],
    targets: [
        .binaryTarget(
            name: packageName,
            url: remoteKotlinUrl,
            checksum: remoteKotlinChecksum
        )
        ,
    ]
)
kpgalligan commented 5 months ago

Available in 0.5.3