swift-bridge
swift-bridge copied to clipboard
Add support for specifing platforms in Package creation
Current Package.swift
format
import PackageDescription
let package = Package(
name: "WalletChainCore",
products: [
.library(
name: "WalletChainCore",
targets: ["WalletChainCore"]),
],
dependencies: [],
targets: [
.binaryTarget(
name: "RustXcframework",
path: "RustXcframework.xcframework"
),
.target(
name: "WalletChainCore",
dependencies: ["RustXcframework"])
]
)
If you are using any async
method, you are required to specify at least iOS 13 version to use it:
platforms: [.iOS(.v13)],
Expected:
import PackageDescription
let package = Package(
name: "WalletChainCore",
platforms: [.iOS(.v13)],
products: [
.library(
name: "WalletChainCore",
targets: ["WalletChainCore"]),
],
dependencies: [],
targets: [
.binaryTarget(
name: "RustXcframework",
path: "RustXcframework.xcframework"
),
.target(
name: "WalletChainCore",
dependencies: ["RustXcframework"])
]
)
Thanks for opening this issue and for including the Expected
section.
Would something like this work for you swift-bridge-cli create-package --platforms iOS=13.1 --platforms macOS=12.3
?
Along with a change to swift-bridge-build::create_package
to let you specify a list of platform requirements?