使用 Xcode 11 将 SPM 下载的包保存到项目 GIT 中 [英] Save packages downloaded by SPM into project GIT using Xcode 11
问题描述
我开始使用集成了 SPM 的新 Xcode 11.
I started using new Xcode 11 which integrates SPM.
我在我的项目中添加了第一个依赖项:
I added first dependency to my project:
但检测到文件未提取到我的项目文件夹中,而是提取到 Xcode 的缓存中:
but detected that files are not fetched into my project folder but into Xcode's cache:
我想将我所有的依赖文件提交到我的主项目存储库中,所以我的问题是:
I would like to commit all my dependencies files into my main project repository so my question is:
是否可以使用 Xcode 11 通过 SPM 更改获取的包的位置?
推荐答案
已设置 SwiftPM 集成来防止这种情况发生.它将文件克隆到 DerivedData/ProjectName-[RandomStuff].您应该将 Package.resolved 提交到存储库中,以确保跨项目克隆获得每个依赖项的相同版本.
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.
这篇关于使用 Xcode 11 将 SPM 下载的包保存到项目 GIT 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!