Search code examples
iosxcode11swift-package-manager

Save packages downloaded by SPM into project GIT using Xcode 11


I started using new Xcode 11 which integrates SPM.

I added first dependency to my project:

enter image description here

but detected that files are not fetched into my project folder but into Xcode's cache:

enter image description here

I would like to commit all my dependencies files into my main project repository so my question is:

Is it possible to change location of fetched packages via SPM using Xcode 11?


Solution

  • SwiftPM integration has been setup to prevent this. It clones the files into a DerivedData/ProjectName-[RandomStuff]. You should commit your Package.resolved into the repo to ensure that you get the same version of each dependency across clones of the project.