Hive
fix(cli): support nib resources in SwiftPM packages
GitHub issue · Closed
What
Adds support for .nib resources in Swift Packages, on par with .xib:
PackageInfoMappernow recognizes.nibindefaultSpmResourceFileExtensions, so packages without explicitresources:declarations get.nibfiles picked up by the auto-generated globs.AbsolutePath.isOpaqueDirectorynow includes.nib, so the compiled.nibwrapper is bundled as a single reference.
Why
A compiled .nib is usually a directory wrapper (wrapper.nib) containing keyedobjects.nib and a runtime-versioned variant. It must be copied whole — the way SwiftPM and Xcode treat it. Without the opaque-directory handling, resource globbing descends into the wrapper and reassembles it as a group of its inner files, producing a malformed bundle that crashes at runtime when the nib is loaded.
Impact
Swift Packages shipping .nib resources now have them bundled correctly as wrapper references and load without crashing.
Validation
xcodebuild build … -scheme tuistsucceeds.xcodebuild test … -only-testing TuistLoaderTests/PackageInfoMapperTests -only-testing TuistSupportTests/AbsolutePathExtrasTestspasses.- Confirmed on a real project that the previously-crashing
.nibis now bundled and loads correctly.
Tests updated: PackageInfoMapperTests and AbsolutePath+ExtrasTests.
Scope note
Targets the SwiftPM path only. .xib also appears in Target.validResourceExtensions (buildable/synchronized folders in first-party projects); .nib parity there is intentionally left out to keep this PR focused.
Investigate, reproduce, or fix this item in an isolated repository. Each Flight preserves its outcome and agent session.
Start a Flight and preserve its objective, outcome, and session here.
No GitHub comments yet.