I'm writing a Swift script as a standalone Swift Package. Part of this script needs to generate some files, for which I have templates.
Now, these templates are not compilable (they're HTML files); so in order to include them in the package I've included them as .copy("Templates")
.
When debugging my script, I can access the templates just fine, but when I try to archive the product, the executable doesn't have access to them anymore.
Here's my Package.swift:
let package = Package( name: "flucs", products: [ .executable(name: "Flucs", targets: ["flucs"]) ], dependencies: [ .package(url: "https://github.com/MrSkwiggs/Netswift", .exact(.init(0, 3, 1))), ], targets: [ .target( name: "flucs", dependencies: ["Netswift"], path: "Sources", resources: [ .copy("Templates") ]), .testTarget( name: "flucsTests", dependencies: ["flucs"]), ])
My folder structure:
How can I distribute my script so that it also includes its resources?