Skip to content

Fastlane: build Xcode project only once#7012

Merged
sfshaza2 merged 3 commits intoflutter:mainfrom
maxlapides:patch-1
Apr 12, 2022
Merged

Fastlane: build Xcode project only once#7012
sfshaza2 merged 3 commits intoflutter:mainfrom
maxlapides:patch-1

Conversation

@maxlapides
Copy link
Contributor

Fortunately, we don't have to rebuild the entire iOS project anymore :)

It actually looks like we will be able to update these docs again in the near future after @jmagman's PR flutter/flutter#97672 lands on stable. At that point, most projects can skip the fastlane build_app step altogether.

It may be worth mentioning that build_app can be used to set Xcode values like configuration which is really helpful if you are using fastlane match and you want to have separate configurations for ad-hoc vs app store builds (without authoring a plist file).

Description of what this PR is changing or adding, and why:

Issues fixed by this PR (if any):

Presubmit checklist

Fortunately, we don't have to rebuild the entire iOS project anymore :)

It actually looks like we will be able to update these docs again in the near future after @jmagman's PR flutter/flutter#97672 lands on stable. At that point, most projects can skip the `fastlane build_app` step altogether.

It may be worth mentioning that `build_app` can be used to set Xcode values like `configuration` which is really helpful if you are using fastlane match and you want to have separate configurations for ad-hoc vs app store builds (without authoring a plist file).
@sfshaza2
Copy link
Contributor

@jmagman, this lgtm, and I see that the reference PR is merged. Can we go ahead and land this?

Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fastlane expert but this LGTM from my reading of https://docs.fastlane.tools/actions/build_ios_app/. Thanks for the contribution @maxlapides!

Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maxlapides below under Running deployment locally it says:

flutter build ios --release --no-codesign. No need to sign now since fastlane will sign when archiving.

Based on this lane, is that still the right command? I didn't add --no-codesign to flutter build ipa but maybe I should add that.

@maxlapides
Copy link
Contributor Author

@maxlapides below under Running deployment locally it says:

flutter build ios --release --no-codesign. No need to sign now since fastlane will sign when archiving.

Based on this lane, is that still the right command? I didn't add --no-codesign to flutter build ipa but maybe I should add that.

@jmagman Great catch! I just updated that command to be flutter build ipa.

But, to answer your question, I do think it would be great if we could have the --no-codesign flag on the flutter build ipa step. It would simplify our CI process a little bit :)

@jmagman
Copy link
Member

jmagman commented Apr 12, 2022

Since you only need the xcarchive and not ipa would it also be useful to have a flutter build xcarchive --skip-ipa flag that would create the xcarchive but not try to build the IPA?
Thanks again for your insights here. And please file feature requests at https://github.com/flutter/flutter/issues if you have further suggestions for improving these commands.

@maxlapides
Copy link
Contributor Author

@jmagman Yes I think that --skip-ipa flag would also be helpful for us :) Our use case is we want to run flutter build ipa to build an xcarchive, then run fastlane's build_app twice: once for an ad-hoc build, then once for an app store build.

I haven't tested out our build after your PR that adds automatic settings for the export options plist, but I assume that we will still want to use fastlane's build_app after flutter build ipa because it gives us easy control over the Xcode settings.

@maxlapides
Copy link
Contributor Author

Or, perhaps --no-codesign can automatically skip the IPA step, and then we might not need the --skip-ipa flag 🤔

Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmagman Yes I think that --skip-ipa flag would also be helpful for us :) Our use case is we want to run flutter build ipa to build an xcarchive, then run fastlane's build_app twice: once for an ad-hoc build, then once for an app store build.

I haven't tested out our build after your PR that adds automatic settings for the export options plist, but I assume that we will still want to use fastlane's build_app after flutter build ipa because it gives us easy control over the Xcode settings.

Okay, let's take the conversation to the Flutter GitHub issue tracker instead of this website PR.

@sfshaza2 this still LGTM

Copy link
Contributor

@sfshaza2 sfshaza2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per Jenn, lgtm. Thanks so much, @maxlapides!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants