feat: add .xcworkspace support for xcode swiftpm#14459
Merged
AbhishekBhaskar merged 20 commits intomainfrom Mar 18, 2026
Merged
feat: add .xcworkspace support for xcode swiftpm#14459AbhishekBhaskar merged 20 commits intomainfrom
AbhishekBhaskar merged 20 commits intomainfrom
Conversation
…ft-xcode-spm-file-updater
…t/dependabot-core into swift-xcode-spm-file-updater
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Swift ecosystem support for Xcode SwiftPM projects where Package.resolved is stored at the .xcworkspace scope (including nested workspaces), while preserving existing .xcodeproj behavior.
Changes:
- Extend Swift
FileFetcherdiscovery to find.xcworkspacebundles recursively and fetch workspacecontents.xcworkspacedata+ workspacePackage.resolved. - Treat workspace-scoped
Package.resolvedas valid Xcode SPM inputs across parser/update-checker/updater flows via sharedXcodeFileHelpers. - Make Xcode lockfile updating scope-aware for workspace lockfiles by mapping sibling
.xcodeprojrequirements into the workspace scope (with accompanying fixtures/specs).
Reviewed changes
Copilot reviewed 17 out of 19 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| swift/lib/dependabot/swift/file_fetcher.rb | Recursively discovers .xcodeproj and .xcworkspace directories; fetches workspace support/lockfiles. |
| swift/lib/dependabot/swift/file_parser.rb | Broadens Xcode lockfile selection to include .xcworkspace paths via XcodeFileHelpers. |
| swift/lib/dependabot/swift/file_parser/xcode_spm_resolver.rb | Updates enrichment logic to be workspace-aware when selecting pbxproj requirements. |
| swift/lib/dependabot/swift/file_updater.rb | Passes workspace support files into the Xcode lockfile updater; includes workspace lockfiles in selection. |
| swift/lib/dependabot/swift/file_updater/xcode_lockfile_updater.rb | Adds workspace-aware scope matching and uses workspace contents.xcworkspacedata to relate sibling projects. |
| swift/lib/dependabot/swift/update_checker.rb | Includes .xcworkspace-scoped resolved files in Xcode SPM mode selection. |
| swift/lib/dependabot/swift/xcode_file_helpers.rb | New shared helper for identifying Xcode resolved paths and extracting Xcode scope dirs. |
| swift/spec/dependabot/swift/file_fetcher_spec.rb | Adds coverage for fetching workspace-scoped files and nested workspace discovery. |
| swift/spec/dependabot/swift/file_parser/xcode_spm_resolver_spec.rb | Adds coverage for workspace-scoped lockfile parsing/enrichment behavior. |
| swift/spec/dependabot/swift/file_updater/xcode_lockfile_updater_spec.rb | Adds coverage for workspace-scoped lockfile matching against sibling project requirements. |
| swift/spec/dependabot/swift/file_updater_spec.rb | Adds end-to-end updater coverage for updating a workspace-scoped Package.resolved. |
| swift/spec/fixtures/projects/xcode_workspace/MyApp.xcworkspace/contents.xcworkspacedata | Workspace fixture for .xcworkspace support file. |
| swift/spec/fixtures/projects/xcode_workspace/MyApp.xcworkspace/xcshareddata/swiftpm/Package.resolved | Workspace-scoped Package.resolved fixture. |
| swift/spec/fixtures/projects/xcode_workspace/AppA.xcodeproj/project.pbxproj | Sibling project fixture providing dependency requirements. |
| swift/spec/fixtures/projects/xcode_workspace/AppA.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved | Project-scoped Package.resolved fixture (existing Xcodeproj behavior). |
| swift/spec/fixtures/projects/xcode_workspace_nested/ios/MyApp.xcworkspace/contents.xcworkspacedata | Nested workspace fixture for recursive discovery. |
| swift/spec/fixtures/projects/xcode_workspace_nested/ios/MyApp.xcworkspace/xcshareddata/swiftpm/Package.resolved | Nested workspace-scoped Package.resolved fixture. |
| swift/spec/fixtures/projects/xcode_workspace_nested/ios/AppA.xcodeproj/project.pbxproj | Nested sibling project requirements fixture. |
| swift/spec/fixtures/projects/xcode_workspace_nested/ios/AppA.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved | Nested project-scoped Package.resolved fixture. |
Files not reviewed (2)
- swift/spec/fixtures/projects/xcode_workspace/MyApp.xcworkspace/contents.xcworkspacedata: Language not supported
- swift/spec/fixtures/projects/xcode_workspace_nested/ios/MyApp.xcworkspace/contents.xcworkspacedata: Language not supported
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
kbukum1
approved these changes
Mar 17, 2026
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.
What are you trying to accomplish?
Add support for Xcode SwiftPM projects that store
Package.resolvedin.xcworkspacebundles, while keeping existing.xcodeprojbehavior intact.This is a stacked follow-up to:
Related issue:
Package.resolvedfile but using.xcodeprojbundles as manifests #7694Anything you want to highlight for special attention from reviewers?
This PR is intentionally scoped to the minimum delta on top of
#14394:FileFetcherdiscovery to include.xcworkspacebundles (including nested directories), and fetch:*.xcworkspace/contents.xcworkspacedataas support files*.xcworkspace/xcshareddata/swiftpm/Package.resolved.xcodeproj/project.pbxprojcan map to workspace-levelPackage.resolved.I avoided linking any
dependabot-updatesissues in this PR body.How will you know you've accomplished your goal?
Validation run in container:
bin/test swift rubocopbin/test swift spec/dependabot/swift/file_fetcher_spec.rb spec/dependabot/swift/file_parser/xcode_spm_resolver_spec.rb spec/dependabot/swift/file_updater/xcode_lockfile_updater_spec.rb spec/dependabot/swift/file_updater_spec.rbBoth commands pass on this branch.
Checklist