Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include assets / resources in a Swift Package Manager library?

I would like to ship my library using Apple's Swift Package Manager. However my lib includes a .bundle file with several strings translated in different languages. Using cocoapods, I can include it using spec.resource. But in SwiftPM, I cannot do it. Any solution?

like image 499
danielemm Avatar asked Oct 02 '16 08:10

danielemm


People also ask

Where are Swift package dependencies stored?

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.


1 Answers

The package manager does not yet have any definition for how resources will be bundled with targets. We are aware of the need for this, but don't yet have a concrete proposal for it. I filed https://bugs.swift.org/browse/SR-2866 to ensure we have a bug tracking this.

like image 134
Daniel Dunbar Avatar answered Sep 21 '22 19:09

Daniel Dunbar