fix(shorebird_cli): disallow obfuscation for iOS releases (#1724)

This commit is contained in:
Bryan Oltman
2024-02-09 15:25:48 -05:00
committed by GitHub
parent ce00f4f65c
commit 4a02516827
2 changed files with 26 additions and 0 deletions
@@ -96,6 +96,16 @@ make smaller updates to your app.
return e.exitCode.code;
}
if (results.rest.contains('--obfuscate')) {
// Obfuscated releases break patching, so we don't support them.
// See https://github.com/shorebirdtech/shorebird/issues/1619
logger
..err('Shorebird does not currently support obfuscation on iOS.')
..info(
'''We hope to support obfuscation in the future. We are tracking this work at ${link(uri: Uri.parse('https://github.com/shorebirdtech/shorebird/issues/1619'))}.''');
return ExitCode.usage.code;
}
final codesign = results['codesign'] == true;
if (!codesign) {
logger
@@ -343,6 +343,22 @@ flutter:
).called(1);
});
group('when obfuscate flag is passed', () {
setUp(() {
when(() => argResults.rest).thenReturn(['--obfuscate']);
});
test('prints error and exits with usage code', () async {
final exitCode = await runWithOverrides(command.run);
expect(exitCode, equals(ExitCode.usage.code));
verify(
() => logger
.err('Shorebird does not currently support obfuscation on iOS.'),
).called(1);
});
});
group('when codesign is disabled', () {
setUp(() {
when(() => argResults['codesign']).thenReturn(false);