apple build: short fix lines first in the device-family stop; test: a stopped build exits non-zero

This commit is contained in:
CRTkafa 2026-11-16 15:11:56 +00:00
parent b1ed6c1fc1
commit f29648b0a1
3 changed files with 17 additions and 1 deletions

View file

@ -201,7 +201,7 @@ export async function run(ctx: Ctx): Promise<void> {
const familyBlockers = deviceFamilies.filter(d => d.level === 'blocker');
for (const d of deviceFamilies) if (d.level === 'warn' || (d.level === 'blocker' && (dry || a.has('allow-device-gap')))) warn(TAG, `${d.msg}${d.fix ? ` -> ${d.fix}` : ''}`);
if (familyBlockers.length && !dry && !a.has('allow-device-gap'))
throw new Error(`stopped before the archive: ${familyBlockers.map(d => `${d.msg}. Fix: ${d.fix}`).join('\n')}\n(--allow-device-gap builds anyway)`);
throw new Error(`${familyFixLines(familyBlockers, config.apple?.ipad).join('\n')}\nstopped before the archive: ${familyBlockers.map(d => `${d.msg}. Fix: ${d.fix}`).join('\n')}\n(--allow-device-gap builds anyway)`);
const scan = discoverTargets(root, config);
const ids = [bundleId, ...scan.extensions.map(t => t.bundleId)];
@ -313,3 +313,13 @@ export async function run(ctx: Ctx): Promise<void> {
if (json) printJson(result);
done(TAG, `${relative(root, result.ipa)}: ${info.bundleId} ${info.version} (${info.build}). Next: storebound apple upload ${relative(root, result.ipa)} --dry`);
}
/** Short "fix:" lines put first in the device-family stop, so a truncated or piped log still shows the fix. Pure. */
export function familyFixLines(blockers: { msg: string }[], ipad: boolean | undefined): string[] {
const out = new Set<string>();
for (const b of blockers) {
if (/TARGETED_DEVICE_FAMILY = 1\b|no iPad\)/.test(b.msg)) out.add('fix: TARGETED_DEVICE_FAMILY "1,2" in the Xcode project (Supported Destinations: add iPad)');
if (ipad !== true && /iPad/.test(b.msg)) out.add('fix: apple.ipad: true in storebound.config.ts');
}
return [...out];
}