Skip to content

Conversation

@jmagman
Copy link
Member

@jmagman jmagman commented Jun 8, 2020

Description

Another attempt at #58522.

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 added platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels. t: xcode "xcodebuild" on iOS and general Xcode project management labels Jun 8, 2020
@jmagman jmagman requested a review from christopherfujino June 8, 2020 19:36
@jmagman jmagman self-assigned this Jun 8, 2020
@fluttergithubbot fluttergithubbot added d: examples Sample code and demos c: contributor-productivity Team-specific productivity, code health, technical debt. labels Jun 8, 2020
@jmagman
Copy link
Member Author

jmagman commented Jun 8, 2020

The difference between this and #58522 is cb5b9e2

  • Change "group:Runner.xcodeproj" to location = "self:" (Build iOS apps using Swift Packages #58522 had self:Runner.xcodeproj)
  • Remove location = "self:Pods/Pods.xcodeproj" (not sure why the project ever needed to know about it since it's in the workspace).
  • Support migrating lines and entire files sequentially.

#58522 ios_app_with_extensions_test failed on devicelab post-submit, though it succeeded on my machine. That test on this PR also succeeds on my machine, so we'll have to see what devicelab thinks.

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 one nit question


@override
String migrateFileContents(String fileContents) {
const String podLocation = '''
Copy link
Contributor

Choose a reason for hiding this comment

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

nit. is this guaranteed to match, even with the surrounding whitespace?

Copy link
Member Author

Choose a reason for hiding this comment

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

We generated this as part of the template with https://github.com/flutter/flutter/pull/4893/files#diff-fddbdff9cdb9e32ee9b9a95f74f30788R5-R8. Xcode and CocoaPods won't add it (at least how we have the project set up now).

@fluttergithubbot fluttergithubbot merged commit 43e2808 into flutter:master Jun 8, 2020
jmagman added a commit that referenced this pull request Jun 8, 2020
jmagman added a commit that referenced this pull request Jun 8, 2020
@jmagman jmagman deleted the spm-build-loc branch June 8, 2020 22:45
zljj0818 pushed a commit to zljj0818/flutter that referenced this pull request Jun 22, 2020
zljj0818 pushed a commit to zljj0818/flutter that referenced this pull request Jun 22, 2020
mingwandroid pushed a commit to mingwandroid/flutter that referenced this pull request Sep 6, 2020
mingwandroid pushed a commit to mingwandroid/flutter that referenced this pull request Sep 6, 2020
@jmagman jmagman restored the spm-build-loc branch October 16, 2020 21:50
@jmagman jmagman mentioned this pull request Oct 16, 2020
10 tasks
@jmagman jmagman mentioned this pull request Dec 21, 2020
10 tasks
@jmagman jmagman deleted the spm-build-loc branch January 6, 2021 20:27
@jmagman jmagman mentioned this pull request Jan 7, 2021
10 tasks
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. d: examples Sample code and demos 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

4 participants