SPM creates static instance Bundle.module, which points to proper package/framework bundle in the executable.
But .module does not exists when code is used as part of regular app. So we need trickery.
- ProjectBundlePathLoader.swift is file which works when code is used inside regular project app and it is marked as member of the app (and tests) targets. It must be excluded from the SPM package.
- PackageBundlePathLoader.swift is file which implements the same resource loading but this time using Bundle.module and as such it is not a member of the app/test targets.