所以我想在 MacOS 10.15 Beta (19A471t) 上的 Xcode 11.0 beta (11M336w) 中编辑 swift 包中的一些文件。
我们以https://github.com/AndyQ/NFCPassportReader为例。
它有一个使用来自 GitHub 的 repo 的示例应用程序。假设我想对源代码进行一些更改。如何告诉系统我要编辑包?
swift package edit NFCPassportReader
我在命令行上尝试了“ ”。
如果我从示例应用程序的根文件夹运行它,我会得到“
error: root manifest not found
”如果我从包的根目录运行它,我会得到“
error: Could not find dependency 'NFCPassportReader'
”
我需要采取哪些步骤才能在编辑模式下(在 Xcode 11 中)以及从哪个目录获取包?
Ps 这是来自 repo 的 Package.swift 文件
// swift-tools-version:5.1
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "NFCPassportReader",
platforms: [.iOS(.v13)],
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
name: "NFCPassportReader",
targets: ["NFCPassportReader"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "NFCPassportReader",
dependencies: []),
.testTarget(
name: "NFCPassportReaderTests",
dependencies: ["NFCPassportReader"]),
]
)