From 1b7bd7e14a7b8436fbfa3146e6572e6d9e39dfba Mon Sep 17 00:00:00 2001 From: Bryan Oltman Date: Fri, 13 Dec 2024 17:09:15 -0500 Subject: [PATCH] chore: add windows to ReleasePlatform enum (#2681) --- .../lib/src/commands/preview_command.dart | 1 + .../src/metadata/create_patch_metadata.g.dart | 1 + .../metadata/update_release_metadata.g.dart | 1 + .../src/commands/preview_command_test.dart | 18 ++++++++++++++++++ .../create_patch_artifact_request.g.dart | 1 + .../create_patch_artifact_response.g.dart | 1 + .../create_release_artifact_request.g.dart | 1 + .../create_release_artifact_response.g.dart | 1 + .../update_release_request.g.dart | 1 + .../lib/src/models/patch_artifact.g.dart | 1 + .../lib/src/models/release.g.dart | 1 + .../lib/src/models/release_artifact.g.dart | 1 + .../lib/src/models/release_platform.dart | 4 +++- 13 files changed, 32 insertions(+), 1 deletion(-) diff --git a/packages/shorebird_cli/lib/src/commands/preview_command.dart b/packages/shorebird_cli/lib/src/commands/preview_command.dart index e9006a26..a66acffa 100644 --- a/packages/shorebird_cli/lib/src/commands/preview_command.dart +++ b/packages/shorebird_cli/lib/src/commands/preview_command.dart @@ -244,6 +244,7 @@ class PreviewCommand extends ShorebirdCommand { deviceId: deviceId, track: track, ), + ReleasePlatform.windows => throw UnimplementedError(), }; } diff --git a/packages/shorebird_cli/lib/src/metadata/create_patch_metadata.g.dart b/packages/shorebird_cli/lib/src/metadata/create_patch_metadata.g.dart index 6e1cb858..5462a2c0 100644 --- a/packages/shorebird_cli/lib/src/metadata/create_patch_metadata.g.dart +++ b/packages/shorebird_cli/lib/src/metadata/create_patch_metadata.g.dart @@ -59,4 +59,5 @@ const _$ReleasePlatformEnumMap = { ReleasePlatform.android: 'android', ReleasePlatform.macos: 'macos', ReleasePlatform.ios: 'ios', + ReleasePlatform.windows: 'windows', }; diff --git a/packages/shorebird_cli/lib/src/metadata/update_release_metadata.g.dart b/packages/shorebird_cli/lib/src/metadata/update_release_metadata.g.dart index c814e50e..c54df8eb 100644 --- a/packages/shorebird_cli/lib/src/metadata/update_release_metadata.g.dart +++ b/packages/shorebird_cli/lib/src/metadata/update_release_metadata.g.dart @@ -47,4 +47,5 @@ const _$ReleasePlatformEnumMap = { ReleasePlatform.android: 'android', ReleasePlatform.macos: 'macos', ReleasePlatform.ios: 'ios', + ReleasePlatform.windows: 'windows', }; diff --git a/packages/shorebird_cli/test/src/commands/preview_command_test.dart b/packages/shorebird_cli/test/src/commands/preview_command_test.dart index 5b266659..73ca63b8 100644 --- a/packages/shorebird_cli/test/src/commands/preview_command_test.dart +++ b/packages/shorebird_cli/test/src/commands/preview_command_test.dart @@ -325,6 +325,24 @@ void main() { }); }); + group('when releasePlatform is not supported', () { + setUp(() { + when(() => release.platformStatuses).thenReturn({ + ReleasePlatform.windows: ReleaseStatus.active, + }); + when( + () => argResults['platform'], + ).thenReturn(ReleasePlatform.windows.name); + }); + + test('throws an UnimplementedError', () async { + await expectLater( + () => runWithOverrides(command.run), + throwsA(isA()), + ); + }); + }); + group('android', () { const releasePlatform = ReleasePlatform.android; const releaseArtifactUrl = 'https://example.com/release.aab'; diff --git a/packages/shorebird_code_push_protocol/lib/src/messages/create_patch_artifact/create_patch_artifact_request.g.dart b/packages/shorebird_code_push_protocol/lib/src/messages/create_patch_artifact/create_patch_artifact_request.g.dart index 50bee76c..b33a9910 100644 --- a/packages/shorebird_code_push_protocol/lib/src/messages/create_patch_artifact/create_patch_artifact_request.g.dart +++ b/packages/shorebird_code_push_protocol/lib/src/messages/create_patch_artifact/create_patch_artifact_request.g.dart @@ -48,4 +48,5 @@ const _$ReleasePlatformEnumMap = { ReleasePlatform.android: 'android', ReleasePlatform.macos: 'macos', ReleasePlatform.ios: 'ios', + ReleasePlatform.windows: 'windows', }; diff --git a/packages/shorebird_code_push_protocol/lib/src/messages/create_patch_artifact/create_patch_artifact_response.g.dart b/packages/shorebird_code_push_protocol/lib/src/messages/create_patch_artifact/create_patch_artifact_response.g.dart index 8fecfe8b..b9234710 100644 --- a/packages/shorebird_code_push_protocol/lib/src/messages/create_patch_artifact/create_patch_artifact_response.g.dart +++ b/packages/shorebird_code_push_protocol/lib/src/messages/create_patch_artifact/create_patch_artifact_response.g.dart @@ -45,4 +45,5 @@ const _$ReleasePlatformEnumMap = { ReleasePlatform.android: 'android', ReleasePlatform.macos: 'macos', ReleasePlatform.ios: 'ios', + ReleasePlatform.windows: 'windows', }; diff --git a/packages/shorebird_code_push_protocol/lib/src/messages/create_release_artifact/create_release_artifact_request.g.dart b/packages/shorebird_code_push_protocol/lib/src/messages/create_release_artifact/create_release_artifact_request.g.dart index 2fd33927..d1bac57b 100644 --- a/packages/shorebird_code_push_protocol/lib/src/messages/create_release_artifact/create_release_artifact_request.g.dart +++ b/packages/shorebird_code_push_protocol/lib/src/messages/create_release_artifact/create_release_artifact_request.g.dart @@ -53,4 +53,5 @@ const _$ReleasePlatformEnumMap = { ReleasePlatform.android: 'android', ReleasePlatform.macos: 'macos', ReleasePlatform.ios: 'ios', + ReleasePlatform.windows: 'windows', }; diff --git a/packages/shorebird_code_push_protocol/lib/src/messages/create_release_artifact/create_release_artifact_response.g.dart b/packages/shorebird_code_push_protocol/lib/src/messages/create_release_artifact/create_release_artifact_response.g.dart index fa2fc01f..6ffebe4c 100644 --- a/packages/shorebird_code_push_protocol/lib/src/messages/create_release_artifact/create_release_artifact_response.g.dart +++ b/packages/shorebird_code_push_protocol/lib/src/messages/create_release_artifact/create_release_artifact_response.g.dart @@ -45,4 +45,5 @@ const _$ReleasePlatformEnumMap = { ReleasePlatform.android: 'android', ReleasePlatform.macos: 'macos', ReleasePlatform.ios: 'ios', + ReleasePlatform.windows: 'windows', }; diff --git a/packages/shorebird_code_push_protocol/lib/src/messages/update_release/update_release_request.g.dart b/packages/shorebird_code_push_protocol/lib/src/messages/update_release/update_release_request.g.dart index a12b26ab..6feed5e3 100644 --- a/packages/shorebird_code_push_protocol/lib/src/messages/update_release/update_release_request.g.dart +++ b/packages/shorebird_code_push_protocol/lib/src/messages/update_release/update_release_request.g.dart @@ -43,4 +43,5 @@ const _$ReleasePlatformEnumMap = { ReleasePlatform.android: 'android', ReleasePlatform.macos: 'macos', ReleasePlatform.ios: 'ios', + ReleasePlatform.windows: 'windows', }; diff --git a/packages/shorebird_code_push_protocol/lib/src/models/patch_artifact.g.dart b/packages/shorebird_code_push_protocol/lib/src/models/patch_artifact.g.dart index 1fbf2b42..a8d30501 100644 --- a/packages/shorebird_code_push_protocol/lib/src/models/patch_artifact.g.dart +++ b/packages/shorebird_code_push_protocol/lib/src/models/patch_artifact.g.dart @@ -44,4 +44,5 @@ const _$ReleasePlatformEnumMap = { ReleasePlatform.android: 'android', ReleasePlatform.macos: 'macos', ReleasePlatform.ios: 'ios', + ReleasePlatform.windows: 'windows', }; diff --git a/packages/shorebird_code_push_protocol/lib/src/models/release.g.dart b/packages/shorebird_code_push_protocol/lib/src/models/release.g.dart index 78c33c56..14cdf3ae 100644 --- a/packages/shorebird_code_push_protocol/lib/src/models/release.g.dart +++ b/packages/shorebird_code_push_protocol/lib/src/models/release.g.dart @@ -67,4 +67,5 @@ const _$ReleasePlatformEnumMap = { ReleasePlatform.android: 'android', ReleasePlatform.macos: 'macos', ReleasePlatform.ios: 'ios', + ReleasePlatform.windows: 'windows', }; diff --git a/packages/shorebird_code_push_protocol/lib/src/models/release_artifact.g.dart b/packages/shorebird_code_push_protocol/lib/src/models/release_artifact.g.dart index 333a6c41..dfd938d7 100644 --- a/packages/shorebird_code_push_protocol/lib/src/models/release_artifact.g.dart +++ b/packages/shorebird_code_push_protocol/lib/src/models/release_artifact.g.dart @@ -52,4 +52,5 @@ const _$ReleasePlatformEnumMap = { ReleasePlatform.android: 'android', ReleasePlatform.macos: 'macos', ReleasePlatform.ios: 'ios', + ReleasePlatform.windows: 'windows', }; diff --git a/packages/shorebird_code_push_protocol/lib/src/models/release_platform.dart b/packages/shorebird_code_push_protocol/lib/src/models/release_platform.dart index 11e51bbb..0c7a6f66 100644 --- a/packages/shorebird_code_push_protocol/lib/src/models/release_platform.dart +++ b/packages/shorebird_code_push_protocol/lib/src/models/release_platform.dart @@ -5,7 +5,9 @@ enum ReleasePlatform { // ignore: public_member_api_docs macos('macOS'), // ignore: public_member_api_docs - ios('iOS'); + ios('iOS'), + // ignore: public_member_api_docs + windows('Windows'); const ReleasePlatform(this.displayName);