apple build: --derived-data (default <out>/DerivedData with --out), --path-free (Swift/clang prefix maps, no serialized debug options) and an archive path scan

This commit is contained in:
CRTkafa 2026-10-26 19:12:21 +07:00
parent cb20912f0e
commit f109c519ae
10 changed files with 276 additions and 7 deletions

View file

@ -408,6 +408,23 @@ describe('CLI dry runs (no store access)', () => {
expect(j.exportOptions.method).toBe('app-store-connect');
expect(j.steps[0]).toContain('CURRENT_PROJECT_VERSION=42');
expect(j.steps[0]).toContain('-authenticationKeyPath $ASC_P8');
// no --out: Xcode's DerivedData stays, nothing remapped
expect(j).toMatchObject({ derivedData: '(Xcode default)', pathFree: false });
expect(j.steps[0]).not.toContain('-derivedDataPath');
expect(j.steps[0]).not.toContain('prefix-map');
});
test('apple build --dry --json: --out makes DerivedData hermetic, --path-free adds the prefix maps', () => {
const d = project('cli-apple-dd');
const r = cli(d, ['apple', 'build', '--dry', '--json', '--build-number', '42', '--out', 'out/ios', '--path-free']);
expect(r.exitCode).toBe(0);
const j = JSON.parse(r.stdout.toString());
expect(j.pathFree).toBe(true);
expect(j.derivedData.split(String.fromCharCode(92)).join('/')).toMatch(/out\/ios\/DerivedData$/);
expect(j.steps[0]).toContain('-derivedDataPath');
expect(j.steps[0]).toContain('OTHER_SWIFT_FLAGS=');
expect(j.steps[0]).toContain('-ffile-prefix-map=');
const e = cli(d, ['apple', 'build', '--dry', '--json', '--build-number', '42', '--out', 'out/ios', '--derived-data', 'dd']);
expect(JSON.parse(e.stdout.toString()).derivedData.split(String.fromCharCode(92)).join('/')).toMatch(/\/dd$/);
});
test('play build --dry --json: task, versionCode, signing source', () => {
const r = cli(project('cli-play'), ['play', 'build', '--dry', '--json', '--version-code', '12']);