I'm building a Swift Package that contains a text resource inside /<project_name>/Sources/<target_name>/Resources/names.txt
. The resource is being copied into the target as:
resources: [
.copy("Resources/names.txt")
]
... and the Bundle.module
accessor is generated (the Bundle.module
call is performed from within the Swift Package). Still, when testing the code in a Playground, by calling the function that calls the function that calls the Bundle.module.path ...
(so not directly from the Playground), it mentions:
SPK/resource_bundle_accessor.swift:27: Fatal error: unable to find bundle named swift-spk_SPK
I'm following the guidelines I found on tutorials and within a similar question from last year here: Finding Swift Package Manager Resources so I'm curious if there have been any changes to the resource loading.