diff --git a/packages/cli-platform-apple/src/tools/__tests__/getInfo.test.ts b/packages/cli-platform-apple/src/tools/__tests__/getInfo.test.ts index 8dbde0ff0..d89b1289d 100644 --- a/packages/cli-platform-apple/src/tools/__tests__/getInfo.test.ts +++ b/packages/cli-platform-apple/src/tools/__tests__/getInfo.test.ts @@ -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(` + + + + + + + +`); + (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([ diff --git a/packages/cli-platform-apple/src/tools/getInfo.ts b/packages/cli-platform-apple/src/tools/getInfo.ts index 7f45855d7..a5efe5877 100644 --- a/packages/cli-platform-apple/src/tools/getInfo.ts +++ b/packages/cli-platform-apple/src/tools/getInfo.ts @@ -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) {