I’m refactoring some code, and I’ve gone from linking the Package via Xcode’s Package dependencies to making it a dependency in the Package manifest of a local package:
// swift-tools-version: 5.9
import PackageDescription
let package = Package(
name: "CPNetworking",
platforms: [
.iOS(.v17)
],
products: [
// Products define the executables and libraries a package produces, making them visible to other packages.
.library(
name: "CPNetworking",
targets: ["CPNetworking"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(name: "CPCore", path: "../CPCore"),
.package(name: "TestingUtils", path: "../TestingUtils"),
.package(url: "https://github.com/kean/Get.git", .upToNextMajor(from: "2.1.6")),
.package(url: "https://github.com/parse-community/Parse-Swift", .upToNextMajor(from: "4.14.2"))
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.target(
name: "CPNetworking",
dependencies: ["CPCore", "Get", "ParseSwift"]
),
.testTarget(
name: "CPNetworkingTests",
dependencies: ["CPNetworking", "TestingUtils"]
)
]
)
When trying to build this, it does indeed retrieve the package, but then has the error:
product 'ParseSwift' required by package 'cpnetworking' target 'CPNetworking' not found.
I don’t think it gets any simpler than this. So I’m curious as to what the problem might be.