Open camdenfullmer opened 2 weeks ago
Looks like this address issue #312
@camdenfullmer Thank you for this PR. It looks like a legitimate idea and simple implementation
I would propose to add a minimal example Lambda function to show how to use this capability and a section in the README file to document this.
Question: why Contents/Resources
and not just Resources
like the mac bundles ? (I know, naming things is hard)
I left comments on the code
@swift-server-bot test this please
This change updates the SwiftPM plugin to include the executable's resources in the archive.
Motivation:
When deploying a Lambda function that generates HTML content I needed a way to package template HTML files along with the executable. Defining the resources in the
Package.swift
and then packaging them in the archive in a way so that Swift can access them usingBundle.main.resourceURL
felt like the best way to accomplish this.Example:
Modifications:
Plugin code has been modified to generate a
Contents/Resources
directory inside the final archive which includes the resources defined in the executable's target fromPackage.swift
.Result:
The zip archive includes the defined resources in
Package.swift
.