Repository navigation
Export an IPA for distribution via "flutter build ipa" without --export-options-plist - #97243
Conversation
2ee2901 to
145ac21
Compare
|
This pull request has been changed to a draft. The currently pending flutter-gold status will not be able to resolve until a new commit is pushed or the change is marked ready for review again. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
| expect(fakeProcessManager, hasNoRemainingExpectations); | ||
| }, overrides: <Type, Generator>{ | ||
| FileSystem: () => fileSystem, | ||
| ProcessManager: () => FakeProcessManager.list(<FakeCommand>[ |
There was a problem hiding this comment.
Some of the changes in this file were moving the FakeCommands out of the overrides and into the test method body so hasNoRemainingExpectations can be checked.
|
Adding @cyanglaz for overall review & iOS distribution thoughts, @zanderso for help/logging word-smithing, and @christopherfujino for tool review. |
|
|
||
| final File tempPlist = globals.fs.systemTempDirectory | ||
| .createTempSync('flutter_build_ios.').childFile('ExportOptions.plist'); | ||
| tempPlist.writeAsStringSync(plistContents.toString()); |
There was a problem hiding this comment.
I never clean this temp directory up, it's really small, like 4K. Do we care?
There was a problem hiding this comment.
Generally, yes. This is probably okay though because globals.fs.systemTempDirectory is actually something like $TEMP/flutter_tool.xxxxxxxx, and the tool will clean that up on exit or when getting shutdown by a catchable signal.
There was a problem hiding this comment.
I just tested it, the tool didn't delete it after completion. Where does that deletion mechanism happen?
Path was $TMPDIR/flutter_tools.8iosr9/flutter_build_ios.q898lp/ExportOptions.plist
There was a problem hiding this comment.
Updated the PR to clean up the file.
|
|
||
| final File tempPlist = globals.fs.systemTempDirectory | ||
| .createTempSync('flutter_build_ios.').childFile('ExportOptions.plist'); | ||
| tempPlist.writeAsStringSync(plistContents.toString()); |
There was a problem hiding this comment.
Generally, yes. This is probably okay though because globals.fs.systemTempDirectory is actually something like $TEMP/flutter_tool.xxxxxxxx, and the tool will clean that up on exit or when getting shutdown by a catchable signal.
Taking cyanglaz off, adding huan since Chris is out. |
hellohuanlin
left a comment
There was a problem hiding this comment.
overall logic looks good
…t --export-options-plist (flutter/flutter#97243)
|
Does the failure here https://ci.chromium.org/ui/p/flutter/builders/prod/Mac_ios%20ios_content_validation_test/3446/overview have to do with this commit? |
Yes 😞 Revert at #97614 |
…t --export-options-plist (flutter/flutter#97243)
…t --export-options-plist (flutter/flutter#97243)
…t --export-options-plist (flutter/flutter#97243)
flutter build ipahas two stages for iOS distribution:xcarchivebundle.xcarchiveinto anipabundle for distribution to the App Store, or to a device, or enterprise distribution...Currently to get to number 2 and create the
ipafile users need to pass in a--export-options-plistfile, which they need to create themselves, or know how to yank off a previously-build IPA. Flutter's iOS distribution docs don't say what needs to go into the plist, it just points to Apple docs, or tells them to launch Xcode and create the IPA there.In this PR, if the user doesn't pass
--export-options-plist, instead of bailing after thexcarchive, assume the user wants the most common case: to distribute their app to the App Store via the new--export-methodoption and its defaultapp-store. Create the plist if one isn't passed in, with reasonable defaults for the most common settings for a Flutter app. If it fails (they haven't registered their app bundle ID for example), suggest they open the archive in Xcode and go through its wizard, as the docs currently suggest.Allow the user to also specify
--export-method ad-hocor--export-method development. See https://developer.apple.com/forums/thread/100614 for the distinction.If the user has a more complicated scenario, they can continue to create their own plist via
--export-options-plist, or open with Xcode.We can add other options in the future for other values in the generated plist, if developers request it.
Command logging examples
Success
Flag validation error
IPA creation failure
The bundle identifier isn't set up, which needs to be resolved in Xcode's UI:
Help text
Fixes #97179
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.