iOS Swift软件包管理器添加示例

时间:2019-11-11 12:24:35

标签: ios swift swift-package-manager

我正在使用Swift Package Manager构建新的Package,我希望有一个可运行的“示例”目标或与SwiftUI的预览版一起使用。

这是我的包裹清单。

import PackageDescription

let package = Package(
    name: "PartialSheet",
    platforms: [
      .iOS(.v13)
    ],
    products: [
        // Products define the executables and libraries produced by a package, and make them visible to other packages.
        .executable(
            name: "Example",
            targets: ["Example"]
        ),
        .library(
            name: "PartialSheet",
            targets: ["PartialSheet"]
            )
    ],
    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: "PartialSheet",
            dependencies: []),
        .target(
            name: "Example",
            dependencies: ["PartialSheet"]),
        .testTarget(
            name: "PartialSheetTests",
            dependencies: ["PartialSheet"]),
    ]
)

在Source文件夹下,我添加了一个Example文件夹。

但是现在要做一个可玩的目标该怎么办?

0 个答案:

没有答案