Skip to content

Build iOS apps using Swift Packages#58522

Merged
jmagman merged 3 commits intoflutter:masterfrom
jmagman:spm-legacy
Jun 3, 2020
Merged

Build iOS apps using Swift Packages#58522
jmagman merged 3 commits intoflutter:masterfrom
jmagman:spm-legacy

Conversation

@jmagman
Copy link
Member

@jmagman jmagman commented Jun 2, 2020

Description

Swift packages cannot be added to a newly created Flutter iOS app due to the Xcode project settings (not workspace) being set to the "legacy" build location. Update to the "default" Xcode build location.
73312223-10950180-41dd-11ea-9a66-98d3a140f0fd

Screen Shot 2020-06-02 at 1 56 59 PM

Update templates, add tool migrator, let tool upgrade all examples and integration tests.

Related Issues

Fixes #57083
Related to #49654

Tests

  • Migrator tests

  • Added the basic Apple example Swift package to an existing integration test. The adds a networked dependency to integration test, but hopefully Apple never removes this (and if they do, we can replace with another one).

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 requested a review from christopherfujino June 2, 2020 20:36
@jmagman jmagman self-assigned this Jun 2, 2020
<Workspace
version = "1.0">
<FileRef
location = "group:Runner.xcodeproj">
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 let the tool migrate all these examples by flutter build iosing them.

Copy link
Contributor

Choose a reason for hiding this comment

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

magic

/* Begin XCRemoteSwiftPackageReference section */
F735C5C22485E50A002BE868 /* XCRemoteSwiftPackageReference "example-package-playingcard" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/apple/example-package-playingcard.git";
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 was the most basic Apple Swift Package I could find. When we run the integration test it will check out this dependency from the GitHub repo.

Copy link
Contributor

Choose a reason for hiding this comment

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

sure hope that repo doesn't disappear...

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 is the example package used in the Swift docs so hopefully if they every remove it they will replace it with some other example we can easily migrate. Fortunately it's not actually being used anywhere, so it will be extremely trivial to replace with some different package.

@fluttergithubbot fluttergithubbot added d: examples Sample code and demos c: contributor-productivity Team-specific productivity, code health, technical debt. tool Affects the "flutter" command-line tool. See also t: labels. labels Jun 2, 2020
@xster
Copy link
Member

xster commented Jun 2, 2020

@cbracken I vaguely remember you added this originally (maybe to deal with pods getting included twice or something?)

Do you have the original bug to test against again?

@jmagman
Copy link
Member Author

jmagman commented Jun 2, 2020

@cbracken I vaguely remember you added this originally (maybe to deal with pods getting included twice or something?)

Do you have the original bug to test against again?

Added which part, originally? This "legacy" build location stuff was included in #4893.

Are you thinking of #20685? That's the Legacy Build System (different than build location) which hasn't been used since #33684. See also #20685 (comment).

Copy link
Contributor

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

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

LGTM with a few nits

/* Begin XCRemoteSwiftPackageReference section */
F735C5C22485E50A002BE868 /* XCRemoteSwiftPackageReference "example-package-playingcard" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/apple/example-package-playingcard.git";
Copy link
Contributor

Choose a reason for hiding this comment

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

sure hope that repo doesn't disappear...

@christopherfujino
Copy link
Contributor

double LGTM

@xster
Copy link
Member

xster commented Jun 2, 2020

Added which part, originally? This "legacy" build location stuff was included in #4893.

Are you thinking of #20685? That's the Legacy Build System (different than build location) which hasn't been used since #33684. See also #20685 (comment).

ah yup, I'm totally mixed up

@jmagman
Copy link
Member Author

jmagman commented Jun 2, 2020

Added which part, originally? This "legacy" build location stuff was included in #4893.
Are you thinking of #20685? That's the Legacy Build System (different than build location) which hasn't been used since #33684. See also #20685 (comment).

ah yup, I'm totally mixed up

Are you suggesting legacy build LOCATION and legacy build SYSTEM are easy to confuse (see my identical confusion at #44811 (comment))?! Don't worry, there are like zero docs for any of this.

@jmagman jmagman merged commit 2054f37 into flutter:master Jun 3, 2020
@jmagman jmagman deleted the spm-legacy branch June 3, 2020 00:57
jmagman added a commit that referenced this pull request Jun 3, 2020
jmagman added a commit that referenced this pull request Jun 3, 2020
jmagman added a commit to jmagman/flutter that referenced this pull request Jun 8, 2020
@jmagman jmagman mentioned this pull request Jun 8, 2020
10 tasks
@jmagman jmagman added the platform-ios iOS applications specifically label Aug 21, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

c: contributor-productivity Team-specific productivity, code health, technical debt. d: examples Sample code and demos platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

5 participants