-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Use SDK podhelper in add-to-app module Podfile #73072
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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. |
| use_frameworks! | ||
| flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) | ||
|
|
||
| pod 'FlutterPluginRegistrant', :path => File.join('Flutter', 'FlutterPluginRegistrant'), :inhibit_warnings => true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except for the FlutterPluginRegistrant addition this file is almost the same as a normal app Podfile.
|
Added a |
christopherfujino
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the n00b friendly description and background.
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.