我使用Xcode创建了一个新的Package并引入了一个依赖项,但当我尝试使用它时,出现了错误。
如何在软件包源中使用依赖项?在普通的项目中,我可以轻松地导入和使用AgileDB。
以下是该软件包:
也许目标中需要依赖于 AgileDB 包?我尝试复制它,但无法识别。
以下是该软件包:
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "DBCore",
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "DBCore",
targets: ["DBCore"]),
],
dependencies: [
.package(url: "https://github.com/AaronBratcher/AgileDB", from: "6.4.0")
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "DBCore",
dependencies: []),
.testTarget(
name: "DBCoreTests",
dependencies: ["DBCore"]),
]
)
也许目标中需要依赖于 AgileDB 包?我尝试复制它,但无法识别。
AgileDB
内部检查文件Package
。其中会有类似于name: "X"
的内容。尝试在你的导入中使用它。 - Suyash MedhaviAgileDB
,可以在这里找到:https://github.com/AaronBratcher/AgileDB - Aaron Bratcher