Search code examples
xcodeswift-package-manager

Does Swift Package Manager have a local cache?


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.

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.

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


Solution

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

    EDIT

    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.