Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Local swift package with local dependency

I have a project that I plan on developing in modules, the final application will be any number of the modules built together based on a configuration. I have a swift package that has all of my common code it it, we can call that the platform package. I then went to create my first feature, this went just fine however when I created the wrapper application to pull in each feature, I got this error from SPM in xcode11:

package 'Platform' is required using a revision-based requirement and it depends on local package 'Feature1', which is not supported. Looking at the code base for SPM here (line 72)

https://github.com/apple/swift-package-manager/blob/master/Sources/PackageGraph/DependencyResolver.swift

It looks like this is something that is just not supported, the mixing of local and remote dependencies? Is this a limitation of SPM / should I be trying to use another tool for this type of app architecture?

like image 667
user6252584 Avatar asked Oct 21 '25 18:10

user6252584


1 Answers

In my case, I was trying to add a package, which I was developing, and its Package.swift contained dependencies of the form:

dependencies: [
    .package(path: "../PackageName"),
    // etc

Changing the references to specific repos solved the problem:

dependencies: [
    .package(path: "http://github.com/..."),
    // etc
like image 61
Chris Prince Avatar answered Oct 24 '25 07:10

Chris Prince