I am trying to add a dependency on a local swift package in my Xcode project. (I don't want to add a dependency using a file url file://me/dev/app/package
as this cannot be shared to other environments)
I tried to drag & drop the package to the target. This creates a references to the package in the project that I was able to add in the "Link Binary With Libraries" build phase, but the library is still not found.
No such module 'Analytics'
My original configuration
After drag & drop
and here is my package configuration:
// swift-tools-version:5.1
import PackageDescription
let package = Package(
name: "Analytics",
products: [
.library(name: "Analytics", targets: ["Analytics"]),
],
dependencies: [
.package(path: "../SomeOtherPackage"),
],
targets: [
.target(name: "Analytics", dependencies: [
"SomeOtherPackage",
]),
]
)
I've also included the Package in the target linked binaries and/or bundle resources and/or compiled sources to no avail:
I've read this long discussion that doesn't seem to be conclusive.
Here is a simple example of what I'm trying: https://github.com/gsabran/SPM_Xcode_test