distribute pollishing
This commit is contained in:
parent
550ece1c94
commit
246fac9798
3 changed files with 25 additions and 13 deletions
|
|
@ -35,18 +35,20 @@ class TestflightStatusCheck extends Command {
|
|||
Future execute(DataCommand command) async {
|
||||
var data = DataTestflightStatusCheck.fromJson(getParam(command));
|
||||
|
||||
var fastFile = await BuildiOS.initializeFastlane(data.workspace!, data.apiKeyPath, data.appID);
|
||||
var fastFile = await BuildiOS.initializeFastlane(
|
||||
data.workspace!, data.apiKeyPath, data.appID);
|
||||
var fastlaneContent = fastFile.readAsStringSync();
|
||||
|
||||
fastlaneContent = fastlaneContent.replaceFirst('[TARGET_VERSION]', data.version)
|
||||
.replaceFirst('[TARGET_BUILD_NUMBER]', data.buildNumber);
|
||||
fastlaneContent = fastlaneContent
|
||||
.replaceFirst('[TARGET_VERSION]', data.version)
|
||||
.replaceFirst('[TARGET_BUILD_NUMBER]', data.buildNumber);
|
||||
fastFile.writeAsStringSync(fastlaneContent, flush: true);
|
||||
|
||||
var messageInReview = 'Review in progress.';
|
||||
var messageComplete = 'Your review has been completed 🎉';
|
||||
const result = '[RESULT]: ';
|
||||
var isProcessing = true;
|
||||
while(isProcessing) {
|
||||
while (isProcessing) {
|
||||
var shell = StringBuffer();
|
||||
shell.write('cd ${data.workspace}/fastlane');
|
||||
shell.write(' && fastlane testflight_status');
|
||||
|
|
@ -57,14 +59,14 @@ class TestflightStatusCheck extends Command {
|
|||
if (item.contains(result)) {
|
||||
var json =
|
||||
jsonDecode(item.substring(item.indexOf(result) + result.length));
|
||||
if(json['state'] == 'VALID') {
|
||||
if (json['state'] == 'VALID') {
|
||||
isProcessing = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(isProcessing) {
|
||||
if (isProcessing) {
|
||||
print(messageInReview);
|
||||
messageInReview += '.';
|
||||
} else {
|
||||
|
|
@ -81,19 +83,26 @@ class TestflightDistribute extends Command {
|
|||
@override
|
||||
Future execute(DataCommand command) async {
|
||||
var data = DataTestflightDistribute.fromJson(getParam(command));
|
||||
|
||||
var testers = data.testers != null && data.testers!.isNotEmpty ? ' --groups "${data.testers}"' : '';
|
||||
var message = data.message != null && data.message!.isNotEmpty ? ' --changelog "${data.message}"' : '';
|
||||
|
||||
var testers = data.testers != null && data.testers!.isNotEmpty
|
||||
? ' --groups "${data.testers}"'
|
||||
: '';
|
||||
var message = data.message != null && data.message!.isNotEmpty
|
||||
? ' --changelog "${data.message}"'
|
||||
: '';
|
||||
var buildNumber = data.buildNumber != null && data.buildNumber!.isNotEmpty
|
||||
? ' --build_number ${data.buildNumber}'
|
||||
: '';
|
||||
var platform = data.platform ?? 'ios';
|
||||
|
||||
print('Distribute is processing...');
|
||||
var shell = StringBuffer();
|
||||
shell.write('cd ${data.workspace}/fastlane');
|
||||
shell.write(
|
||||
' && fastlane pilot distribute --api_key_path ${data.apiKeyPath} --app_identifier ${data.appID}$testers$message --app-platform $platform');
|
||||
' && fastlane pilot distribute --api_key_path ${data.apiKeyPath} --app_identifier ${data.appID}$testers$message$buildNumber --app-platform $platform');
|
||||
|
||||
var process = await ProcessExecutor.start(shell,
|
||||
logHandler: Application.logWithType);
|
||||
var process =
|
||||
await ProcessExecutor.start(shell, logHandler: Application.logWithType);
|
||||
|
||||
return await completeProcess(process, command, passExitCodes: [1]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -374,6 +374,7 @@ class DataTestflightDistribute extends DataParam {
|
|||
late String? message;
|
||||
late String? testers;
|
||||
late String? platform;
|
||||
late String? buildNumber;
|
||||
|
||||
factory DataTestflightDistribute.fromJson(Map<String, dynamic> json) =>
|
||||
_$DataTestflightDistributeFromJson(json);
|
||||
|
|
|
|||
|
|
@ -668,7 +668,8 @@ DataTestflightDistribute _$DataTestflightDistributeFromJson(
|
|||
..appID = json['appID'] as String
|
||||
..message = json['message'] as String?
|
||||
..testers = json['testers'] as String?
|
||||
..platform = json['platform'] as String?;
|
||||
..platform = json['platform'] as String?
|
||||
..buildNumber = json['buildNumber'] as String?;
|
||||
|
||||
Map<String, dynamic> _$DataTestflightDistributeToJson(
|
||||
DataTestflightDistribute instance) =>
|
||||
|
|
@ -683,6 +684,7 @@ Map<String, dynamic> _$DataTestflightDistributeToJson(
|
|||
'message': instance.message,
|
||||
'testers': instance.testers,
|
||||
'platform': instance.platform,
|
||||
'buildNumber': instance.buildNumber,
|
||||
};
|
||||
|
||||
DataPublishiOS _$DataPublishiOSFromJson(Map<String, dynamic> json) =>
|
||||
|
|
|
|||
Loading…
Reference in a new issue