Swift 包管理器 - 带有 .zip 文件的 binaryTarget 无法验证

Swift Package Manager - binaryTarget with .zip file fails to validate

我尝试了不同的方法来将 binaryTarget 添加到 Swift 包中 - 其中 2 种方法很好(示例中的 Target1Target2),但是第三种方法(Target3) 也应该根据文档工作未验证:unsupported extension for binary target 'Target3'; valid extensions are: xcframework

为了不让每个二进制版本的 repo 膨胀太多,我更喜欢这里的 zip 方法...-任何人都可以使用 binaryTargetpath: 中的 .zip 文件=] 添加到包存储库,或任何提示我在这里做错了什么? (Xcode 12.4,t3.zip 仅包含根级别的 .xcframework

// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
    name: "WhosebugExamplePackage",
    platforms: [
        .iOS(.v9)
    ],
    products: [
        .library(
            name: "Lib1",
            targets: ["Target1"]),
        .library(
            name: "Lib2",
            targets: ["Target2", "Target3"]),
    ],
    dependencies: [
        // .package(url: /* package url */, from: "1.0.0"),
    ],
    targets: [
        .binaryTarget(
            name: "Target1",
            url: "https://myurl.example.com/t1-xcframework.zip",
            checksum: "777ddd6381e2201b7eb778b72f373f77e1190fd9dc9503f703e37c86d3b89674"
        ),
        .binaryTarget(name: "Target2", path: "./Binaries/t2.xcframework"),
        .binaryTarget(name: "Target3", path: "./Binaries/t3.zip"),
    ]
)

Zip 对本地二进制目标的存档支持 SPM was merged 去年 10 月,最终与 Xcode 13.3.

一起发布