Skip to content

Commit

Permalink
fix: Resources that are in precompiled XCFrameworks cannot be accesse…
Browse files Browse the repository at this point in the history
…d from Previews (#6028)
  • Loading branch information
anlaital-oura committed Mar 5, 2024
1 parent a6a9626 commit 70f7636
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions Sources/TuistGenerator/Mappers/ResourcesProjectMapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,12 @@ public class ResourcesProjectMapper: ProjectMapping { // swiftlint:disable:this
Bundle.main.bundleURL,
]
#if DEBUG
// This is a fix to make Previews work with bundled resources.
// Logic here is taken from SPM's generated `resource_bundle_accessors.swift` file,
// which is located under the derived data directory after building the project.
if let override = ProcessInfo.processInfo.environment["PACKAGE_RESOURCE_BUNDLE_PATH"] {
candidates.append(URL(fileURLWithPath: override))
}
#endif
for candidate in candidates {
let bundlePath = candidate?.appendingPathComponent(bundleName + ".bundle")
Expand Down

0 comments on commit 70f7636

Please sign in to comment.