Handle copy-style resource bundles preserving folder hierarchy#207
Merged
Handle copy-style resource bundles preserving folder hierarchy#207
Conversation
|
Sweet! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Skip currently only handles the
resources: [.process("Resources")]style of resource, whereby the contents of the folder are processed in an iOS-style fashion: localization files are transformed, image assets are processed, etc. This works file for plain resources that are to be accessed manually at runtime withBundle.module.url(forResource: …)(like data and text files), but has the limitation that all folder hierarchies are "flattened", making it impossible to organize assets by sub-folder.This PR addresses this limitation by adding support for copy-style resources, a la
resources: [.process("my-stuff")], whose contents can be accessed withBundle.module.url(forResource: "my-stuff/some/full/path/file.data"). The caveat is that since the SwiftPM plugin API does not provide any information about the resources of a given SwiftPM module, the information about the resource configuration needs to also be listed in the module'sskip.yml, like so:The documentation at https://skip.dev/docs/development-topics/#resource-modes will be updated to describe this requirement.
Fixes skiptools/skip-ui#79, fixes skiptools/skip-ui#269