diff --git a/packages/shorebird_cli/lib/src/commands/build_command.dart b/packages/shorebird_cli/lib/src/commands/build_command.dart index 9742856d..f362bb5b 100644 --- a/packages/shorebird_cli/lib/src/commands/build_command.dart +++ b/packages/shorebird_cli/lib/src/commands/build_command.dart @@ -64,7 +64,7 @@ class BuildCommand extends ShorebirdCommand with ShorebirdEngineMixin { 'build', // This is temporary because the Shorebird engine currently // only supports Android. - 'apk', + 'appbundle', '--release', '--local-engine-src-path', shorebirdEnginePath, @@ -72,6 +72,7 @@ class BuildCommand extends ShorebirdCommand with ShorebirdEngineMixin { // This is temporary because the Shorebird engine currently // only supports Android arm64. 'android_release_arm64', + ...results.rest, ]; final result = await runProcess( diff --git a/packages/shorebird_cli/lib/src/commands/publish_command.dart b/packages/shorebird_cli/lib/src/commands/publish_command.dart index bb768543..77cf592f 100644 --- a/packages/shorebird_cli/lib/src/commands/publish_command.dart +++ b/packages/shorebird_cli/lib/src/commands/publish_command.dart @@ -107,9 +107,10 @@ product_id: $productId logger.detail( 'Deploying ${artifact.path} to $productId (${pubspecYaml.version})', ); + final version = pubspecYaml.version!; await codePushClient.createPatch( artifactPath: artifact.path, - baseVersion: pubspecYaml.version.toString(), + baseVersion: '${version.major}.${version.minor}.${version.patch}', productId: productId, channel: 'stable', ); diff --git a/packages/shorebird_cli/test/src/commands/build_command_test.dart b/packages/shorebird_cli/test/src/commands/build_command_test.dart index cfb0d268..9404ab4f 100644 --- a/packages/shorebird_cli/test/src/commands/build_command_test.dart +++ b/packages/shorebird_cli/test/src/commands/build_command_test.dart @@ -1,6 +1,7 @@ import 'dart:io'; import 'dart:typed_data'; +import 'package:args/args.dart'; import 'package:mason_logger/mason_logger.dart'; import 'package:mocktail/mocktail.dart'; import 'package:shorebird_cli/src/auth/auth.dart'; @@ -9,6 +10,8 @@ import 'package:shorebird_cli/src/commands/build_command.dart'; import 'package:shorebird_code_push_client/shorebird_code_push_client.dart'; import 'package:test/test.dart'; +class _MockArgResults extends Mock implements ArgResults {} + class _MockAuth extends Mock implements Auth {} class _MockLogger extends Mock implements Logger {} @@ -26,6 +29,7 @@ void main() { projectId: 'test-project-id', ); + late ArgResults argResults; late Auth auth; late CodePushClient codePushClient; late Logger logger; @@ -33,6 +37,7 @@ void main() { late BuildCommand buildCommand; setUp(() { + argResults = _MockArgResults(); auth = _MockAuth(); codePushClient = _MockCodePushClient(); logger = _MockLogger(); @@ -44,8 +49,9 @@ void main() { runProcess: (executable, arguments, {bool runInShell = false}) async { return processResult; }, - ); + )..testArgResults = argResults; + when(() => argResults.rest).thenReturn([]); when( () => codePushClient.downloadEngine(any()), ).thenAnswer((_) async => Uint8List.fromList([]));