From 3eb24701b1e64d0cab5857ce9ff0e4cd14c204ea Mon Sep 17 00:00:00 2001 From: Felix Angelov Date: Mon, 27 Mar 2023 12:52:01 -0500 Subject: [PATCH] feat(code_push_client): include artifact size (#177) --- .../shorebird_cli/test/src/commands/publish_command_test.dart | 1 + .../shorebird_code_push_client/lib/src/code_push_client.dart | 1 + .../test/src/code_push_client_test.dart | 2 ++ 3 files changed, 4 insertions(+) diff --git a/packages/shorebird_cli/test/src/commands/publish_command_test.dart b/packages/shorebird_cli/test/src/commands/publish_command_test.dart index 24262f2a..c3647d28 100644 --- a/packages/shorebird_cli/test/src/commands/publish_command_test.dart +++ b/packages/shorebird_cli/test/src/commands/publish_command_test.dart @@ -39,6 +39,7 @@ void main() { arch: 'aarch64', platform: 'android', hash: '#', + size: 42, url: 'https://example.com', ); const release = Release( diff --git a/packages/shorebird_code_push_client/lib/src/code_push_client.dart b/packages/shorebird_code_push_client/lib/src/code_push_client.dart index d703bb17..7a47bca0 100644 --- a/packages/shorebird_code_push_client/lib/src/code_push_client.dart +++ b/packages/shorebird_code_push_client/lib/src/code_push_client.dart @@ -65,6 +65,7 @@ class CodePushClient { 'arch': arch, 'platform': platform, 'hash': hash, + 'size': '${file.length}', }); request.headers.addAll(_apiKeyHeader); final response = await _httpClient.send(request); diff --git a/packages/shorebird_code_push_client/test/src/code_push_client_test.dart b/packages/shorebird_code_push_client/test/src/code_push_client_test.dart index 2af766ad..ff8fee81 100644 --- a/packages/shorebird_code_push_client/test/src/code_push_client_test.dart +++ b/packages/shorebird_code_push_client/test/src/code_push_client_test.dart @@ -61,6 +61,7 @@ void main() { const arch = 'aarch64'; const platform = 'android'; const hash = 'test-hash'; + const size = 42; test('throws an exception if the http request fails (unknown)', () async { when(() => httpClient.send(any())).thenAnswer((_) async { @@ -137,6 +138,7 @@ void main() { arch: arch, platform: platform, hash: hash, + size: size, ), ), ),