Swift Package Manager 有本地缓存​​吗? [英] Does Swift Package Manager have a local cache?

查看:47
本文介绍了Swift Package Manager 有本地缓存​​吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次我加载一个新包时,Xcode 都会从 Github 重新下载所有依赖项,而不是重用我已经为其他项目加载的一些依赖项.

Every time I load a new package, Xcode redownloads all dependencies from Github, instead of reusing some that I've already loaded for other projects.

例如,我希望当我引用 .package(name: "SwiftyJSON", url: "https://github.com/SwiftyJSON/SwiftyJSON.git", from: "5.0.0") 并且当我的笔记本电脑上有匹配的包时,Xcode 不会重新下载该包.

For instance I would expect that when I reference .package(name: "SwiftyJSON", url: "https://github.com/SwiftyJSON/SwiftyJSON.git", from: "5.0.0") and when I have a matching package on my laptop, Xcode would not redownload the package.

是否可以将 Xcode 配置为使用更激进的缓存策略?

Is it possible to configure Xcode to use a more aggressive caching strategy?

推荐答案

从 Xcode 12.5 开始,依赖项缓存在 ~/Library/Caches/org.swift.swiftpm/

From Xcode 12.5 the dependencies are cached in ~/Library/Caches/org.swift.swiftpm/

编辑

不是编译的依赖项而是只有源代码(检出)被缓存在这个地方.看来我们必须等待另一个更新,直到 Apple 提供 xcodebuild 选项来传递依赖项的 build_path.

Not the compiled dependencies but only the source (checkouts) are cached in this place. It seems we have to wait for yet another update until Apple offers a xcodebuild option to pass the build_path for the dependencies.

这篇关于Swift Package Manager 有本地缓存​​吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆