Build iOS apps using Swift Packages#58522
Conversation
| <Workspace | ||
| version = "1.0"> | ||
| <FileRef | ||
| location = "group:Runner.xcodeproj"> |
There was a problem hiding this comment.
I let the tool migrate all these examples by flutter build iosing them.
| /* Begin XCRemoteSwiftPackageReference section */ | ||
| F735C5C22485E50A002BE868 /* XCRemoteSwiftPackageReference "example-package-playingcard" */ = { | ||
| isa = XCRemoteSwiftPackageReference; | ||
| repositoryURL = "https://github.com/apple/example-package-playingcard.git"; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
sure hope that repo doesn't disappear...
There was a problem hiding this comment.
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.
|
@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). |
christopherfujino
left a comment
There was a problem hiding this comment.
LGTM with a few nits
| /* Begin XCRemoteSwiftPackageReference section */ | ||
| F735C5C22485E50A002BE868 /* XCRemoteSwiftPackageReference "example-package-playingcard" */ = { | ||
| isa = XCRemoteSwiftPackageReference; | ||
| repositoryURL = "https://github.com/apple/example-package-playingcard.git"; |
There was a problem hiding this comment.
sure hope that repo doesn't disappear...
packages/flutter_tools/lib/src/ios/migrations/project_build_location_migration.dart
Outdated
Show resolved
Hide resolved
packages/flutter_tools/test/general.shard/ios/ios_project_migration_test.dart
Outdated
Show resolved
Hide resolved
|
double LGTM |
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. |
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.

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
///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change