Skip to content

fix: keep only one reference of xcframeworks when spm enabled#364

Merged
hurali97 merged 2 commits into
mainfrom
fix/duplicate-xcfwk-spm
Jun 10, 2026
Merged

fix: keep only one reference of xcframeworks when spm enabled#364
hurali97 merged 2 commits into
mainfrom
fix/duplicate-xcfwk-spm

Conversation

@hurali97

Copy link
Copy Markdown
Member

Summary

This fixes the duplicate xcframeworks being generated when --add-spm-package is enabled. With this option, we see one instance of xcframeworks under spm-artifacts and other under package/build.

Test plan

Before:

before

After:

after

Copilot AI review requested due to automatic review settings June 10, 2026 08:10
@hurali97 hurali97 requested a review from adamTrz June 10, 2026 08:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes duplicated .xcframework artifacts when generating a local Swift Package Manager package (--add-spm-package) by moving XCFrameworks into spm-artifacts instead of copying them, so only a single set of artifacts remains.

Changes:

  • Switch XCFramework handling from copy (fs.cpSync) to move (fs.renameSync) during SPM artifact preparation.
  • Update generated README guidance to match the new spm-artifacts/ layout.
  • Update unit tests to assert the source .xcframework directories are removed after SPM preparation.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

File Description
packages/cli/src/brownfield/utils/prepareLocalSpmArtifacts.ts Moves XCFrameworks into spm-artifacts to eliminate duplicate artifact copies.
packages/cli/src/brownfield/utils/createLocalSpmPackage.ts Updates README instructions to refer to the spm-artifacts directory.
packages/cli/src/brownfield/utils/tests/prepareLocalSpmArtifacts.test.ts Updates assertions to verify XCFrameworks are moved (source removed) and signatures normalized.
packages/cli/src/brownfield/utils/tests/createLocalSpmPackage.test.ts Updates assertions to verify the original XCFramework path no longer exists after package creation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@adamTrz adamTrz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 🎉

@hurali97 hurali97 merged commit 05c557d into main Jun 10, 2026
14 of 16 checks passed
@hurali97 hurali97 deleted the fix/duplicate-xcfwk-spm branch June 10, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants