1

我确实有一个较旧的 Perfect Swift 项目,其中我的 package.swift 看起来如下:

// Generated automatically by Perfect Assistant Application
// Date: 2017-09-24 18:44:24 +0000
import PackageDescription
let package = Package(
    name: "SomeName",
    targets: [],
    dependencies: [
               .Package(url: "https://github.com/PerfectlySoft/Perfect-HTTPServer.git", majorVersion: 2),
               .Package(url: "https://github.com/PerfectlySoft/Perfect-LocalAuthentication-MySQL.git", majorVersion: 1),
               .Package(url: "https://github.com/PerfectlySoft/Perfect-CURL.git", majorVersion: 2),
               .Package(url: "https://github.com/SwiftORM/StORM.git", majorVersion: 3),
               .Package(url: "https://github.com/PerfectlySoft/Perfect-MySQL.git", majorVersion: 3),
               .Package(url: "https://github.com/PerfectlySoft/Perfect-SMTP.git", majorVersion: 1),
               .Package(url: "https://github.com/PerfectlySoft/Perfect-RequestLogger.git", majorVersion: 1)

    ]
)

当我运行时,swift package build我得到以下输出,然后机器挂了几个小时:

Updating https://github.com/PerfectlySoft/Perfect-HTTPServer.git
Updating https://github.com/PerfectlySoft/Perfect-LocalAuthentication-MySQL.git
Updating https://github.com/PerfectlySoft/Perfect-CURL.git
Updating https://github.com/PerfectlySoft/Perfect-RequestLogger.git
Updating https://github.com/SwiftORM/StORM.git
Updating https://github.com/PerfectlySoft/Perfect-MySQL.git
Updating https://github.com/PerfectlySoft/Perfect-SMTP.git
Updating https://github.com/PerfectlySoft/Perfect-Net.git
Updating https://github.com/PerfectlySoft/Perfect-HTTP.git
Updating https://github.com/PerfectlySoft/Perfect-Thread.git
Updating https://github.com/PerfectlySoft/Perfect-LinuxBridge.git
Updating https://github.com/PerfectlySoft/Perfect-Crypto.git
Updating https://github.com/PerfectlySoft/PerfectLib.git
Updating https://github.com/PerfectlySoft/Perfect-COpenSSL-Linux.git
Updating https://github.com/SwiftORM/MySQL-StORM.git
Updating https://github.com/PerfectlySoft/Perfect-Mustache.git
Updating https://github.com/iamjono/JSONConfig.git
Updating https://github.com/PerfectlySoft/Perfect-Session-MySQL.git
Updating https://github.com/iamjono/SwiftRandom.git
Updating https://github.com/PerfectlySoft/Perfect-Logger.git
Updating https://github.com/iamjono/SwiftMoment.git
Updating https://github.com/PerfectlySoft/Perfect-libcurl.git

我该怎么做才能再次运行?swift --version得到

Swift version 4.2.1-dev (LLVM 4ba03d9389, Clang 78aa734eee, Swift f4134ebef6)
Target: x86_64-unknown-linux-gnu
4

2 回答 2

0

试试.package(url: "package_url", from: "version")吧。

于 2019-04-02T18:27:20.047 回答
0

您是否尝试过更新所有内容,包括 Perfect 本身?考虑到您的旧项目是在不同版本的 Swift 下编写的,从那时起,依赖项可能已经发生了重大变化,并且旧版本的依赖项可能还不支持新版本。

完成此操作后,尝试让 Perfect 重新生成Package.swift,因为另一位用户指出语法已更改。

于 2020-06-04T15:45:37.190 回答