Skip to content

Conversation

@jmagman
Copy link
Member

@jmagman jmagman commented Nov 16, 2020

Description

Remove the module restriction from flutter build ios-framework to allow normal apps to be exported as embeddable frameworks.

The only difference in output is that the module has a FlutterPluginRegistrant framework that only contains the GeneratedPluginRegistrant class. For non-modules, copy GeneratedPluginRegistrant.{h,m} to the output directory and tell the user to manually copy it to their host project.

Run from a flutter create app (not module) project:
Screen Shot 2020-11-16 at 1 19 02 PM

$ ls -la flutter-frameworks 
total 16
drwxr-xr-x   7 magder  primarygroup  224 Nov 16 13:18 .
drwxr-xr-x  26 magder  primarygroup  832 Nov 16 13:16 ..
drwxr-xr-x   4 magder  primarygroup  128 Nov 16 13:17 Debug
-rw-r--r--   1 magder  primarygroup  357 Nov 16 13:17 GeneratedPluginRegistrant.h
-rw-r--r--   1 magder  primarygroup  438 Nov 16 13:17 GeneratedPluginRegistrant.m
drwxr-xr-x   4 magder  primarygroup  128 Nov 16 13:18 Profile
drwxr-xr-x   4 magder  primarygroup  128 Nov 16 13:18 Release

Tests

Updated build_ios_framework_module_test to test an app as well as a module.

@jmagman jmagman added platform-ios iOS applications specifically a: existing-apps Integration with existing apps via the add-to-app flow labels Nov 16, 2020
@jmagman jmagman self-assigned this Nov 16, 2020
@flutter-dashboard flutter-dashboard bot added c: contributor-productivity Team-specific productivity, code health, technical debt. tool Affects the "flutter" command-line tool. See also t: labels. labels Nov 16, 2020
@google-cla google-cla bot added the cla: yes label Nov 16, 2020
@jmagman jmagman force-pushed the build-ios-framework branch from f135941 to 20f8e56 Compare November 16, 2020 21:25
@jmagman jmagman requested a review from xster November 16, 2020 21:55
@xster
Copy link
Member

xster commented Nov 17, 2020

Removing arbitrary restrictions definitely sound reasonable. Do you foresee new potential collision issues since currently it's impossible for users to add entitlements, plists, change the build settings etc on the module.

Also tangent: if we do this on Android, we'll have to re-think about how to do analytics for add-to-app since the detection (also very imperfect) is based on the module template being merged into the app.

@jmagman
Copy link
Member Author

jmagman commented Nov 17, 2020

Removing arbitrary restrictions definitely sound reasonable. Do you foresee new potential collision issues since currently it's impossible for users to add entitlements, plists, change the build settings etc on the module.

You mean the user may be surprised that they need to add an entitlement to their host app when they already added it to their Flutter iOS app? I guess I'm assuming a higher level of Apple development understanding here. This doesn't do anything for the more magic embedding CocoaPods case that requires a module. Flutter isn't really special, it's just a framework, and some frameworks require that entitlements be added when you embed and use them. We can see if we get any confused user bugs.

@jmagman jmagman force-pushed the build-ios-framework branch from 20f8e56 to ea68ebf Compare November 17, 2020 21:32
Copy link
Member

@xster xster left a comment

Choose a reason for hiding this comment

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

LGTM

dnfield added a commit that referenced this pull request Nov 18, 2020
dnfield added a commit that referenced this pull request Nov 18, 2020
dnfield added a commit that referenced this pull request Nov 18, 2020
@jmagman jmagman deleted the build-ios-framework branch November 18, 2020 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: existing-apps Integration with existing apps via the add-to-app flow c: contributor-productivity Team-specific productivity, code health, technical debt. platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants