Skip to content

Conversation

@jmagman
Copy link
Member

@jmagman jmagman commented Oct 8, 2020

Description

Create a new flutter build xcarchive command. It's close to the same as flutter build ios but with archive tacked onto the end of the xcodebuild command.

Related Issues

Fixes #66619
Part of #13065
Follow up documentation at flutter/website#4852.

Tests

build_xcarchive_test, added a check to ios_content_validation_test.

Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I signed the [CLA].
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

  • No, no existing tests failed, so this is not a breaking change.
  • Yes, this is a breaking change. If not, delete the remainder of this section.

@jmagman jmagman added platform-ios iOS applications specifically t: xcode "xcodebuild" on iOS and general Xcode project management labels Oct 8, 2020
@jmagman jmagman self-assigned this Oct 8, 2020
@flutter-dashboard flutter-dashboard bot added c: contributor-productivity Team-specific productivity, code health, technical debt. tool Affects the "flutter" command-line tool. See also t: labels. labels Oct 8, 2020
@google-cla google-cla bot added the cla: yes label Oct 8, 2020
Copy link
Member Author

Choose a reason for hiding this comment

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

Archive also doesn't need config-only, simulator, or codesign flags.

Copy link
Member Author

Choose a reason for hiding this comment

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

This hunk is mostly whitespace changes. The copy logic and watch companion adjustments were moved into the buildAction == XcodeBuildAction.build condition.

Comment on lines +442 to +445
Copy link
Member Author

Choose a reason for hiding this comment

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

This bit is new.

Copy link
Contributor

Choose a reason for hiding this comment

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

What circumstance would lead to the archive missing but no build errors?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think it should happen, but we have the same check right above it for a missing Runner.app on build.
That was introduced in #14663 but I don't quite know why, it wasn't present in the previous versions that were reverted. Possibly related to #14661?

Copy link
Contributor

Choose a reason for hiding this comment

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

FYI @xster do you have any more context here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Mostly cribbed from build_macos_test.dart

Copy link
Contributor

Choose a reason for hiding this comment

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

nit, document a little bit

Copy link
Contributor

Choose a reason for hiding this comment

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

also, if you never switch over this consider using String constants

Copy link
Member Author

Choose a reason for hiding this comment

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

I prefer comparing enums to strings whether it's in a switch or an if conditional, strings are for human readability (and for wrapping a bunch of shelled out commands, as we do...). It also adds some pseudo type checking when being passed around. And not that it matters in this context, but the comparison is faster (at least in most languages, maybe dart does something as fast with a const string?). The only time when you have to think about it a bit is when you're serializing it to make sure if you insert one into the middle of the list it doesn't change the order of the enumeration symbols. But I'd rather serialize an int than a string in that case anyway.

dart-lang/language#158 would be nice.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't really think the performance will matter for this code, but ack on the usability.

Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM

Can you create a follow up ticket for website documentation?

@jmagman
Copy link
Member Author

jmagman commented Oct 9, 2020

Can you create a follow up ticket for website documentation?

flutter/website#4852

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

Labels

c: contributor-productivity Team-specific productivity, code health, technical debt. platform-ios iOS applications specifically t: xcode "xcodebuild" on iOS and general Xcode project management tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "flutter build xcarchive" command"

2 participants