Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/gold-loops-live.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@callstack/brownfield-cli': minor
---

keep only one reference of xcframeworks when spm enabled
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe('createLocalSpmPackage', () => {
).toBe(true);
expect(
fs.existsSync(path.join(tempDir, 'BrownfieldLib.xcframework'))
).toBe(true);
).toBe(false);

const readmePath = path.join(tempDir, 'README.md');
expect(fs.existsSync(readmePath)).toBe(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('prepareLocalSpmArtifacts', () => {
fs.rmSync(tempDir, { recursive: true, force: true });
});

it('copies xcframeworks into spm-artifacts and removes embedded code signature data', () => {
it('moves xcframeworks into spm-artifacts and removes embedded code signature data', () => {
createSignedMockXcframework(tempDir, 'React');

const spmArtifactsDir = prepareLocalSpmArtifacts({
Expand Down Expand Up @@ -82,28 +82,7 @@ describe('prepareLocalSpmArtifacts', () => {
['--remove-signature', path.join(copiedFrameworkDir, 'React')],
expect.objectContaining({ stdio: 'pipe' })
);
expect(
fs.existsSync(
path.join(
tempDir,
'React.xcframework',
'_CodeSignature',
'CodeResources'
)
)
).toBe(true);
expect(
fs.existsSync(
path.join(
tempDir,
'React.xcframework',
'ios-arm64_x86_64-simulator',
'React.framework',
'_CodeSignature',
'CodeResources'
)
)
).toBe(true);
expect(fs.existsSync(path.join(tempDir, 'React.xcframework'))).toBe(false);
});

it('ignores remove-signature errors for unsigned binaries', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/brownfield/utils/createLocalSpmPackage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ ${frameworks}
1. In Xcode, choose **File > Add Package Dependencies...**
2. Click **Add Local...**
3. Select this folder, the one containing both \`Package.swift\` and the \`*.xcframework\` artifacts
3. Select this folder, the one containing \`Package.swift\` and the \`spm-artifacts\` directory
4. Add the \`${libraryName}\` library product to your app target
## Troubleshooting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export function prepareLocalSpmArtifacts({
const sourcePath = path.join(packageDir, `${targetName}.xcframework`);
const destinationPath = path.join(spmArtifactsDir, `${targetName}.xcframework`);

fs.cpSync(sourcePath, destinationPath, { recursive: true });
fs.renameSync(sourcePath, destinationPath);
normalizeCopiedXcframeworkSignature(destinationPath);
}

Expand Down
Loading