Hive Hive
Sign in

fix(cli): support nib resources in SwiftPM packages

GitHub issue · Closed

Metadata
Source
tuist/tuist #11486
Updated
Jul 5, 2026
Domains
Generated projects
Details

What

Adds support for .nib resources in Swift Packages, on par with .xib:

  1. PackageInfoMapper now recognizes .nib in defaultSpmResourceFileExtensions, so packages without explicit resources: declarations get .nib files picked up by the auto-generated globs.
  2. AbsolutePath.isOpaqueDirectory now includes .nib, so the compiled .nib wrapper 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 tuist succeeds.
  • xcodebuild test … -only-testing TuistLoaderTests/PackageInfoMapperTests -only-testing TuistSupportTests/AbsolutePathExtrasTests passes.
  • Confirmed on a real project that the previously-crashing .nib is 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.

Flights

Investigate, reproduce, or fix this item in an isolated repository. Each Flight preserves its outcome and agent session.

New Flights are paused Configure model inference, GitHub, and a sandbox provider to start another Flight. Existing results remain available below.
No Flights yet

Start a Flight and preserve its objective, outcome, and session here.

Comments

No GitHub comments yet.