我的 Package.swift
文件看起来像这样
let package = Package(
name: "MyPackage",
platforms: [
.iOS(.v13)
],
products: [
.library(
name: "MyPackage",
targets: ["MyPackage"])
],
dependencies: [
.package(url: "https://github.com/SnapKit/SnapKit.git", from: "5.0.0"),
],
targets: [
.target(
name: "MyPackage",
dependencies: [
"SnapKit",
]),
.testTarget(
name: "MyPackageTests",
dependencies: ["MyPackage"])
]
)
当我运行swift test
时,我会得到以下结果:
error: the library 'MyPackage' requires macos 10.10, but depends on the product 'SnapKit' \
which requires macos 10.12; consider changing the library 'SurfUIKit' to require macos 10.12 \
or later, or the product 'SnapKit' to require macos 10.10 or earlier.
为什么Swift在未列为支持平台的macOS上运行测试?我能否让Swift运行iOS的测试,最好是指定一些版本目标?在CLI中使用Xcode有哪些替代方法?