有没有办法在XCode中抑制来自我的SPM包的所有警告?!
⚠️找到1个未处理的文件;明确声明它们为资源或从目标中排除
显示此警告是因为我的SPM包包含.txt文件。
我尝试在包.swift中添加swiftSettings: [.unsafeFlags(["-suppress-warnings"])]
,但没有成功。
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "Sourcery",
platforms: [.macOS(.v10_13)],
dependencies: [
.package(
url: "https://github.com/pointfreeco/swift-snapshot-testing.git",
from: "1.9.0"
)
],
targets: [
.executableTarget(
name: "Sourcery",
dependencies: []
),
.testTarget(
name: "SourceryTests",
dependencies: [.product(name: "SnapshotTesting", package: "swift-snapshot-testing")]
)
]
)
看起来exclude参数也支持文件夹。所以我把所有的.txt文件都组织在一个文件夹中,现在我去掉了警告:(
import PackageDescription
let package = Package(
name: "Sourcery",
platforms: [.macOS(.v10_13)],
dependencies: [
.package(
url: "https://github.com/pointfreeco/swift-snapshot-testing.git",
from: "1.9.0"
)
],
targets: [
.executableTarget(
name: "Sourcery",
dependencies: [],
exclude: ["Templates"]
),
.testTarget(
name: "SourceryTests",
dependencies: [.product(name: "SnapshotTesting", package: "swift-snapshot-testing")],
exclude: ["__Snapshots__"]
)
]
)