Skip to content
Open
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
28 changes: 28 additions & 0 deletions packages/cli-platform-apple/src/tools/__tests__/getInfo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,34 @@ describe('getInfo', () => {
(execa.sync as jest.Mock).mockReturnValue({stdout: '{}'});
getInfo({isWorkspace: true, name} as IOSProjectInfo, 'some/path');

const execaSync = execa.sync as jest.Mock;
// Should not call on Pods or the other misc groups
expect(execaSync.mock.calls).toEqual([
[
'xcodebuild',
['-list', '-json', '-project', `some/path/${name}.xcodeproj`],
],
]);
});
it('handles xcodeproj location in container in a ', () => {
const name = `YourProjectName`;
(fs.readFileSync as jest.Mock)
.mockReturnValueOnce(`<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "container:${name}.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
<FileRef
location = "group:container/some_other_file.mm">
</FileRef>
</Workspace>`);
(execa.sync as jest.Mock).mockReturnValue({stdout: '{}'});
getInfo({isWorkspace: true, name} as IOSProjectInfo, 'some/path');

const execaSync = execa.sync as jest.Mock;
// Should not call on Pods or the other misc groups
expect(execaSync.mock.calls).toEqual([
Expand Down
5 changes: 4 additions & 1 deletion packages/cli-platform-apple/src/tools/getInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ export function getInfo(
'-list',
'-json',
'-project',
path.join(sourceDir, location.replace('group:', '')),
path.join(
sourceDir,
location.replace('group:', '').replace('container:', ''),
),
]);
const info = parseTargetList(xcodebuild.stdout);
if (!info) {
Expand Down