Use SDK podhelper in add-to-app module Podfile#73072
Merged
jmagman merged 1 commit intoflutter:masterfrom Jan 14, 2021
Merged
Conversation
a464322 to
e6f19d5
Compare
e6f19d5 to
2a448b1
Compare
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
jmagman
commented
Jan 5, 2021
| use_frameworks! | ||
| flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) | ||
|
|
||
| pod 'FlutterPluginRegistrant', :path => File.join('Flutter', 'FlutterPluginRegistrant'), :inhibit_warnings => true |
Member
Author
There was a problem hiding this comment.
Except for the FlutterPluginRegistrant addition this file is almost the same as a normal app Podfile.
Member
Author
Member
Author
|
Added a |
christopherfujino
approved these changes
Jan 14, 2021
Contributor
christopherfujino
left a comment
There was a problem hiding this comment.
LGTM, thanks for the n00b friendly description and background.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
There are currently two ways to embed plugins in an iOS app via CocoaPods.
flutter created apps import a helper Ruby script into theirios/Podfilethat lives in theflutter_toolspackage bin directory, and then helper methods likeflutter_install_all_ios_podsare called.flutter/packages/flutter_tools/templates/cocoapods/Podfile-ios-objc
Lines 26 to 32 in 80f15dc
Podfileand call helper methods likeinstall_all_flutter_pods, but this helper script is generated in the Flutter module itself as a template file. This allows the host app to import the script as a relative path, and avoids absolute Flutter SDK paths from being checked anywhere into the host app project.flutter/dev/integration_tests/ios_host_app/Podfile
Lines 4 to 8 in 80f15dc
The Flutter module (
flutter create -t module) app generates an ephemeral fake-host app (recreated on everyflutter clean) to allow fastflutter runprototyping of the Flutter bits. This "host" app currently uses the second plugin embedding method and uses the generated templatepodhelper.rb. This PR changes it to use the first method to more closely align it to a normalflutter create'd app. This will allow the module to leverage the new Flutter XCFramework logic, and avoid issues like #37850 which have been resolved in the first method.Description
In the add-to-app module Podfile use the Flutter SDK podhelper helper methods to match the behavior of normal apps, instead of using the podhelper that's generated in the module, which will still be imported in the host app's Podfile.
.ios/Flutter/.symlinks/->.ios/.symlinks/plugins/build ios-frameworkssince the plugins now link on the engine artifacts instead of the one copied into the module app.FlutterPluginRegistrantpod.Related Issues
Fixes
flutter build ios --release --local-enginein modules since the plugins are linking directly against the engine artifacts. #51989Fixes #48092
Tests
Added checks for the host app Podfile.lock in
module_test_ios.Thoroughly tested by
build_ios_framework_module_test.