refactored cli tool ipa method name to support --export-options-plist (#138555)

This PR changes the way the IPA method is read in the run command for `build ipa` command. If export options plist argument is provided it takes method name from plist, otherwise it uses the method name from export method argument.

*List which issues are fixed by this PR. You must list at least one issue. An issue is not required if the PR fixes something trivial like a typo.*
fixes [#122179](https://github.com/flutter/flutter/issues/122179)
This commit is contained in:
raphire08
2023-12-18 14:26:07 +05:30
committed by GitHub
parent f8b9748661
commit 4659b0c402
2 changed files with 74 additions and 3 deletions

View File

@@ -463,13 +463,15 @@ class BuildIOSArchiveCommand extends _BuildIOSSubCommand {
final String relativeOutputPath = app.ipaOutputPath;
final String absoluteOutputPath = globals.fs.path.absolute(relativeOutputPath);
final String absoluteArchivePath = globals.fs.path.absolute(app.archiveBundleOutputPath);
final String exportMethod = stringArg('export-method')!;
final bool isAppStoreUpload = exportMethod == 'app-store';
String? exportOptions = exportOptionsPlist;
String? exportMethod = exportOptions != null ?
globals.plistParser.getValueFromFile<String?>(exportOptions, 'method') : null;
exportMethod ??= stringArg('export-method')!;
final bool isAppStoreUpload = exportMethod == 'app-store';
File? generatedExportPlist;
try {
final String exportMethodDisplayName = isAppStoreUpload ? 'App Store' : exportMethod;
status = globals.logger.startProgress('Building $exportMethodDisplayName IPA...');
String? exportOptions = exportOptionsPlist;
if (exportOptions == null) {
generatedExportPlist = _createExportPlist();
exportOptions = generatedExportPlist.path;