4

I want to migrate my teams and their modules to swift package manager.

  • Some of my dependencies do not support it support SPM (missing a package.swift file)
  • There are dependencies that also have other dependencies that may or may not already support swift package manager.
  • Each dependency will add support for SPM eventually, but it may happen at differing times.

As an interim solution there will be some time where projects will be importing both cocoapods and swift packages at the same time.

Is it possible for a package.swift file to include a cocoapod as a dependency?

If not, could I create a separate swift package with a project that installs the cocoapod into the 'pods' folder, and then include a path to that as a source of the package?

Are there any other strategies for making this switch in package managers?

Joshua Maza
  • 301
  • 2
  • 12
  • I'd do it piece by piece, dependy "branch" per dependency "branch"... Else it might add extra work to include them (header search path I guess to update) – Larme May 03 '22 at 21:47

1 Answers1

0

I recently posted a similar question: Nested SPM dependency trickery

I'll try sharing what I have found.

Some of my dependencies do not support it support SPM (missing a package.swift file)

One of the dependencies for my xcframework is SocketRocket, which has a pending PR for SPM support. What I did is, I cloned the PR and created a copy on my github: https://github.com/aibo-cora/SocketRocket-SPM/tree/spm

After I did that, I was able to include this dependency with SPM. When the PR gets merged, I will just switch out the repo url to use the official version.

cora
  • 1,916
  • 1
  • 10
  • 18