如何在 Xcode 中更新 Swift 依赖项 [英] How to update Swift dependencies in Xcode
问题描述
在我创建一个带有依赖项的新 swift 包后,我调用 swift package generate-xcodeproj
.如果我的依赖项有新版本,我会调用 swift package update
.我的依赖项的新版本被下载并构建,但 Xcode 现在对旧版本的依赖项有错误的引用.我可以再次调用 swift package generate-xcodeproj
但这将删除我设置的所有自定义目标.
After I create a new swift package with dependencies I call swift package generate-xcodeproj
. If my dependencies have a new version I call swift package update
. The new version of my dependency gets downloaded and built but Xcode now has a bad reference to the old version of the dependency. I can call swift package generate-xcodeproj
again but this will remove any custom targets I have setup.
如何在不删除自定义目标的情况下更新我的 swift 依赖项和我的 Xcode 项目?
How do I update my swift dependencies and my Xcode project without deleting my custom targets?
推荐答案
我刚刚偶然发现了这个问题,发现如何在 Xcode 中更新 swift 依赖项"的解决方案现在 Swift Packages 已经存在几年了,可能已经发生了变化.
I just stumbled upon this question and found that the solution to "How to update swift dependencies in Xcode" has probably changed now that Swift Packages have been around for a few years.
对我来说,解决方案是简单地转到 File
->Swift 包
->更新到最新的软件包版本
.
For me, the solutions was to simply go to File
-> Swift Packages
-> Update to Latest Package Versions
.
这篇关于如何在 Xcode 中更新 Swift 依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!