我确实有一个较旧的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
答案 0 :(得分:0)
改为尝试.package(url: "package_url", from: "version")
。
答案 1 :(得分:0)
您是否尝试过更新所有内容,包括Perfect本身?考虑到您的旧项目是在不同版本的Swift下编写的,此后依赖关系可能已经发生了重大变化,而旧版本的依赖关系可能尚不支持新版本。
完成此操作后,请尝试让Perfect重新生成Package.swift
,因为另一个用户指出语法已更改。