如何将 swift 包置于编辑模式?

How do I put a swift package in Edit Mode?

所以我想在 MacOS 10.15 Beta (19A471t) 上编辑 swift 包中的一些文件 Xcode 11.0 beta (11M336w)。

我们以https://github.com/AndyQ/NFCPassportReader为例

它有一个使用来自 GitHub 的 repo 的示例应用程序。 假设我想更改一些源代码。如何告诉系统我要编辑包?

我在命令行上尝试了“swift package edit NFCPassportReader”。

  1. 如果我从示例应用程序的根文件夹中 运行 它,我会得到“error: root manifest not found

  2. 如果我 运行 它来自包的根目录,我得到“error: Could not find dependency 'NFCPassportReader'

我需要采取哪些步骤才能在编辑模式下(在 Xcode 11 中)获取包,以及从哪个目录获取包?

P.s。这是 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"]),
    ]
)

如果您在本地克隆一个包并将其拖到您的项目或工作区中,则该本地副本将覆盖 (read-only) 任何引用它的远程依赖项。然后您可以根据需要编辑包的本地副本。

您可以在 WWDC2019 视频创建 Swift 包的大约 23 分钟内看到有关此工作流的更多信息:https://developer.apple.com/videos/play/wwdc2019/410/