-
Notifications
You must be signed in to change notification settings - Fork 27.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build IPA command #67781
Build IPA command #67781
Conversation
e1b3888
to
37a3482
Compare
0bd9040
to
792152d
Compare
Requiring users to run Similarly, if all CI build scripts would need to be something like |
processManager: FakeProcessManager.any(), | ||
); | ||
|
||
await expectToolExitLater( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Til about expectToolExitLater
I was taking cues from
I could update this to run I was thinking of this command is a thin convenience wrapper on top of an |
install probably isn't the best designed |
One way you could support this as either the primary development command or a wrapper is allow the user to provide a --path-to-xcarchive (is this customizable?) and then use it as is if provided. |
@@ -385,6 +385,11 @@ class BuildableIOSApp extends IOSApp { | |||
String get archiveBundlePath | |||
=> globals.fs.path.join(getIosBuildDirectory(), 'archive', globals.fs.path.withoutExtension(_hostAppBundleName)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slightly tangential: at some point we might want to take stock of all the "temporary but user accessible" build artifacts mixed with build intermediaries in the build/ folder and organize them.
Right now I have
build
├── 3f44400bd8f8c7820069645ed94a731d
├── app
│ ├── generated
│ │ ├── ap_generated_sources
│ │ ├── not_namespaced_r_class_sources
│ │ ├── res
│ │ └── source
│ ├── intermediates
│ │ ├── annotation_processor_list
│ │ ├── apk_list
│ │ ├── blame
│ │ ├── bundle_manifest
│ │ ├── check_manifest_result
│ │ ├── compatible_screen_manifest
│ │ ├── dex
│ │ ├── duplicate_classes_check
│ │ ├── external_file_lib_dex_archives
│ │ ├── external_libs_dex
│ │ ├── flutter
│ │ ├── generated_proguard_file
│ │ ├── incremental
│ │ ├── instant_app_manifest
│ │ ├── javac
│ │ ├── lint_jar
│ │ ├── manifest_merge_blame_file
│ │ ├── merged-not-compiled-resources
│ │ ├── merged_assets
│ │ ├── merged_java_res
│ │ ├── merged_jni_libs
│ │ ├── merged_manifests
│ │ ├── merged_native_libs
│ │ ├── merged_shaders
│ │ ├── metadata_feature_manifest
│ │ ├── processed_res
│ │ ├── proguard-files
│ │ ├── proguard-rules
│ │ ├── res
│ │ ├── res_stripped
│ │ ├── shader_assets
│ │ ├── signing_config
│ │ ├── stripped_native_libs
│ │ ├── symbols
│ │ ├── transforms
│ │ └── validate_signing_config
│ ├── outputs
│ │ ├── apk
│ │ ├── flutter-apk
│ │ ├── logs
│ │ └── mapping
│ ├── reports
│ └── tmp
│ ├── compileDebugJavaWithJavac
│ ├── compileProfileJavaWithJavac
│ ├── compileReleaseJavaWithJavac
│ ├── packLibsflutterBuildDebug
│ ├── packLibsflutterBuildProfile
│ └── packLibsflutterBuildRelease
├── fa37e11e55641aa14c7c94ec233f11be
└── ios
├── Debug-iphoneos
│ └── Runner.app
├── Profile-iphoneos
│ ├── Runner.app
│ └── Runner.app.dSYM
├── Runner.build
│ └── Release-iphoneos
└── iphoneos
└── Runner.app
without counting ios-frameworks, aars etc. We don't have to fix anything here but it's a question for the next comment.
'export-options-plist', | ||
valueHelp: 'ExportOptions.plist', | ||
help: | ||
'Path to the "-exportOptionsPlist" file passed to Xcode. See "man xcodebuild" for available keys.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For first timers (which we will have), we might need to link to a Flutter page to describe what it is. Since we'll certainly have Flutter developers shipping for the first time to the app store without having shipped an ios app in the past.
Feel free to come back in a later PR too instead of leaving a placeholder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For sure, we'll need to point to some docs. But we can pretty much just point to Apple's docs since this command is a really thin wrapper and doesn't process any plist values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a TODO to update the new option help text.
final FileSystemEntityType type = _fileSystem.typeSync(exportOptionsPlist); | ||
if (type == FileSystemEntityType.notFound) { | ||
throwToolExit( | ||
'"$exportOptionsPlist" property list does not exist. See "man xcodebuild" for available keys.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't actually see the available keys in the manual (which is really long). We might need to do a bit more hand-holding for pure-flutter users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, it's in the xcrun xcodebuild -h
but not the man page.
I think I'm being too pedantic differentiating between building xcarchive and ipa. I am going to combine the commands so it's not a two-step that can get out of sync. |
+1. We should replicate Apple's capabilities but we don't have to replicate their exact APIs if there are opportunities to make it clearer. |
Reworked this based on feedback. Renamed I will update the publishing iOS docs when this lands and update the help text to link to something more useful than |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -56,14 +57,27 @@ class BuildIOSCommand extends _BuildIOSSubCommand { | |||
bool get shouldCodesign => boolArg('codesign'); | |||
} | |||
|
|||
/// Builds an .xcarchive for an iOS app to be generated for App Store submission. | |||
/// Builds an .xcarchive and optionally .ipa for an iOS app to be generated for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds like it's the other way around now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it always builds an .xcarchive, and only builds an IPA if you pass in the plist flag.
final FileSystemEntityType type = globals.fs.typeSync(exportOptionsPlist); | ||
if (type == FileSystemEntityType.notFound) { | ||
throwToolExit( | ||
'"$exportOptionsPlist" property list does not exist. See "man xcodebuild" for available keys.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The second sentence here and below seem like non sequiturs? I assume you're just trying to say file x you specified doesn't exist?
Also be consistent with man xcodebuild vs xcodebuild -h
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I saw this after it was merged. Will follow up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Error Domain=IDEFoundationErrorDomain Code=1 "exportOptionsPlist error for key 'method': expected one of {app-store, ad-hoc, enterprise, development, validation}, but found developmentasdasd" ... | ||
LineSplitter.split(result.stderr) | ||
.where((String line) => line.contains('error: ')) | ||
.forEach(errorMessage.writeln); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice use of tear-offs!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Woooow!!! nice feature! THANK YOU! |
Description
Add a parameter to
flutter build ipa
to pass toxcodebuild -exportArchive
to generate an IPA from an xcarchive.Related Issues
Fixes #13065
#67598
Follow up documentation at flutter/website#4852
Tests
build_ipa_test
Checklist
///
).flutter analyze --flutter-repo
) does not report any problems on my PR.Breaking Change