Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I reset the package cache on just one package with Swift Package Manager

There's a "Reset Package Caches" option in the menu in Xcode, but that resets them all, which takes a while. Is it possible to just reset one package cache?

like image 387
Marty Avatar asked Feb 03 '20 04:02

Marty


People also ask

Where are Swift packages cached?

In order to cache the dependencies, they should be located in the project directory, but by default, SPM downloads the dependencies into the system folder: ~/Library/Developer/Xcode/DerivedData.

How do I update Swift package dependencies?

To resolve, Open the project from the project panel, select the project (not the targets), then select the "Swift Packages" tab. Double click on the package you want to update and change the minimum version to the next major version.

What is Swiftpm package resolved?

| The swift package resolve command resolves the dependencies, taking into account the current version restrictions in the Package. swift manifest and Package. resolved resolved versions file, and issuing an error if the graph cannot be resolved.


1 Answers

To reset the cache for a single package:

  • Navigate to ~/Library/Caches/org.swift.swiftpm/repositories and deleting the folder and lock file related to the package
  • Then, in Xcode, run File-->Swift Packages-->Reset Package Caches
like image 78
jarrodparkes Avatar answered Oct 05 '22 09:10

jarrodparkes