gpt4 book ai didi

ios - 抑制来 self 的 SPM 包的所有警告

转载 作者:行者123 更新时间:2023-12-05 05:44:34 27 4
gpt4 key购买 nike

有没有办法在 XCode 中抑制来 self 的 SPM 包的所有警告?!

⚠️found 1 file(s) which are unhandled; explicitly declare them asresources or exclude from the target

显示此警告是因为我的 SPM 程序包包含 .txt 文件。

我尝试在 package.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__"]
)
]
)

关于ios - 抑制来 self 的 SPM 包的所有警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71570441/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com