找不到产品依赖性-仅在Swift 4.2之前

时间:2018-10-07 19:11:59

标签: swift dependencies swift4 swift-package-manager swift4.2

我正在GitHub上维护两个Swift Package Manager项目。其中一个DiceKit依赖于另一个ProtocolKit。它们也都使用swift-tools-version等于4.0。

DiceKit与Travis CI shown here进行了持续集成。它已在macOS和Linux上,Swift 4.0、4.0.2、4.0.3、4.1、4.1.1、4.1.2、4.1.3和4.2上进行了测试。但是,除4.2以外的所有版本的测试均失败,而对4.2的测试则成功。

这是来自macOS Swift 4.0日志的错误:

$ swift test
error: dependency graph is unresolvable; found these conflicting  requirements:
Dependencies: 
    https://github.com/Samasaur1/ProtocolKit.git @ 1.0.0..<2.0.0
error: product dependency 'ProtocolKit' not found
Fetching https://github.com/Samasaur1/ProtocolKit.git

但是,在Swift 4.2日志上,成功获取依赖项:

$ swift test
Fetching https://github.com/Samasaur1/ProtocolKit.git
Completed resolution in 1.44s
Cloning https://github.com/Samasaur1/ProtocolKit.git
Resolving https://github.com/Samasaur1/ProtocolKit.git at 1.0.2
Compile Swift Module 'ProtocolKit' (1 sources)
Compile Swift Module 'DiceKit' (3 sources)
Compile Swift Module 'DiceKitTests' (4 sources)

作为参考,here是DiceKit的Package.swift文件:

// swift-tools-version:4.0
// Managed by ice

import PackageDescription

let package = Package(
    name: "DiceKit",
    products: [
        .library(name: "DiceKit", targets: ["DiceKit"]),
    ],
    dependencies: [
        .package(url: "https://github.com/Samasaur1/ProtocolKit.git", from: "1.0.0"),
    ],
    targets: [
        .target(name: "DiceKit", dependencies: ["ProtocolKit"]),
        .testTarget(name: "DiceKitTests", dependencies: ["DiceKit"]),
    ]
)

here是ProtocolKit的一个:

// swift-tools-version:4.0
// Managed by ice

import PackageDescription

let package = Package(
    name: "ProtocolKit",
    products: [
        .library(name: "ProtocolKit", targets: ["ProtocolKit"]),
    ],
    targets: [
        .target(name: "ProtocolKit", dependencies: []),
        .testTarget(name: "ProtocolKitTests", dependencies: ["ProtocolKit"]),
    ]
)

我对此事不知所措,非常感谢大家能提供的任何帮助。预先感谢!

0 个答案:

没有答案