-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SR-2866] [SwiftPM] Need a way to include resources with targets #5199
Comments
Comment by Ondrej Rafaj (JIRA) So I think that a cool way to allow this would be to import of thirdparty code into the Package.swift file so people can do their own implementation. At the moment I have a lib like this https://github.com/LiveUI/SwiftResources which imports my resources at the runtime but having something that would execute it during build (or at least to be able to create a target which would be a dependency to my main target and executed before I run my main target) would solve this issue for me at least a bit. |
SR-8260 has a writeup of how this could look. |
Comment by Werner Altewischer (JIRA) Any progress on this? |
Comment by Alban Deflandre (JIRA) Any update? |
turbolent (JIRA User) I don't have any update on the comment, but a common trick I use for tests is to find resources relative to Swift's #file. |
Comment by Guillermo Ignacio Enriquez Gutierrez (JIRA) I am also interested in an official support for resources too. I haven't checked tests very well but when using resources in the Sources directory results are different according environment. I have a simple program here
I checked at some sources like Kitura swift server framework and they try really hard to find absolute paths... I wish there was a standard and easy way to find resources within the application. |
Comment by Richard Venable (JIRA) Any progress being made on Anders' proposal? https://github.com/abertelrud/swift-evolution/blob/package-manager-resources/proposals/NNNN-package-manager-resources.md |
Comment by Pavan (JIRA) I think it would be great support if it's get included in before final Xcode11 releases |
Comment by Christophe Braud (JIRA) Totally agree with pavm035 (JIRA User) 👍 😃 |
Comment by Ondrej Rafaj (JIRA) If we only could add custom code to the package file to happen on execution. That way any missing feature could be handled by the developer. |
Comment by Alban Deflandre (JIRA) We all agree with Pavan, but is someone listening us? |
Comment by Pavan (JIRA) Any update, we really keep looking for this feature!!! |
Comment by Guillermo Ignacio Enriquez Gutierrez (JIRA) Some discussion is happening here: Not very active recently but maybe there is an update there. (I just wrote my opinion about the proposal there) I am really looking forward resources support in SPM 🙂 |
Comment by Basem Emara (JIRA) Embedding resources are a show-stopper for a large chunk of Swift frameworks out there. Is there still time to get one released before beta ends? |
Comment by Petro Rovenskyy (JIRA) Please add a possibility to embedding resources. It's not fair that Xcode 11 has sPM support but sPM package can't handle even localizations. Please prioritize. |
What Petro said. So many non-trivial tools depend on proper localisation support.� |
There's now a draft proposal for this: https://forums.swift.org/t/draft-proposal-package-resources/29941 |
Comment by Emma Foster (JIRA) The proposal above has been accepted with modifications: https://forums.swift.org/t/se-0271-package-manager-resources/30730/63 |
Would anyone mind if this is resolved as "Done"? |
Comment by Jason Wray (JIRA) This happened in Swift tools version 5.3 and Xcode 12 — here's a doc on how to get started with resources in packages. |
Additional Detail from JIRA
md5: ff37c4c7be00b80a1eb47bf7e441933b
is duplicated by:
relates to:
Issue Description:
The Swift package manager needs a story for how packages should specify resources to include with products.
On Darwin, this would traditionally be done with a
Resources
folder in a framework. On Linux, it is less clear what should happen, and we will want users to have access to a reliable cross-platform mechanism for resources.The text was updated successfully, but these errors were encountered: