fix(shorebird_cli): buildIpa error parsing in Xcode >= 16.0 (#2593)

This commit is contained in:
Felix Angelov
2024-10-29 14:44:41 -05:00
committed by GitHub
parent 32d66e7be2
commit 4ed439cbf0
3 changed files with 43 additions and 4 deletions
@@ -372,8 +372,7 @@ Please file a bug at https://github.com/shorebirdtech/shorebird/issues/new with
// error: exportArchive: Communication with Apple failed
// error: exportArchive: No signing certificate "iOS Distribution" found
// error: exportArchive: Communication with Apple failed
final exportArchiveRegex = RegExp(r'error: exportArchive: (.+)$');
final exportArchiveRegex = RegExp(r'error: exportArchive:? (.+)$');
return stderr
.split('\n')
.map((l) => l.trim())
@@ -2,7 +2,6 @@ import 'dart:async';
import 'dart:io';
import 'package:crypto/crypto.dart';
import 'package:io/io.dart';
import 'package:mason_logger/mason_logger.dart';
import 'package:path/path.dart' as p;
import 'package:shorebird_cli/src/archive_analysis/android_archive_differ.dart';
@@ -877,7 +877,7 @@ Either run `flutter pub get` manually, or follow the steps in ${cannotRunInVSCod
});
});
group('with error message in stderr', () {
group('with error message in stderr (Xcode <= 15.x)', () {
setUp(() {
when(() => buildProcessResult.exitCode)
.thenReturn(ExitCode.success.code);
@@ -908,6 +908,47 @@ error: exportArchive: No signing certificate "iOS Distribution" found''',
'message',
'''
Failed to build:
Communication with Apple failed
No signing certificate "iOS Distribution" found
Team "My Team" does not have permission to create "iOS App Store" provisioning profiles.
No profiles for 'com.example.co' were found''',
),
),
);
});
});
group('with error message in stderr (Xcode >= 16.x)', () {
setUp(() {
when(() => buildProcessResult.exitCode)
.thenReturn(ExitCode.success.code);
when(() => buildProcessResult.stderr).thenReturn(
'''
Encountered error while creating the IPA:
error: exportArchive Communication with Apple failed
error: exportArchive No signing certificate "iOS Distribution" found
error: exportArchive Communication with Apple failed
error: exportArchive No signing certificate "iOS Distribution" found
error: exportArchive Team "My Team" does not have permission to create "iOS App Store" provisioning profiles.
error: exportArchive No profiles for 'com.example.co' were found
error: exportArchive Communication with Apple failed
error: exportArchive No signing certificate "iOS Distribution" found
error: exportArchive Communication with Apple failed
error: exportArchive No signing certificate "iOS Distribution" found
error: exportArchive Communication with Apple failed
error: exportArchive No signing certificate "iOS Distribution" found''',
);
});
test('throws ArtifactBuildException with error message', () {
expect(
() => runWithOverrides(() => builder.buildIpa(codesign: false)),
throwsA(
isA<ArtifactBuildException>().having(
(e) => e.message,
'message',
'''
Failed to build:
Communication with Apple failed
No signing certificate "iOS Distribution" found
Team "My Team" does not have permission to create "iOS App Store" provisioning profiles.