You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
plugin: Add resource bundles defined in Package.swift to container images (#78)
Motivation
----------
A target in `Package.swift` can include
[resources](https://developer.apple.com/documentation/packagedescription/target/resources).
When the target is built, the resources are copied into a bundle
directory and a
[`Bundle`](https://developer.apple.com/documentation/foundation/bundle)
class is generated, giving the executable a convenient way to retrieve
them at run time.
A target with resources should be able to access them when it is
packaged in a container image. For example, a web server might bundle
resources such as images or fonts.
Fixes#48
Modifications
-------------
* Add a new `--resource` parameter to `containertool`. This specifies a
resource bundle directory which is added to the container image using
the directory archiving support added to the `Tar` module in #74. When
`containertool` is used alone, multiple `--resource` flags can be
specified and will be added to the image in the order in which they
appear on the command line. A target in `Package.swift` can only define
one resource bundle, so when used through the plugin only one bundle
will be added.
* Update the plugin to pass the `--resource` flag to `containertool`
when an executable target has resources.
Result
------
If a target includes resources, the resource bundle will be copied into
the container image at a path where the generated `Bundle` class can
find it.
If a target does not include resources, the container image will only
include the executable.
Test Plan
---------
* Existing tests continue to pass.
* New integration tests verify that all expected resources are present.
0 commit comments