尝试包含目标依赖项时,我收到错误: The manifest describes a target that cannot be found in your source tree: parser
这是我的Package.swift文件:
import PackageDescription let package = Package( name: "Phoenix", targets: [ Target( name: "Phoenix", dependencies: [.Target(name: "parser")]), Target( name: "parser") ] )
我遵循这里描述的格式:https://github.com/apple/swift-package-manager/blob/master/Documentation/Package.swift.md
你有parser
目录吗?
你应该有一个类似的布局:
. ??? Sources ??? Phoenix ? ??? File1.swift ??? parser ??? File2.swift
要么:
. ??? Phoenix ? ??? File1.swift ??? parser ??? File2.swift
这指示SwiftPM创建两个模块,一个名为Phoenix,另一个名为"parser".