-
Notifications
You must be signed in to change notification settings - Fork 28.9k
Exclude armv7 from iOS add-to-app plugins #101943
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
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 (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
test-exempt: is a test |
plugin_pods = flutter_parse_dependencies_file_for_ios_plugin(plugins_file) | ||
|
||
# flutter_parse_plugins_file is in Flutter root podhelper.rb | ||
plugin_pods = flutter_parse_plugins_file(plugins_file, 'ios') |
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.
Use
def flutter_parse_plugins_file(file, platform) |
installer.pods_project.targets.each do |target| | ||
target.build_configurations.each do |build_configuration| | ||
# flutter_additional_ios_build_settings is in Flutter root podhelper.rb | ||
flutter_additional_ios_build_settings(target) |
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.
def flutter_additional_ios_build_settings(target) |
raise 'Missing `flutter_post_install(installer)` in Podfile `post_install` block' | ||
end | ||
|
||
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) |
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.
nit, would be nice if this were lifted to the top. however, would require a refactor, as the flutter_root
function can't be called until it's defined, because in ruby function definitions are expression statements evaluated in order. so not a blocker for this PR.
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
When this hits a tagged beta release, update the website to indicate the version in which the new Ruby method is available flutter/website#7039 |
In the add-to-app
podhelper.rb
ruby script filerequire
(import) the Flutter SDKflutter_tools/bin/podhelper.rb
version of this file to push as much logic as possible into the SDK instead of the module project, and allow sharing logic between these scripts.Introduce a new
flutter_post_install
method to the add-to-apppodhelper.rb
ruby script file. This calls the existingflutter_additional_ios_build_settings
method in the SDKpodhelper.rb
flutter/packages/flutter_tools/bin/podhelper.rb
Line 33 in ae805de
This will update the host app Flutter plugin build settings to:
Link against the right version of the Flutter.framework (simulator, debug, etc) in the artifacts cache, see Move Flutter.framework to build directory instead of ios/Flutter #70224. This will fix Flutter module with plugins requires "flutter build ios" in the module before being able to build for the simulator in host app #75296 since the plugin is now linking directly against the correct artifacts version instead of the last engine variant copied into the module project.
Set
EXCLUDED_ARCHS[sdk=iphonesimulator*] = $(inherited) i386
(Support iOS arm64 simulator #85642) andEXCLUDED_ARCHS[sdk=iphoneos*]= $(inherited) armv7
(Do not build for iOS armv7 #97341). This means Flutter plugins will not build for 32-bitarmv7
iOS, unblocking Excludearm7v
from iOS architectures when building add-to-app plugins in host app with CocoaPods #101793Set
ONLY_ACTIVE_ARCH = NO
for plugins in debug mode. This means botharm64
andx86_64
simulator versions of the plugins will be built, so if a plugin doesn't support thearm64
simulators, the app can link against the x64 version of the plugins Build Flutter iOS plugins with all valid architectures #95293Add a fatal Ruby exception to fire on
pod install
that will instruct the user to add the following to their host app Podfile if it's missing:Error looks like:
Fixes #101793
Fixes #75296
Fixes #78368
Unblocks #101793
Samples update: flutter/samples#1079
Website update: flutter/website#7032
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.