refactor: use ReleasePlatform type instead of String (#867)
This commit is contained in:
@@ -134,7 +134,7 @@ This app may not exist or you may not have permission to view it.''',
|
||||
Future<void> ensureReleaseHasNoArtifacts({
|
||||
required String appId,
|
||||
required Release existingRelease,
|
||||
required String platform,
|
||||
required ReleasePlatform platform,
|
||||
}) async {
|
||||
logger.detail('Verifying ability to release');
|
||||
|
||||
@@ -228,7 +228,7 @@ Please create a release using "shorebird release" and try again.
|
||||
required String appId,
|
||||
required int releaseId,
|
||||
required Map<Arch, ArchMetadata> architectures,
|
||||
required String platform,
|
||||
required ReleasePlatform platform,
|
||||
}) async {
|
||||
// TODO(bryanoltman): update this function to only make one call to
|
||||
// getReleaseArtifacts.
|
||||
@@ -265,7 +265,7 @@ Please create a release using "shorebird release" and try again.
|
||||
required String appId,
|
||||
required int releaseId,
|
||||
required String arch,
|
||||
required String platform,
|
||||
required ReleasePlatform platform,
|
||||
}) async {
|
||||
final fetchReleaseArtifactProgress = logger.progress(
|
||||
'Fetching $arch artifact',
|
||||
@@ -295,7 +295,7 @@ Please create a release using "shorebird release" and try again.
|
||||
required String appId,
|
||||
required int releaseId,
|
||||
required String arch,
|
||||
required String platform,
|
||||
required ReleasePlatform platform,
|
||||
}) async {
|
||||
final fetchReleaseArtifactProgress = logger.progress(
|
||||
'Fetching $arch artifact',
|
||||
@@ -327,7 +327,7 @@ Please create a release using "shorebird release" and try again.
|
||||
Future<void> createAndroidReleaseArtifacts({
|
||||
required String appId,
|
||||
required int releaseId,
|
||||
required String platform,
|
||||
required ReleasePlatform platform,
|
||||
required String aabPath,
|
||||
required Map<Arch, ArchMetadata> architectures,
|
||||
String? flavor,
|
||||
@@ -400,7 +400,7 @@ aab artifact already exists, continuing...''',
|
||||
Future<void> createAndroidArchiveReleaseArtifacts({
|
||||
required String appId,
|
||||
required int releaseId,
|
||||
required String platform,
|
||||
required ReleasePlatform platform,
|
||||
required String aarPath,
|
||||
required String extractedAarDir,
|
||||
required Map<Arch, ArchMetadata> architectures,
|
||||
@@ -479,7 +479,7 @@ aar artifact already exists, continuing...''',
|
||||
releaseId: releaseId,
|
||||
artifactPath: ipaPath,
|
||||
arch: 'ipa',
|
||||
platform: 'ios',
|
||||
platform: ReleasePlatform.ios,
|
||||
hash: sha256.convert(await ipaFile.readAsBytes()).toString(),
|
||||
);
|
||||
} catch (error) {
|
||||
@@ -495,7 +495,7 @@ aar artifact already exists, continuing...''',
|
||||
Future<void> completeRelease({
|
||||
required String appId,
|
||||
required int releaseId,
|
||||
required String platform,
|
||||
required ReleasePlatform platform,
|
||||
}) async {
|
||||
final completeReleaseProgress = logger.progress('Completing release');
|
||||
try {
|
||||
@@ -535,7 +535,7 @@ aar artifact already exists, continuing...''',
|
||||
Future<void> createPatchArtifacts({
|
||||
required String appId,
|
||||
required Patch patch,
|
||||
required String platform,
|
||||
required ReleasePlatform platform,
|
||||
required Map<Arch, PatchArtifactBundle> patchArtifactBundles,
|
||||
}) async {
|
||||
final createArtifactProgress = logger.progress('Uploading artifacts');
|
||||
@@ -582,7 +582,7 @@ aar artifact already exists, continuing...''',
|
||||
Future<void> publishPatch({
|
||||
required String appId,
|
||||
required int releaseId,
|
||||
required String platform,
|
||||
required ReleasePlatform platform,
|
||||
required String channelName,
|
||||
required Map<Arch, PatchArtifactBundle> patchArtifactBundles,
|
||||
}) async {
|
||||
|
||||
@@ -144,7 +144,7 @@ of the Android app that is using this module.''',
|
||||
return ExitCode.success.code;
|
||||
}
|
||||
|
||||
const platformName = 'android';
|
||||
const platform = ReleasePlatform.android;
|
||||
final channelName = results['channel'] as String;
|
||||
|
||||
final release = await codePushClientWrapper.getRelease(
|
||||
@@ -194,14 +194,14 @@ https://github.com/shorebirdtech/shorebird/issues/472
|
||||
appId: appId,
|
||||
releaseId: release.id,
|
||||
architectures: architectures,
|
||||
platform: platformName,
|
||||
platform: platform,
|
||||
);
|
||||
|
||||
final releaseAarArtifact = await codePushClientWrapper.getReleaseArtifact(
|
||||
appId: appId,
|
||||
releaseId: release.id,
|
||||
arch: 'aar',
|
||||
platform: platformName,
|
||||
platform: platform,
|
||||
);
|
||||
|
||||
final downloadReleaseAarProgress = logger.progress(
|
||||
@@ -280,7 +280,7 @@ https://github.com/shorebirdtech/shorebird/issues/472
|
||||
if (flavor != null) '🍧 Flavor: ${lightCyan.wrap(flavor)}',
|
||||
'📦 Release Version: ${lightCyan.wrap(releaseVersion)}',
|
||||
'📺 Channel: ${lightCyan.wrap(channelName)}',
|
||||
'''🕹️ Platform: ${lightCyan.wrap(platformName)} ${lightCyan.wrap('[${archMetadata.join(', ')}]')}''',
|
||||
'''🕹️ Platform: ${lightCyan.wrap(platform.name)} ${lightCyan.wrap('[${archMetadata.join(', ')}]')}''',
|
||||
];
|
||||
|
||||
logger.info(
|
||||
@@ -305,7 +305,7 @@ ${summary.join('\n')}
|
||||
await codePushClientWrapper.publishPatch(
|
||||
appId: appId,
|
||||
releaseId: release.id,
|
||||
platform: platformName,
|
||||
platform: platform,
|
||||
channelName: channelName,
|
||||
patchArtifactBundles: patchArtifactBundles,
|
||||
);
|
||||
|
||||
@@ -16,6 +16,7 @@ import 'package:shorebird_cli/src/shorebird_config_mixin.dart';
|
||||
import 'package:shorebird_cli/src/shorebird_environment.dart';
|
||||
import 'package:shorebird_cli/src/shorebird_release_version_mixin.dart';
|
||||
import 'package:shorebird_cli/src/shorebird_validation_mixin.dart';
|
||||
import 'package:shorebird_code_push_client/shorebird_code_push_client.dart';
|
||||
|
||||
/// {@template patch_android_command}
|
||||
/// `shorebird patch android`
|
||||
@@ -107,7 +108,7 @@ class PatchAndroidCommand extends ShorebirdCommand
|
||||
|
||||
await cache.updateAll();
|
||||
|
||||
const platformName = 'android';
|
||||
const platform = ReleasePlatform.android;
|
||||
final channelName = results['channel'] as String;
|
||||
final flavor = results['flavor'] as String?;
|
||||
final target = results['target'] as String?;
|
||||
@@ -199,14 +200,14 @@ https://github.com/shorebirdtech/shorebird/issues/472
|
||||
appId: app.appId,
|
||||
releaseId: release.id,
|
||||
architectures: architectures,
|
||||
platform: platformName,
|
||||
platform: platform,
|
||||
);
|
||||
|
||||
final releaseAabArtifact = await codePushClientWrapper.getReleaseArtifact(
|
||||
appId: app.appId,
|
||||
releaseId: release.id,
|
||||
arch: 'aab',
|
||||
platform: platformName,
|
||||
platform: platform,
|
||||
);
|
||||
|
||||
final releaseArtifactPaths = <Arch, String>{};
|
||||
@@ -321,7 +322,7 @@ https://github.com/shorebirdtech/shorebird/issues/472
|
||||
if (flavor != null) '🍧 Flavor: ${lightCyan.wrap(flavor)}',
|
||||
'📦 Release Version: ${lightCyan.wrap(releaseVersion)}',
|
||||
'📺 Channel: ${lightCyan.wrap(channelName)}',
|
||||
'''🕹️ Platform: ${lightCyan.wrap(platformName)} ${lightCyan.wrap('[${archMetadata.join(', ')}]')}''',
|
||||
'''🕹️ Platform: ${lightCyan.wrap(platform.name)} ${lightCyan.wrap('[${archMetadata.join(', ')}]')}''',
|
||||
];
|
||||
|
||||
logger.info(
|
||||
@@ -346,7 +347,7 @@ ${summary.join('\n')}
|
||||
await codePushClientWrapper.publishPatch(
|
||||
appId: appId,
|
||||
releaseId: release.id,
|
||||
platform: platformName,
|
||||
platform: platform,
|
||||
channelName: channelName,
|
||||
patchArtifactBundles: patchArtifactBundles,
|
||||
);
|
||||
|
||||
@@ -15,6 +15,7 @@ import 'package:shorebird_cli/src/shorebird_build_mixin.dart';
|
||||
import 'package:shorebird_cli/src/shorebird_config_mixin.dart';
|
||||
import 'package:shorebird_cli/src/shorebird_environment.dart';
|
||||
import 'package:shorebird_cli/src/shorebird_validation_mixin.dart';
|
||||
import 'package:shorebird_code_push_client/shorebird_code_push_client.dart';
|
||||
|
||||
/// {@template patch_ios_command}
|
||||
/// `shorebird patch ios` command.
|
||||
@@ -87,7 +88,7 @@ class PatchIosCommand extends ShorebirdCommand
|
||||
|
||||
const arch = 'aarch64';
|
||||
const channelName = 'stable';
|
||||
const platformName = 'ios';
|
||||
const platform = ReleasePlatform.ios;
|
||||
final force = results['force'] == true;
|
||||
final dryRun = results['dry-run'] == true;
|
||||
final flavor = results['flavor'] as String?;
|
||||
@@ -204,7 +205,7 @@ https://github.com/shorebirdtech/shorebird/issues/472
|
||||
if (flavor != null) '🍧 Flavor: ${lightCyan.wrap(flavor)}',
|
||||
'📦 Release Version: ${lightCyan.wrap(releaseVersion)}',
|
||||
'📺 Channel: ${lightCyan.wrap(channelName)}',
|
||||
'''🕹️ Platform: ${lightCyan.wrap(platformName)} ${lightCyan.wrap('[$arch (${formatBytes(aotFileSize)})]')}''',
|
||||
'''🕹️ Platform: ${lightCyan.wrap(platform.name)} ${lightCyan.wrap('[$arch (${formatBytes(aotFileSize)})]')}''',
|
||||
];
|
||||
|
||||
logger.info(
|
||||
@@ -231,7 +232,7 @@ ${summary.join('\n')}
|
||||
await codePushClientWrapper.publishPatch(
|
||||
appId: appId,
|
||||
releaseId: release.id,
|
||||
platform: platformName,
|
||||
platform: platform,
|
||||
channelName: channelName,
|
||||
patchArtifactBundles: {
|
||||
Arch.arm64: PatchArtifactBundle(
|
||||
|
||||
@@ -12,6 +12,7 @@ import 'package:shorebird_cli/src/logger.dart';
|
||||
import 'package:shorebird_cli/src/shorebird_config_mixin.dart';
|
||||
import 'package:shorebird_cli/src/shorebird_validation_mixin.dart';
|
||||
import 'package:shorebird_cli/src/third_party/flutter_tools/lib/flutter_tools.dart';
|
||||
import 'package:shorebird_code_push_client/shorebird_code_push_client.dart';
|
||||
|
||||
/// {@template preview_command}
|
||||
/// `shorebird preview` command.
|
||||
@@ -49,7 +50,7 @@ class PreviewCommand extends ShorebirdCommand
|
||||
return error.exitCode.code;
|
||||
}
|
||||
|
||||
const platform = 'android';
|
||||
const platform = ReleasePlatform.android;
|
||||
final appId = results['app-id'] as String? ?? await promptForApp();
|
||||
|
||||
if (appId == null) {
|
||||
|
||||
@@ -13,6 +13,7 @@ import 'package:shorebird_cli/src/shorebird_config_mixin.dart';
|
||||
import 'package:shorebird_cli/src/shorebird_environment.dart';
|
||||
import 'package:shorebird_cli/src/shorebird_release_version_mixin.dart';
|
||||
import 'package:shorebird_cli/src/shorebird_validation_mixin.dart';
|
||||
import 'package:shorebird_code_push_client/shorebird_code_push_client.dart';
|
||||
|
||||
/// {@template release_aar_command}
|
||||
/// `shorebird release aar`
|
||||
@@ -86,7 +87,7 @@ make smaller updates to your app.
|
||||
return ExitCode.config.code;
|
||||
}
|
||||
|
||||
const platformName = 'android';
|
||||
const platform = ReleasePlatform.android;
|
||||
final flavor = results['flavor'] as String?;
|
||||
final buildNumber = results['build-number'] as String;
|
||||
final releaseVersion = results['release-version'] as String;
|
||||
@@ -104,7 +105,7 @@ make smaller updates to your app.
|
||||
await codePushClientWrapper.ensureReleaseHasNoArtifacts(
|
||||
appId: app.appId,
|
||||
existingRelease: existingRelease,
|
||||
platform: platformName,
|
||||
platform: platform,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -124,7 +125,7 @@ make smaller updates to your app.
|
||||
'''📱 App: ${lightCyan.wrap(app.displayName)} ${lightCyan.wrap('(${app.appId})')}''',
|
||||
if (flavor != null) '🍧 Flavor: ${lightCyan.wrap(flavor)}',
|
||||
'📦 Release Version: ${lightCyan.wrap(releaseVersion)}',
|
||||
'''🕹️ Platform: ${lightCyan.wrap(platformName)} ${lightCyan.wrap('(${archNames.join(', ')})')}''',
|
||||
'''🕹️ Platform: ${lightCyan.wrap(platform.name)} ${lightCyan.wrap('(${archNames.join(', ')})')}''',
|
||||
];
|
||||
|
||||
logger.info('''
|
||||
@@ -175,7 +176,7 @@ ${summary.join('\n')}
|
||||
await codePushClientWrapper.createAndroidArchiveReleaseArtifacts(
|
||||
appId: app.appId,
|
||||
releaseId: release.id,
|
||||
platform: platformName,
|
||||
platform: platform,
|
||||
aarPath: aarArtifactPath(
|
||||
packageName: androidPackageName!,
|
||||
buildNumber: buildNumber,
|
||||
@@ -187,7 +188,7 @@ ${summary.join('\n')}
|
||||
await codePushClientWrapper.completeRelease(
|
||||
appId: app.appId,
|
||||
releaseId: release.id,
|
||||
platform: platformName,
|
||||
platform: platform,
|
||||
);
|
||||
|
||||
logger
|
||||
|
||||
@@ -11,6 +11,7 @@ import 'package:shorebird_cli/src/shorebird_config_mixin.dart';
|
||||
import 'package:shorebird_cli/src/shorebird_environment.dart';
|
||||
import 'package:shorebird_cli/src/shorebird_release_version_mixin.dart';
|
||||
import 'package:shorebird_cli/src/shorebird_validation_mixin.dart';
|
||||
import 'package:shorebird_code_push_client/shorebird_code_push_client.dart';
|
||||
|
||||
/// {@template release_android_command}
|
||||
/// `shorebird release android`
|
||||
@@ -74,7 +75,7 @@ make smaller updates to your app.
|
||||
return e.exitCode.code;
|
||||
}
|
||||
|
||||
const platformName = 'android';
|
||||
const platform = ReleasePlatform.android;
|
||||
final flavor = results['flavor'] as String?;
|
||||
final target = results['target'] as String?;
|
||||
final generateApk = results['artifact'] as String == 'apk';
|
||||
@@ -123,7 +124,7 @@ make smaller updates to your app.
|
||||
await codePushClientWrapper.ensureReleaseHasNoArtifacts(
|
||||
appId: app.appId,
|
||||
existingRelease: existingRelease,
|
||||
platform: platformName,
|
||||
platform: platform,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -132,7 +133,7 @@ make smaller updates to your app.
|
||||
'''📱 App: ${lightCyan.wrap(app.displayName)} ${lightCyan.wrap('(${app.appId})')}''',
|
||||
if (flavor != null) '🍧 Flavor: ${lightCyan.wrap(flavor)}',
|
||||
'📦 Release Version: ${lightCyan.wrap(releaseVersion)}',
|
||||
'''🕹️ Platform: ${lightCyan.wrap(platformName)} ${lightCyan.wrap('(${archNames.join(', ')})')}''',
|
||||
'''🕹️ Platform: ${lightCyan.wrap(platform.name)} ${lightCyan.wrap('(${archNames.join(', ')})')}''',
|
||||
];
|
||||
|
||||
logger.info('''
|
||||
@@ -176,7 +177,7 @@ ${summary.join('\n')}
|
||||
appId: app.appId,
|
||||
releaseId: release.id,
|
||||
aabPath: bundlePath,
|
||||
platform: platformName,
|
||||
platform: platform,
|
||||
architectures: architectures,
|
||||
flavor: flavor,
|
||||
);
|
||||
@@ -184,7 +185,7 @@ ${summary.join('\n')}
|
||||
await codePushClientWrapper.completeRelease(
|
||||
appId: app.appId,
|
||||
releaseId: release.id,
|
||||
platform: platformName,
|
||||
platform: platform,
|
||||
);
|
||||
|
||||
logger
|
||||
|
||||
@@ -12,6 +12,7 @@ import 'package:shorebird_cli/src/shorebird_build_mixin.dart';
|
||||
import 'package:shorebird_cli/src/shorebird_config_mixin.dart';
|
||||
import 'package:shorebird_cli/src/shorebird_environment.dart';
|
||||
import 'package:shorebird_cli/src/shorebird_validation_mixin.dart';
|
||||
import 'package:shorebird_code_push_client/shorebird_code_push_client.dart';
|
||||
|
||||
/// {@template release_ios_command}
|
||||
/// `shorebird release ios-preview`
|
||||
@@ -72,7 +73,7 @@ make smaller updates to your app.
|
||||
'''iOS support is in an experimental state and will not work without Flutter engine changes that have not yet been published.''',
|
||||
);
|
||||
|
||||
const platformName = 'ios';
|
||||
const platform = ReleasePlatform.ios;
|
||||
final flavor = results['flavor'] as String?;
|
||||
final shorebirdYaml = ShorebirdEnvironment.getShorebirdYaml()!;
|
||||
final appId = shorebirdYaml.getAppId(flavor: flavor);
|
||||
@@ -121,7 +122,7 @@ make smaller updates to your app.
|
||||
await codePushClientWrapper.ensureReleaseHasNoArtifacts(
|
||||
appId: app.appId,
|
||||
existingRelease: existingRelease,
|
||||
platform: platformName,
|
||||
platform: platform,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -129,7 +130,7 @@ make smaller updates to your app.
|
||||
'''📱 App: ${lightCyan.wrap(app.displayName)} ${lightCyan.wrap('($appId)')}''',
|
||||
if (flavor != null) '🍧 Flavor: ${lightCyan.wrap(flavor)}',
|
||||
'📦 Release Version: ${lightCyan.wrap(releaseVersion)}',
|
||||
'''🕹️ Platform: ${lightCyan.wrap(platformName)}''',
|
||||
'''🕹️ Platform: ${lightCyan.wrap(platform.name)}''',
|
||||
];
|
||||
|
||||
logger.info('''
|
||||
@@ -178,7 +179,7 @@ ${summary.join('\n')}
|
||||
await codePushClientWrapper.completeRelease(
|
||||
appId: app.appId,
|
||||
releaseId: release.id,
|
||||
platform: platformName,
|
||||
platform: platform,
|
||||
);
|
||||
|
||||
logger
|
||||
|
||||
@@ -31,6 +31,10 @@ void main() {
|
||||
late http.Client httpClient;
|
||||
late Platform platform;
|
||||
|
||||
setUpAll(() {
|
||||
registerFallbackValue(ReleasePlatform.android);
|
||||
});
|
||||
|
||||
setUp(() {
|
||||
auth = _MockAuth();
|
||||
httpClient = _MockHttpClient();
|
||||
@@ -74,7 +78,7 @@ void main() {
|
||||
const patchId = 1;
|
||||
const patchNumber = 2;
|
||||
const patch = Patch(id: patchId, number: patchNumber);
|
||||
const platformName = 'ios';
|
||||
const releasePlatform = ReleasePlatform.ios;
|
||||
const releaseId = 123;
|
||||
const arch = Arch.arm64;
|
||||
const flutterRevision = '123';
|
||||
@@ -105,7 +109,7 @@ void main() {
|
||||
id: 1,
|
||||
releaseId: releaseId,
|
||||
arch: 'aarch64',
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
hash: 'asdf',
|
||||
size: 4,
|
||||
url: 'url',
|
||||
@@ -379,7 +383,7 @@ void main() {
|
||||
() async => codePushClientWrapper.ensureReleaseHasNoArtifacts(
|
||||
appId: appId,
|
||||
existingRelease: release,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
),
|
||||
),
|
||||
exitsWithCode(ExitCode.software),
|
||||
@@ -388,7 +392,7 @@ void main() {
|
||||
verify(
|
||||
() => logger.err(
|
||||
'''
|
||||
It looks like you have an existing $platformName release for version ${lightCyan.wrap(release.version)}.
|
||||
It looks like you have an existing $releasePlatform release for version ${lightCyan.wrap(release.version)}.
|
||||
Please bump your version number and try again.''',
|
||||
),
|
||||
).called(1);
|
||||
@@ -411,7 +415,7 @@ Please bump your version number and try again.''',
|
||||
() => codePushClientWrapper.ensureReleaseHasNoArtifacts(
|
||||
appId: appId,
|
||||
existingRelease: release,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
),
|
||||
),
|
||||
completes,
|
||||
@@ -673,7 +677,7 @@ Please bump your version number and try again.''',
|
||||
appId: app.appId,
|
||||
releaseId: releaseId,
|
||||
architectures: archMap,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
),
|
||||
),
|
||||
exitsWithCode(ExitCode.software),
|
||||
@@ -697,7 +701,7 @@ Please bump your version number and try again.''',
|
||||
appId: app.appId,
|
||||
releaseId: releaseId,
|
||||
architectures: archMap,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
),
|
||||
),
|
||||
exitsWithCode(ExitCode.software),
|
||||
@@ -726,7 +730,7 @@ Please bump your version number and try again.''',
|
||||
appId: app.appId,
|
||||
releaseId: releaseId,
|
||||
architectures: archMap,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -753,7 +757,7 @@ Please bump your version number and try again.''',
|
||||
appId: app.appId,
|
||||
releaseId: releaseId,
|
||||
arch: arch.name,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
),
|
||||
),
|
||||
exitsWithCode(ExitCode.software),
|
||||
@@ -778,7 +782,7 @@ Please bump your version number and try again.''',
|
||||
appId: app.appId,
|
||||
releaseId: releaseId,
|
||||
arch: arch.name,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
),
|
||||
),
|
||||
exitsWithCode(ExitCode.software),
|
||||
@@ -808,7 +812,7 @@ Please bump your version number and try again.''',
|
||||
appId: app.appId,
|
||||
releaseId: releaseId,
|
||||
arch: arch.name,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -836,7 +840,7 @@ Please bump your version number and try again.''',
|
||||
appId: app.appId,
|
||||
releaseId: releaseId,
|
||||
arch: arch.name,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
),
|
||||
),
|
||||
exitsWithCode(ExitCode.software),
|
||||
@@ -860,7 +864,7 @@ Please bump your version number and try again.''',
|
||||
appId: app.appId,
|
||||
releaseId: releaseId,
|
||||
arch: arch.name,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -885,7 +889,7 @@ Please bump your version number and try again.''',
|
||||
appId: app.appId,
|
||||
releaseId: releaseId,
|
||||
arch: arch.name,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -953,7 +957,7 @@ Please bump your version number and try again.''',
|
||||
() async => codePushClientWrapper.createAndroidReleaseArtifacts(
|
||||
appId: app.appId,
|
||||
releaseId: releaseId,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
aabPath: p.join(tempDir.path, aabPath),
|
||||
architectures: ShorebirdBuildMixin.allAndroidArchitectures,
|
||||
),
|
||||
@@ -986,7 +990,7 @@ Please bump your version number and try again.''',
|
||||
() async => codePushClientWrapper.createAndroidReleaseArtifacts(
|
||||
appId: app.appId,
|
||||
releaseId: releaseId,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
aabPath: p.join(tempDir.path, aabPath),
|
||||
architectures: ShorebirdBuildMixin.allAndroidArchitectures,
|
||||
),
|
||||
@@ -1019,7 +1023,7 @@ Please bump your version number and try again.''',
|
||||
() async => codePushClientWrapper.createAndroidReleaseArtifacts(
|
||||
appId: app.appId,
|
||||
releaseId: releaseId,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
aabPath: p.join(tempDir.path, aabPath),
|
||||
architectures: ShorebirdBuildMixin.allAndroidArchitectures,
|
||||
),
|
||||
@@ -1055,7 +1059,7 @@ Please bump your version number and try again.''',
|
||||
() async => codePushClientWrapper.createAndroidReleaseArtifacts(
|
||||
appId: app.appId,
|
||||
releaseId: releaseId,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
aabPath: p.join(tempDir.path, aabPath),
|
||||
architectures: ShorebirdBuildMixin.allAndroidArchitectures,
|
||||
),
|
||||
@@ -1089,7 +1093,7 @@ Please bump your version number and try again.''',
|
||||
() async => codePushClientWrapper.createAndroidReleaseArtifacts(
|
||||
appId: app.appId,
|
||||
releaseId: releaseId,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
aabPath: p.join(tempDir.path, aabPath),
|
||||
architectures: ShorebirdBuildMixin.allAndroidArchitectures,
|
||||
),
|
||||
@@ -1120,7 +1124,7 @@ Please bump your version number and try again.''',
|
||||
() async => codePushClientWrapper.createAndroidReleaseArtifacts(
|
||||
appId: app.appId,
|
||||
releaseId: releaseId,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
aabPath: p.join(tempDir.path, aabPath),
|
||||
architectures: ShorebirdBuildMixin.allAndroidArchitectures,
|
||||
flavor: flavorName,
|
||||
@@ -1138,7 +1142,7 @@ Please bump your version number and try again.''',
|
||||
),
|
||||
releaseId: releaseId,
|
||||
arch: any(named: 'arch'),
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
hash: any(named: 'hash'),
|
||||
),
|
||||
).called(ShorebirdBuildMixin.allAndroidArchitectures.length);
|
||||
@@ -1215,7 +1219,7 @@ Please bump your version number and try again.''',
|
||||
codePushClientWrapper.createAndroidArchiveReleaseArtifacts(
|
||||
appId: app.appId,
|
||||
releaseId: releaseId,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
aarPath: p.join(tempDir.path, aarPath),
|
||||
extractedAarDir: p.join(tempDir.path, extractedAarPath),
|
||||
architectures: ShorebirdBuildMixin.allAndroidArchitectures,
|
||||
@@ -1250,7 +1254,7 @@ Please bump your version number and try again.''',
|
||||
codePushClientWrapper.createAndroidArchiveReleaseArtifacts(
|
||||
appId: app.appId,
|
||||
releaseId: releaseId,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
aarPath: p.join(tempDir.path, aarPath),
|
||||
extractedAarDir: p.join(tempDir.path, extractedAarPath),
|
||||
architectures: ShorebirdBuildMixin.allAndroidArchitectures,
|
||||
@@ -1285,7 +1289,7 @@ Please bump your version number and try again.''',
|
||||
codePushClientWrapper.createAndroidArchiveReleaseArtifacts(
|
||||
appId: app.appId,
|
||||
releaseId: releaseId,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
aarPath: p.join(tempDir.path, aarPath),
|
||||
extractedAarDir: p.join(tempDir.path, extractedAarPath),
|
||||
architectures: ShorebirdBuildMixin.allAndroidArchitectures,
|
||||
@@ -1323,7 +1327,7 @@ Please bump your version number and try again.''',
|
||||
codePushClientWrapper.createAndroidArchiveReleaseArtifacts(
|
||||
appId: app.appId,
|
||||
releaseId: releaseId,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
aarPath: p.join(tempDir.path, aarPath),
|
||||
extractedAarDir: p.join(tempDir.path, extractedAarPath),
|
||||
architectures: ShorebirdBuildMixin.allAndroidArchitectures,
|
||||
@@ -1359,7 +1363,7 @@ Please bump your version number and try again.''',
|
||||
codePushClientWrapper.createAndroidArchiveReleaseArtifacts(
|
||||
appId: app.appId,
|
||||
releaseId: releaseId,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
aarPath: p.join(tempDir.path, aarPath),
|
||||
extractedAarDir: p.join(tempDir.path, extractedAarPath),
|
||||
architectures: ShorebirdBuildMixin.allAndroidArchitectures,
|
||||
@@ -1392,7 +1396,7 @@ Please bump your version number and try again.''',
|
||||
codePushClientWrapper.createAndroidArchiveReleaseArtifacts(
|
||||
appId: app.appId,
|
||||
releaseId: releaseId,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
aarPath: p.join(tempDir.path, aarPath),
|
||||
extractedAarDir: p.join(tempDir.path, extractedAarPath),
|
||||
architectures: ShorebirdBuildMixin.allAndroidArchitectures,
|
||||
@@ -1407,7 +1411,7 @@ Please bump your version number and try again.''',
|
||||
artifactPath: any(named: 'artifactPath'),
|
||||
releaseId: releaseId,
|
||||
arch: any(named: 'arch'),
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
hash: any(named: 'hash'),
|
||||
),
|
||||
).called(ShorebirdBuildMixin.allAndroidArchitectures.length + 1);
|
||||
@@ -1553,7 +1557,7 @@ Please bump your version number and try again.''',
|
||||
() => codePushClientWrapper.completeRelease(
|
||||
appId: app.appId,
|
||||
releaseId: releaseId,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
),
|
||||
),
|
||||
exitsWithCode(ExitCode.software),
|
||||
@@ -1575,7 +1579,7 @@ Please bump your version number and try again.''',
|
||||
() => codePushClientWrapper.completeRelease(
|
||||
appId: app.appId,
|
||||
releaseId: releaseId,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -1692,7 +1696,7 @@ Please bump your version number and try again.''',
|
||||
() => codePushClientWrapper.createPatchArtifacts(
|
||||
appId: appId,
|
||||
patch: patch,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
patchArtifactBundles: patchArtifactBundles,
|
||||
),
|
||||
),
|
||||
@@ -1719,7 +1723,7 @@ Please bump your version number and try again.''',
|
||||
() => codePushClientWrapper.createPatchArtifacts(
|
||||
appId: appId,
|
||||
patch: patch,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
patchArtifactBundles: patchArtifactBundles,
|
||||
),
|
||||
);
|
||||
@@ -1731,7 +1735,7 @@ Please bump your version number and try again.''',
|
||||
artifactPath: partchArtifactBundle.path,
|
||||
patchId: patchId,
|
||||
arch: arch.name,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
hash: partchArtifactBundle.hash,
|
||||
),
|
||||
).called(1);
|
||||
@@ -1773,7 +1777,7 @@ Please bump your version number and try again.''',
|
||||
() => codePushClientWrapper.publishPatch(
|
||||
appId: appId,
|
||||
releaseId: releaseId,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
channelName: channelName,
|
||||
patchArtifactBundles: patchArtifactBundles,
|
||||
),
|
||||
@@ -1791,7 +1795,7 @@ Please bump your version number and try again.''',
|
||||
artifactPath: partchArtifactBundle.path,
|
||||
patchId: patchId,
|
||||
arch: arch.name,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
hash: partchArtifactBundle.hash,
|
||||
),
|
||||
).called(1);
|
||||
@@ -1827,7 +1831,7 @@ Please bump your version number and try again.''',
|
||||
() => codePushClientWrapper.publishPatch(
|
||||
appId: appId,
|
||||
releaseId: releaseId,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
channelName: channelName,
|
||||
patchArtifactBundles: patchArtifactBundles,
|
||||
),
|
||||
@@ -1845,7 +1849,7 @@ Please bump your version number and try again.''',
|
||||
artifactPath: partchArtifactBundle.path,
|
||||
patchId: patchId,
|
||||
arch: arch.name,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
hash: partchArtifactBundle.hash,
|
||||
),
|
||||
).called(1);
|
||||
|
||||
@@ -60,7 +60,7 @@ void main() {
|
||||
const versionCode = '1';
|
||||
const version = '$versionName+$versionCode';
|
||||
const arch = 'aarch64';
|
||||
const platformName = 'android';
|
||||
const releasePlatform = ReleasePlatform.android;
|
||||
const channelName = 'stable';
|
||||
const appDisplayName = 'Test App';
|
||||
const appMetadata = AppMetadata(appId: appId, displayName: appDisplayName);
|
||||
@@ -68,7 +68,7 @@ void main() {
|
||||
id: 0,
|
||||
releaseId: 0,
|
||||
arch: arch,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
hash: '#',
|
||||
size: 42,
|
||||
url: 'https://example.com/release.so',
|
||||
@@ -77,7 +77,7 @@ void main() {
|
||||
id: 0,
|
||||
releaseId: 0,
|
||||
arch: arch,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
hash: '#',
|
||||
size: 42,
|
||||
url: 'https://example.com/release.aar',
|
||||
@@ -208,6 +208,8 @@ flutter:
|
||||
cache = _MockCache();
|
||||
shorebirdProcess = _MockShorebirdProcess();
|
||||
|
||||
registerFallbackValue(ReleasePlatform.android);
|
||||
|
||||
when(() => platform.environment).thenReturn({});
|
||||
when(() => platform.script).thenReturn(
|
||||
Uri.file(
|
||||
@@ -307,7 +309,7 @@ flutter:
|
||||
appId: any(named: 'appId'),
|
||||
releaseId: any(named: 'releaseId'),
|
||||
arch: 'aar',
|
||||
platform: 'android',
|
||||
platform: ReleasePlatform.android,
|
||||
),
|
||||
).thenAnswer((_) async => aarArtifact);
|
||||
when(
|
||||
@@ -705,7 +707,7 @@ https://github.com/shorebirdtech/shorebird/issues/472
|
||||
() => logger.info(
|
||||
any(
|
||||
that: contains(
|
||||
'''🕹️ Platform: ${lightCyan.wrap(platformName)} ${lightCyan.wrap('[arm32 (4 B), arm64 (4 B), x86_64 (4 B)]')}''',
|
||||
'''🕹️ Platform: ${lightCyan.wrap(releasePlatform.name)} ${lightCyan.wrap('[arm32 (4 B), arm64 (4 B), x86_64 (4 B)]')}''',
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -724,7 +726,7 @@ https://github.com/shorebirdtech/shorebird/issues/472
|
||||
appId: appId,
|
||||
releaseId: release.id,
|
||||
architectures: ShorebirdBuildMixin.allAndroidArchitectures,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
),
|
||||
).called(1);
|
||||
verify(
|
||||
@@ -732,14 +734,14 @@ https://github.com/shorebirdtech/shorebird/issues/472
|
||||
appId: appId,
|
||||
releaseId: release.id,
|
||||
arch: 'aar',
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
),
|
||||
).called(1);
|
||||
verify(
|
||||
() => codePushClientWrapper.publishPatch(
|
||||
appId: appId,
|
||||
releaseId: release.id,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
channelName: channelName,
|
||||
patchArtifactBundles: any(named: 'patchArtifactBundles'),
|
||||
),
|
||||
@@ -776,7 +778,7 @@ flavors:
|
||||
appId: appId,
|
||||
releaseId: release.id,
|
||||
architectures: ShorebirdBuildMixin.allAndroidArchitectures,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
),
|
||||
).called(1);
|
||||
verify(
|
||||
@@ -784,14 +786,14 @@ flavors:
|
||||
appId: appId,
|
||||
releaseId: release.id,
|
||||
arch: 'aar',
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
),
|
||||
).called(1);
|
||||
verify(
|
||||
() => codePushClientWrapper.publishPatch(
|
||||
appId: appId,
|
||||
releaseId: release.id,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
channelName: channelName,
|
||||
patchArtifactBundles: any(named: 'patchArtifactBundles'),
|
||||
),
|
||||
|
||||
@@ -65,7 +65,7 @@ void main() {
|
||||
const versionCode = '1';
|
||||
const version = '$versionName+$versionCode';
|
||||
const arch = 'aarch64';
|
||||
const platformName = 'android';
|
||||
const releasePlatform = ReleasePlatform.android;
|
||||
const channelName = 'stable';
|
||||
const appDisplayName = 'Test App';
|
||||
const app = AppMetadata(appId: appId, displayName: appDisplayName);
|
||||
@@ -73,7 +73,7 @@ void main() {
|
||||
id: 0,
|
||||
releaseId: 0,
|
||||
arch: arch,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
hash: '#',
|
||||
size: 42,
|
||||
url: 'https://example.com',
|
||||
@@ -82,7 +82,7 @@ void main() {
|
||||
id: 0,
|
||||
releaseId: 0,
|
||||
arch: arch,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
hash: '#',
|
||||
size: 42,
|
||||
url: 'https://example.com/release.aab',
|
||||
@@ -173,6 +173,7 @@ flutter:
|
||||
setUpAll(() {
|
||||
registerFallbackValue(_FakeBaseRequest());
|
||||
registerFallbackValue(_FakeShorebirdProcess());
|
||||
registerFallbackValue(ReleasePlatform.android);
|
||||
});
|
||||
|
||||
setUp(() {
|
||||
@@ -299,7 +300,7 @@ flutter:
|
||||
appId: any(named: 'appId'),
|
||||
releaseId: any(named: 'releaseId'),
|
||||
arch: 'aab',
|
||||
platform: 'android',
|
||||
platform: ReleasePlatform.android,
|
||||
),
|
||||
).thenAnswer((_) async => aabArtifact);
|
||||
when(
|
||||
@@ -787,7 +788,7 @@ https://github.com/shorebirdtech/shorebird/issues/472
|
||||
() => logger.info(
|
||||
any(
|
||||
that: contains(
|
||||
'''🕹️ Platform: ${lightCyan.wrap(platformName)} ${lightCyan.wrap('[arm32 (4 B), arm64 (4 B), x86_64 (4 B)]')}''',
|
||||
'''🕹️ Platform: ${lightCyan.wrap(releasePlatform.name)} ${lightCyan.wrap('[arm32 (4 B), arm64 (4 B), x86_64 (4 B)]')}''',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -157,6 +157,7 @@ flutter:
|
||||
setUpAll(() {
|
||||
registerFallbackValue(_FakeBaseRequest());
|
||||
registerFallbackValue(_FakeShorebirdProcess());
|
||||
registerFallbackValue(ReleasePlatform.ios);
|
||||
});
|
||||
|
||||
setUp(() {
|
||||
|
||||
@@ -52,7 +52,7 @@ void main() {
|
||||
group(PreviewCommand, () {
|
||||
const appId = 'test-app-id';
|
||||
const appDisplayName = 'Test App';
|
||||
const platform = 'android';
|
||||
const platform = ReleasePlatform.android;
|
||||
const releaseVersion = '1.2.3';
|
||||
const releaseId = 42;
|
||||
const releaseArtifactUrl = 'https://example.com/release.aab';
|
||||
@@ -104,8 +104,9 @@ void main() {
|
||||
);
|
||||
|
||||
setUpAll(() {
|
||||
registerFallbackValue(Uri());
|
||||
registerFallbackValue(ReleasePlatform.android);
|
||||
registerFallbackValue(StreamController<List<int>>());
|
||||
registerFallbackValue(Uri());
|
||||
});
|
||||
|
||||
setUp(() {
|
||||
|
||||
@@ -62,7 +62,7 @@ void main() {
|
||||
displayName: '1.2.3+1',
|
||||
);
|
||||
|
||||
const platformName = 'android';
|
||||
const releasePlatform = ReleasePlatform.android;
|
||||
const buildNumber = '1.0';
|
||||
const noModulePubspecYamlContent = '''
|
||||
name: example
|
||||
@@ -159,6 +159,10 @@ flutter:
|
||||
File(aarPath).createSync(recursive: true);
|
||||
}
|
||||
|
||||
setUpAll(() {
|
||||
registerFallbackValue(ReleasePlatform.android);
|
||||
});
|
||||
|
||||
setUp(() {
|
||||
argResults = _MockArgResults();
|
||||
httpClient = _MockHttpClient();
|
||||
@@ -426,7 +430,7 @@ flutter:
|
||||
() => codePushClientWrapper.createAndroidArchiveReleaseArtifacts(
|
||||
appId: appId,
|
||||
releaseId: release.id,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
aarPath: any(
|
||||
named: 'aarPath',
|
||||
that: endsWith(
|
||||
@@ -446,7 +450,7 @@ flutter:
|
||||
() => codePushClientWrapper.completeRelease(
|
||||
appId: appId,
|
||||
releaseId: release.id,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
),
|
||||
).called(1);
|
||||
});
|
||||
@@ -484,7 +488,7 @@ flavors:
|
||||
() => codePushClientWrapper.createAndroidArchiveReleaseArtifacts(
|
||||
appId: appId,
|
||||
releaseId: release.id,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
aarPath: any(
|
||||
named: 'aarPath',
|
||||
that: endsWith(
|
||||
@@ -504,7 +508,7 @@ flavors:
|
||||
() => codePushClientWrapper.completeRelease(
|
||||
appId: appId,
|
||||
releaseId: release.id,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
),
|
||||
).called(1);
|
||||
});
|
||||
@@ -537,7 +541,7 @@ flavors:
|
||||
() => codePushClientWrapper.completeRelease(
|
||||
appId: appId,
|
||||
releaseId: release.id,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
),
|
||||
).called(1);
|
||||
});
|
||||
@@ -595,7 +599,7 @@ flavors:
|
||||
() => codePushClientWrapper.completeRelease(
|
||||
appId: appId,
|
||||
releaseId: release.id,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -57,7 +57,7 @@ void main() {
|
||||
const version = '$versionName+$versionCode';
|
||||
const appDisplayName = 'Test App';
|
||||
const arch = 'aarch64';
|
||||
const platformName = 'android';
|
||||
const releasePlatform = ReleasePlatform.android;
|
||||
const appMetadata = AppMetadata(appId: appId, displayName: appDisplayName);
|
||||
const release = Release(
|
||||
id: 0,
|
||||
@@ -124,6 +124,10 @@ flutter:
|
||||
return tempDir;
|
||||
}
|
||||
|
||||
setUpAll(() {
|
||||
registerFallbackValue(ReleasePlatform.android);
|
||||
});
|
||||
|
||||
setUp(() {
|
||||
argResults = _MockArgResults();
|
||||
bundletool = _MockBundleTool();
|
||||
@@ -171,7 +175,7 @@ flutter:
|
||||
).thenAnswer((_) async => flutterRevisionProcessResult);
|
||||
when(() => argResults.rest).thenReturn([]);
|
||||
when(() => argResults['arch']).thenReturn(arch);
|
||||
when(() => argResults['platform']).thenReturn(platformName);
|
||||
when(() => argResults['platform']).thenReturn(releasePlatform);
|
||||
when(() => argResults['artifact']).thenReturn('aab');
|
||||
when(() => auth.isAuthenticated).thenReturn(true);
|
||||
when(() => auth.client).thenReturn(httpClient);
|
||||
@@ -399,7 +403,7 @@ flutter:
|
||||
() => codePushClientWrapper.createAndroidReleaseArtifacts(
|
||||
appId: appId,
|
||||
releaseId: release.id,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
aabPath: any(named: 'aabPath'),
|
||||
architectures: any(named: 'architectures'),
|
||||
),
|
||||
@@ -408,7 +412,7 @@ flutter:
|
||||
() => codePushClientWrapper.completeRelease(
|
||||
appId: appId,
|
||||
releaseId: release.id,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
),
|
||||
).called(1);
|
||||
expect(exitCode, ExitCode.success.code);
|
||||
@@ -428,7 +432,7 @@ flutter:
|
||||
() => codePushClientWrapper.createAndroidReleaseArtifacts(
|
||||
appId: appId,
|
||||
releaseId: release.id,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
aabPath: any(named: 'aabPath'),
|
||||
architectures: any(named: 'architectures'),
|
||||
),
|
||||
@@ -437,7 +441,7 @@ flutter:
|
||||
() => codePushClientWrapper.completeRelease(
|
||||
appId: appId,
|
||||
releaseId: release.id,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
),
|
||||
).called(1);
|
||||
expect(exitCode, ExitCode.success.code);
|
||||
@@ -468,7 +472,7 @@ flavors:
|
||||
() => codePushClientWrapper.createAndroidReleaseArtifacts(
|
||||
appId: appId,
|
||||
releaseId: release.id,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
aabPath: any(named: 'aabPath'),
|
||||
architectures: any(named: 'architectures'),
|
||||
flavor: flavor,
|
||||
@@ -478,7 +482,7 @@ flavors:
|
||||
() => codePushClientWrapper.completeRelease(
|
||||
appId: appId,
|
||||
releaseId: release.id,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
),
|
||||
).called(1);
|
||||
expect(exitCode, ExitCode.success.code);
|
||||
|
||||
@@ -54,7 +54,7 @@ void main() {
|
||||
const version = '$versionName+$versionCode';
|
||||
const appDisplayName = 'Test App';
|
||||
const arch = 'armv7';
|
||||
const platformName = 'ios';
|
||||
const releasePlatform = ReleasePlatform.ios;
|
||||
const appMetadata = AppMetadata(appId: appId, displayName: appDisplayName);
|
||||
const release = Release(
|
||||
id: 0,
|
||||
@@ -127,6 +127,10 @@ flutter:
|
||||
return tempDir;
|
||||
}
|
||||
|
||||
setUpAll(() {
|
||||
registerFallbackValue(ReleasePlatform.ios);
|
||||
});
|
||||
|
||||
setUp(() {
|
||||
argResults = _MockArgResults();
|
||||
codePushClientWrapper = _MockCodePushClientWrapper();
|
||||
@@ -173,7 +177,7 @@ flutter:
|
||||
).thenAnswer((_) async => flutterRevisionProcessResult);
|
||||
when(() => argResults.rest).thenReturn([]);
|
||||
when(() => argResults['arch']).thenReturn(arch);
|
||||
when(() => argResults['platform']).thenReturn(platformName);
|
||||
when(() => argResults['platform']).thenReturn(releasePlatform);
|
||||
when(() => auth.isAuthenticated).thenReturn(true);
|
||||
when(() => auth.client).thenReturn(httpClient);
|
||||
when(() => ipaReader.read(any())).thenReturn(ipa);
|
||||
@@ -451,7 +455,7 @@ error: exportArchive: No signing certificate "iOS Distribution" found
|
||||
() => codePushClientWrapper.completeRelease(
|
||||
appId: appId,
|
||||
releaseId: release.id,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
),
|
||||
).called(1);
|
||||
});
|
||||
@@ -488,7 +492,7 @@ error: exportArchive: No signing certificate "iOS Distribution" found
|
||||
() => codePushClientWrapper.completeRelease(
|
||||
appId: appId,
|
||||
releaseId: release.id,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
),
|
||||
).called(1);
|
||||
expect(exitCode, ExitCode.success.code);
|
||||
@@ -571,7 +575,7 @@ flavors:
|
||||
() => codePushClientWrapper.completeRelease(
|
||||
appId: appId,
|
||||
releaseId: release.id,
|
||||
platform: platformName,
|
||||
platform: releasePlatform,
|
||||
),
|
||||
).called(1);
|
||||
});
|
||||
|
||||
@@ -32,8 +32,8 @@ Future<void> main() async {
|
||||
await client.createReleaseArtifact(
|
||||
appId: app.id,
|
||||
releaseId: release.id,
|
||||
platform: ReleasePlatform.android,
|
||||
artifactPath: '<PATH TO ARTIFACT>', // e.g. 'libapp.so'
|
||||
platform: '<PLATFORM>', // e.g. 'android'
|
||||
arch: '<ARCHITECTURE>', // e.g. 'aarch64'
|
||||
hash: '<HASH>', // 'sha256 hash of the artifact'
|
||||
);
|
||||
@@ -45,8 +45,8 @@ Future<void> main() async {
|
||||
await client.createPatchArtifact(
|
||||
appId: app.id,
|
||||
patchId: patch.id,
|
||||
platform: ReleasePlatform.android,
|
||||
artifactPath: '<PATH TO ARTIFACT>', // e.g. 'libapp.so'
|
||||
platform: '<PLATFORM>', // e.g. 'android'
|
||||
arch: '<ARCHITECTURE>', // e.g. 'aarch64'
|
||||
hash: '<HASH>', // 'sha256 hash of the artifact'
|
||||
);
|
||||
|
||||
@@ -138,7 +138,7 @@ class CodePushClient {
|
||||
required String appId,
|
||||
required int patchId,
|
||||
required String arch,
|
||||
required String platform,
|
||||
required ReleasePlatform platform,
|
||||
required String hash,
|
||||
}) async {
|
||||
final request = http.MultipartRequest(
|
||||
@@ -148,7 +148,7 @@ class CodePushClient {
|
||||
final file = await http.MultipartFile.fromPath('file', artifactPath);
|
||||
request.fields.addAll({
|
||||
'arch': arch,
|
||||
'platform': platform,
|
||||
'platform': platform.name,
|
||||
'hash': hash,
|
||||
'size': '${file.length}',
|
||||
});
|
||||
@@ -196,7 +196,7 @@ class CodePushClient {
|
||||
required String appId,
|
||||
required int releaseId,
|
||||
required String arch,
|
||||
required String platform,
|
||||
required ReleasePlatform platform,
|
||||
required String hash,
|
||||
}) async {
|
||||
final request = http.MultipartRequest(
|
||||
@@ -206,7 +206,7 @@ class CodePushClient {
|
||||
final file = await http.MultipartFile.fromPath('file', artifactPath);
|
||||
request.fields.addAll({
|
||||
'arch': arch,
|
||||
'platform': platform,
|
||||
'platform': platform.name,
|
||||
'hash': hash,
|
||||
'size': '${file.length}',
|
||||
});
|
||||
@@ -310,7 +310,7 @@ class CodePushClient {
|
||||
Future<void> updateReleaseStatus({
|
||||
required String appId,
|
||||
required int releaseId,
|
||||
required String platform,
|
||||
required ReleasePlatform platform,
|
||||
required ReleaseStatus status,
|
||||
}) async {
|
||||
final response = await _httpClient.patch(
|
||||
@@ -460,13 +460,13 @@ class CodePushClient {
|
||||
required String appId,
|
||||
required int releaseId,
|
||||
String? arch,
|
||||
String? platform,
|
||||
ReleasePlatform? platform,
|
||||
}) async {
|
||||
final response = await _httpClient.get(
|
||||
Uri.parse('$_v1/apps/$appId/releases/$releaseId/artifacts').replace(
|
||||
queryParameters: {
|
||||
if (arch != null) 'arch': arch,
|
||||
if (platform != null) 'platform': platform,
|
||||
if (platform != null) 'platform': platform.name,
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
@@ -220,7 +220,7 @@ void main() {
|
||||
group('createPatchArtifact', () {
|
||||
const patchId = 0;
|
||||
const arch = 'aarch64';
|
||||
const platform = 'android';
|
||||
const platform = ReleasePlatform.android;
|
||||
const hash = 'test-hash';
|
||||
const size = 42;
|
||||
|
||||
@@ -494,7 +494,7 @@ void main() {
|
||||
const appId = 'test-app-id';
|
||||
const releaseId = 0;
|
||||
const arch = 'aarch64';
|
||||
const platform = 'android';
|
||||
const platform = ReleasePlatform.android;
|
||||
const hash = 'test-hash';
|
||||
const size = 42;
|
||||
|
||||
@@ -1161,7 +1161,7 @@ void main() {
|
||||
group('updateReleaseStatus', () {
|
||||
const appId = 'test-app-id';
|
||||
const releaseId = 42;
|
||||
const platform = 'android';
|
||||
const platform = ReleasePlatform.android;
|
||||
|
||||
test('makes the correct request', () async {
|
||||
codePushClient
|
||||
@@ -1866,7 +1866,7 @@ void main() {
|
||||
const appId = 'test-app-id';
|
||||
const releaseId = 0;
|
||||
const arch = 'aarch64';
|
||||
const platform = 'android';
|
||||
const platform = ReleasePlatform.android;
|
||||
|
||||
test('makes the correct request', () async {
|
||||
codePushClient
|
||||
@@ -1884,7 +1884,7 @@ void main() {
|
||||
expect(
|
||||
request.url,
|
||||
equals(
|
||||
v1('apps/$appId/releases/$releaseId/artifacts?arch=$arch&platform=$platform'),
|
||||
v1('apps/$appId/releases/$releaseId/artifacts?arch=$arch&platform=${platform.name}'),
|
||||
),
|
||||
);
|
||||
expect(request.hasStandardHeaders, isTrue);
|
||||
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:shorebird_code_push_protocol/shorebird_code_push_protocol.dart';
|
||||
|
||||
part 'check_for_patches_request.g.dart';
|
||||
|
||||
@@ -35,7 +36,7 @@ class CheckForPatchesRequest {
|
||||
final String? patchHash;
|
||||
|
||||
/// The platform of the app.
|
||||
final String platform;
|
||||
final ReleasePlatform platform;
|
||||
|
||||
/// The architecture of the app.
|
||||
final String arch;
|
||||
|
||||
+8
-2
@@ -19,7 +19,8 @@ CheckForPatchesRequest _$CheckForPatchesRequestFromJson(
|
||||
$checkedConvert('release_version', (v) => v as String),
|
||||
patchNumber: $checkedConvert('patch_number', (v) => v as int?),
|
||||
patchHash: $checkedConvert('patch_hash', (v) => v as String?),
|
||||
platform: $checkedConvert('platform', (v) => v as String),
|
||||
platform: $checkedConvert(
|
||||
'platform', (v) => $enumDecode(_$ReleasePlatformEnumMap, v)),
|
||||
arch: $checkedConvert('arch', (v) => v as String),
|
||||
appId: $checkedConvert('app_id', (v) => v as String),
|
||||
channel: $checkedConvert('channel', (v) => v as String),
|
||||
@@ -40,8 +41,13 @@ Map<String, dynamic> _$CheckForPatchesRequestToJson(
|
||||
'release_version': instance.releaseVersion,
|
||||
'patch_number': instance.patchNumber,
|
||||
'patch_hash': instance.patchHash,
|
||||
'platform': instance.platform,
|
||||
'platform': _$ReleasePlatformEnumMap[instance.platform]!,
|
||||
'arch': instance.arch,
|
||||
'app_id': instance.appId,
|
||||
'channel': instance.channel,
|
||||
};
|
||||
|
||||
const _$ReleasePlatformEnumMap = {
|
||||
ReleasePlatform.android: 'android',
|
||||
ReleasePlatform.ios: 'ios',
|
||||
};
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ class CreatePatchArtifactRequest {
|
||||
final String arch;
|
||||
|
||||
/// The platform of the artifact.
|
||||
final String platform;
|
||||
final ReleasePlatform platform;
|
||||
|
||||
/// The hash of the artifact.
|
||||
final String hash;
|
||||
|
||||
+8
-2
@@ -16,7 +16,8 @@ CreatePatchArtifactRequest _$CreatePatchArtifactRequestFromJson(
|
||||
($checkedConvert) {
|
||||
final val = CreatePatchArtifactRequest(
|
||||
arch: $checkedConvert('arch', (v) => v as String),
|
||||
platform: $checkedConvert('platform', (v) => v as String),
|
||||
platform: $checkedConvert(
|
||||
'platform', (v) => $enumDecode(_$ReleasePlatformEnumMap, v)),
|
||||
hash: $checkedConvert('hash', (v) => v as String),
|
||||
size: $checkedConvert(
|
||||
'size', (v) => CreatePatchArtifactRequest._parseStringToInt(v)),
|
||||
@@ -29,7 +30,12 @@ Map<String, dynamic> _$CreatePatchArtifactRequestToJson(
|
||||
CreatePatchArtifactRequest instance) =>
|
||||
<String, dynamic>{
|
||||
'arch': instance.arch,
|
||||
'platform': instance.platform,
|
||||
'platform': _$ReleasePlatformEnumMap[instance.platform]!,
|
||||
'hash': instance.hash,
|
||||
'size': CreatePatchArtifactRequest._parseIntToString(instance.size),
|
||||
};
|
||||
|
||||
const _$ReleasePlatformEnumMap = {
|
||||
ReleasePlatform.android: 'android',
|
||||
ReleasePlatform.ios: 'ios',
|
||||
};
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ class CreatePatchArtifactResponse {
|
||||
final String arch;
|
||||
|
||||
/// The platform of the artifact.
|
||||
final String platform;
|
||||
final ReleasePlatform platform;
|
||||
|
||||
/// The hash of the artifact.
|
||||
final String hash;
|
||||
|
||||
+8
-2
@@ -18,7 +18,8 @@ CreatePatchArtifactResponse _$CreatePatchArtifactResponseFromJson(
|
||||
id: $checkedConvert('id', (v) => v as int),
|
||||
patchId: $checkedConvert('patch_id', (v) => v as int),
|
||||
arch: $checkedConvert('arch', (v) => v as String),
|
||||
platform: $checkedConvert('platform', (v) => v as String),
|
||||
platform: $checkedConvert(
|
||||
'platform', (v) => $enumDecode(_$ReleasePlatformEnumMap, v)),
|
||||
hash: $checkedConvert('hash', (v) => v as String),
|
||||
size: $checkedConvert('size', (v) => v as int),
|
||||
url: $checkedConvert('url', (v) => v as String),
|
||||
@@ -34,8 +35,13 @@ Map<String, dynamic> _$CreatePatchArtifactResponseToJson(
|
||||
'id': instance.id,
|
||||
'patch_id': instance.patchId,
|
||||
'arch': instance.arch,
|
||||
'platform': instance.platform,
|
||||
'platform': _$ReleasePlatformEnumMap[instance.platform]!,
|
||||
'hash': instance.hash,
|
||||
'size': instance.size,
|
||||
'url': instance.url,
|
||||
};
|
||||
|
||||
const _$ReleasePlatformEnumMap = {
|
||||
ReleasePlatform.android: 'android',
|
||||
ReleasePlatform.ios: 'ios',
|
||||
};
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ class CreateReleaseArtifactRequest {
|
||||
final String arch;
|
||||
|
||||
/// The platform of the artifact.
|
||||
final String platform;
|
||||
final ReleasePlatform platform;
|
||||
|
||||
/// The hash of the artifact.
|
||||
final String hash;
|
||||
|
||||
+8
-2
@@ -16,7 +16,8 @@ CreateReleaseArtifactRequest _$CreateReleaseArtifactRequestFromJson(
|
||||
($checkedConvert) {
|
||||
final val = CreateReleaseArtifactRequest(
|
||||
arch: $checkedConvert('arch', (v) => v as String),
|
||||
platform: $checkedConvert('platform', (v) => v as String),
|
||||
platform: $checkedConvert(
|
||||
'platform', (v) => $enumDecode(_$ReleasePlatformEnumMap, v)),
|
||||
hash: $checkedConvert('hash', (v) => v as String),
|
||||
size: $checkedConvert(
|
||||
'size', (v) => CreateReleaseArtifactRequest._parseStringToInt(v)),
|
||||
@@ -29,7 +30,12 @@ Map<String, dynamic> _$CreateReleaseArtifactRequestToJson(
|
||||
CreateReleaseArtifactRequest instance) =>
|
||||
<String, dynamic>{
|
||||
'arch': instance.arch,
|
||||
'platform': instance.platform,
|
||||
'platform': _$ReleasePlatformEnumMap[instance.platform]!,
|
||||
'hash': instance.hash,
|
||||
'size': CreateReleaseArtifactRequest._parseIntToString(instance.size),
|
||||
};
|
||||
|
||||
const _$ReleasePlatformEnumMap = {
|
||||
ReleasePlatform.android: 'android',
|
||||
ReleasePlatform.ios: 'ios',
|
||||
};
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ class CreateReleaseArtifactResponse {
|
||||
final String arch;
|
||||
|
||||
/// The platform of the artifact.
|
||||
final String platform;
|
||||
final ReleasePlatform platform;
|
||||
|
||||
/// The hash of the artifact.
|
||||
final String hash;
|
||||
|
||||
+8
-2
@@ -18,7 +18,8 @@ CreateReleaseArtifactResponse _$CreateReleaseArtifactResponseFromJson(
|
||||
id: $checkedConvert('id', (v) => v as int),
|
||||
releaseId: $checkedConvert('release_id', (v) => v as int),
|
||||
arch: $checkedConvert('arch', (v) => v as String),
|
||||
platform: $checkedConvert('platform', (v) => v as String),
|
||||
platform: $checkedConvert(
|
||||
'platform', (v) => $enumDecode(_$ReleasePlatformEnumMap, v)),
|
||||
hash: $checkedConvert('hash', (v) => v as String),
|
||||
size: $checkedConvert('size', (v) => v as int),
|
||||
url: $checkedConvert('url', (v) => v as String),
|
||||
@@ -34,8 +35,13 @@ Map<String, dynamic> _$CreateReleaseArtifactResponseToJson(
|
||||
'id': instance.id,
|
||||
'release_id': instance.releaseId,
|
||||
'arch': instance.arch,
|
||||
'platform': instance.platform,
|
||||
'platform': _$ReleasePlatformEnumMap[instance.platform]!,
|
||||
'hash': instance.hash,
|
||||
'size': instance.size,
|
||||
'url': instance.url,
|
||||
};
|
||||
|
||||
const _$ReleasePlatformEnumMap = {
|
||||
ReleasePlatform.android: 'android',
|
||||
ReleasePlatform.ios: 'ios',
|
||||
};
|
||||
|
||||
+1
-1
@@ -25,5 +25,5 @@ class UpdateReleaseRequest {
|
||||
final ReleaseStatus status;
|
||||
|
||||
/// The platform of the release.
|
||||
final String platform;
|
||||
final ReleasePlatform platform;
|
||||
}
|
||||
|
||||
+8
-2
@@ -17,7 +17,8 @@ UpdateReleaseRequest _$UpdateReleaseRequestFromJson(
|
||||
final val = UpdateReleaseRequest(
|
||||
status: $checkedConvert(
|
||||
'status', (v) => $enumDecode(_$ReleaseStatusEnumMap, v)),
|
||||
platform: $checkedConvert('platform', (v) => v as String),
|
||||
platform: $checkedConvert(
|
||||
'platform', (v) => $enumDecode(_$ReleasePlatformEnumMap, v)),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
@@ -27,10 +28,15 @@ Map<String, dynamic> _$UpdateReleaseRequestToJson(
|
||||
UpdateReleaseRequest instance) =>
|
||||
<String, dynamic>{
|
||||
'status': _$ReleaseStatusEnumMap[instance.status]!,
|
||||
'platform': instance.platform,
|
||||
'platform': _$ReleasePlatformEnumMap[instance.platform]!,
|
||||
};
|
||||
|
||||
const _$ReleaseStatusEnumMap = {
|
||||
ReleaseStatus.draft: 'draft',
|
||||
ReleaseStatus.active: 'active',
|
||||
};
|
||||
|
||||
const _$ReleasePlatformEnumMap = {
|
||||
ReleasePlatform.android: 'android',
|
||||
ReleasePlatform.ios: 'ios',
|
||||
};
|
||||
|
||||
@@ -7,6 +7,7 @@ export 'patch.dart';
|
||||
export 'patch_artifact.dart';
|
||||
export 'release.dart';
|
||||
export 'release_artifact.dart';
|
||||
export 'release_platform.dart';
|
||||
export 'release_status.dart';
|
||||
export 'shorebird_plan.dart';
|
||||
export 'subscription.dart';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:shorebird_code_push_protocol/shorebird_code_push_protocol.dart';
|
||||
|
||||
part 'patch_artifact.g.dart';
|
||||
|
||||
@@ -36,7 +37,7 @@ class PatchArtifact {
|
||||
final String arch;
|
||||
|
||||
/// The platform of the artifact.
|
||||
final String platform;
|
||||
final ReleasePlatform platform;
|
||||
|
||||
/// The hash of the artifact.
|
||||
final String hash;
|
||||
|
||||
@@ -17,7 +17,8 @@ PatchArtifact _$PatchArtifactFromJson(Map<String, dynamic> json) =>
|
||||
id: $checkedConvert('id', (v) => v as int),
|
||||
patchId: $checkedConvert('patch_id', (v) => v as int),
|
||||
arch: $checkedConvert('arch', (v) => v as String),
|
||||
platform: $checkedConvert('platform', (v) => v as String),
|
||||
platform: $checkedConvert(
|
||||
'platform', (v) => $enumDecode(_$ReleasePlatformEnumMap, v)),
|
||||
hash: $checkedConvert('hash', (v) => v as String),
|
||||
size: $checkedConvert('size', (v) => v as int),
|
||||
url: $checkedConvert('url', (v) => v as String),
|
||||
@@ -32,8 +33,13 @@ Map<String, dynamic> _$PatchArtifactToJson(PatchArtifact instance) =>
|
||||
'id': instance.id,
|
||||
'patch_id': instance.patchId,
|
||||
'arch': instance.arch,
|
||||
'platform': instance.platform,
|
||||
'platform': _$ReleasePlatformEnumMap[instance.platform]!,
|
||||
'hash': instance.hash,
|
||||
'size': instance.size,
|
||||
'url': instance.url,
|
||||
};
|
||||
|
||||
const _$ReleasePlatformEnumMap = {
|
||||
ReleasePlatform.android: 'android',
|
||||
ReleasePlatform.ios: 'ios',
|
||||
};
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:shorebird_code_push_protocol/shorebird_code_push_protocol.dart';
|
||||
|
||||
part 'release_artifact.g.dart';
|
||||
|
||||
@@ -36,7 +37,7 @@ class ReleaseArtifact {
|
||||
final String arch;
|
||||
|
||||
/// The platform of the artifact.
|
||||
final String platform;
|
||||
final ReleasePlatform platform;
|
||||
|
||||
/// The hash of the artifact.
|
||||
final String hash;
|
||||
|
||||
@@ -17,7 +17,8 @@ ReleaseArtifact _$ReleaseArtifactFromJson(Map<String, dynamic> json) =>
|
||||
id: $checkedConvert('id', (v) => v as int),
|
||||
releaseId: $checkedConvert('release_id', (v) => v as int),
|
||||
arch: $checkedConvert('arch', (v) => v as String),
|
||||
platform: $checkedConvert('platform', (v) => v as String),
|
||||
platform: $checkedConvert(
|
||||
'platform', (v) => $enumDecode(_$ReleasePlatformEnumMap, v)),
|
||||
hash: $checkedConvert('hash', (v) => v as String),
|
||||
size: $checkedConvert('size', (v) => v as int),
|
||||
url: $checkedConvert('url', (v) => v as String),
|
||||
@@ -32,8 +33,13 @@ Map<String, dynamic> _$ReleaseArtifactToJson(ReleaseArtifact instance) =>
|
||||
'id': instance.id,
|
||||
'release_id': instance.releaseId,
|
||||
'arch': instance.arch,
|
||||
'platform': instance.platform,
|
||||
'platform': _$ReleasePlatformEnumMap[instance.platform]!,
|
||||
'hash': instance.hash,
|
||||
'size': instance.size,
|
||||
'url': instance.url,
|
||||
};
|
||||
|
||||
const _$ReleasePlatformEnumMap = {
|
||||
ReleasePlatform.android: 'android',
|
||||
ReleasePlatform.ios: 'ios',
|
||||
};
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
/// A platform to which a Shorebird release can be deployed.
|
||||
enum ReleasePlatform {
|
||||
// ignore: public_member_api_docs
|
||||
android,
|
||||
// ignore: public_member_api_docs
|
||||
ios;
|
||||
}
|
||||
@@ -5,9 +5,5 @@ enum ReleaseStatus {
|
||||
draft,
|
||||
|
||||
/// Indicates that all platform artifacts have been uploaded for this release.
|
||||
active;
|
||||
|
||||
/// Returns the [ReleaseStatus] with the given [name].
|
||||
factory ReleaseStatus.named(String name) =>
|
||||
ReleaseStatus.values.firstWhere((status) => status.name == name);
|
||||
active,
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ void main() {
|
||||
releaseVersion: '1',
|
||||
patchNumber: 2,
|
||||
patchHash: '3',
|
||||
platform: 'android',
|
||||
platform: ReleasePlatform.android,
|
||||
arch: 'arm64',
|
||||
appId: 'app_123',
|
||||
channel: 'channel_123',
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ void main() {
|
||||
test('can be (de)serialized', () {
|
||||
const request = CreatePatchArtifactRequest(
|
||||
arch: 'arm64',
|
||||
platform: 'android',
|
||||
platform: ReleasePlatform.android,
|
||||
hash: '1234',
|
||||
size: 9876,
|
||||
);
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ void main() {
|
||||
id: 42,
|
||||
patchId: 1,
|
||||
arch: 'arm64',
|
||||
platform: 'android',
|
||||
platform: ReleasePlatform.android,
|
||||
hash: '1234',
|
||||
size: 9876,
|
||||
url: 'https://example.com',
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ void main() {
|
||||
test('can be (de)serialized', () {
|
||||
const request = CreateReleaseArtifactRequest(
|
||||
arch: 'arm64',
|
||||
platform: 'android',
|
||||
platform: ReleasePlatform.android,
|
||||
hash: '1234',
|
||||
size: 9876,
|
||||
);
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ void main() {
|
||||
id: 42,
|
||||
releaseId: 1,
|
||||
arch: 'arm64',
|
||||
platform: 'android',
|
||||
platform: ReleasePlatform.android,
|
||||
hash: '1234',
|
||||
size: 9876,
|
||||
url: 'https://example.com',
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ void main() {
|
||||
id: 42,
|
||||
releaseId: 1,
|
||||
arch: 'aarch64',
|
||||
platform: 'android',
|
||||
platform: ReleasePlatform.android,
|
||||
hash: '#',
|
||||
size: 1337,
|
||||
url: 'https://example.com',
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ void main() {
|
||||
group(UpdateReleaseRequest, () {
|
||||
test('can be (de)serialized', () {
|
||||
const request = UpdateReleaseRequest(
|
||||
platform: 'android',
|
||||
platform: ReleasePlatform.android,
|
||||
status: ReleaseStatus.active,
|
||||
);
|
||||
expect(
|
||||
|
||||
@@ -8,7 +8,7 @@ void main() {
|
||||
id: 1,
|
||||
patchId: 1,
|
||||
arch: 'aarch64',
|
||||
platform: 'android',
|
||||
platform: ReleasePlatform.android,
|
||||
url: 'https://example.com',
|
||||
size: 42,
|
||||
hash: 'sha256:1234567890',
|
||||
|
||||
@@ -8,7 +8,7 @@ void main() {
|
||||
id: 1,
|
||||
releaseId: 1,
|
||||
arch: 'aarch64',
|
||||
platform: 'android',
|
||||
platform: ReleasePlatform.android,
|
||||
url: 'https://example.com',
|
||||
size: 42,
|
||||
hash: 'sha256:1234567890',
|
||||
@@ -24,7 +24,7 @@ void main() {
|
||||
id: 1,
|
||||
releaseId: 1,
|
||||
arch: 'aarch64',
|
||||
platform: 'android',
|
||||
platform: ReleasePlatform.android,
|
||||
url: 'https://example.com',
|
||||
size: 42,
|
||||
hash: 'sha256:1234567890',
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
import 'package:shorebird_code_push_protocol/shorebird_code_push_protocol.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
void main() {
|
||||
group(ReleaseStatus, () {
|
||||
test('named allows lookup based on name', () {
|
||||
expect(ReleaseStatus.named('draft'), equals(ReleaseStatus.draft));
|
||||
expect(ReleaseStatus.named('active'), equals(ReleaseStatus.active));
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user