Discover SwiftPM interface builder files in target sources#1096
Draft
Discover SwiftPM interface builder files in target sources#1096
Conversation
Retain XIB and storyboard references even when a package manifest does not declare them as resources, and cover private IBActions with SPM regression tests. Made-with: Cursor
There was a problem hiding this comment.
Pull request overview
Fixes SwiftPM Interface Builder discovery by augmenting SPM planning to find .xib/.storyboard files via filesystem scanning of target directories (not just declared resources), and adds regression tests to cover private IBAction handling and the fallback discovery path.
Changes:
- Extend
SPMProjectDriverto collect Interface Builder files by enumerating each target’s directory for.xib/.storyboardfiles. - Add macOS regression coverage for (a)
private/private-extensionIBActionmethods referenced from XIBs and (b) discovery when resources aren’t declared in the SwiftPM manifest. - Update the macOS SwiftPM fixture XIB and controller to include a connected
IBActionin a private extension.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Tests/SPMTests/SPMProjectMacOSTest.swift | Adds a new regression test that drives SPMProjectDriver using a minimal manifest JSON and validates XIB discovery + reference retention. |
| Tests/SPMTests/SPMProjectMacOS/Sources/SPMProjectMacOSKit/SPMXibViewController.swift | Makes IBAction methods private and adds private-extension IBActions for retention/regression coverage. |
| Tests/SPMTests/SPMProjectMacOS/Sources/SPMProjectMacOSKit/Resources/SPMXibViewController.xib | Connects a new IBAction selector to the view controller to validate private-extension action discovery. |
| Sources/ProjectDrivers/SPMProjectDriver.swift | Implements filesystem-based Interface Builder file discovery within SwiftPM target directories. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix SwiftPM Interface Builder discovery by scanning target directories for XIB and storyboard files, even when they are not declared as package resources.
Add regression coverage for private
IBActionmethods and the fallback filesystem discovery path.Made with Cursor