-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
Allow directly sharing iOS and macOS plugin native code #115085
Comments
At least on the tool side I don't think it would be too difficult. Would need to handle all the flutter/packages/flutter_tools/lib/src/flutter_plugins.dart Lines 1209 to 1215 in b31b9dc
And then the podhelper needs to know about the new key when parsing
I'm sure I'm forgetting some places. |
this can be part of effort of swift migration for path_provider/shared_preferences/url_launcher plugins, as discussed in the swift migration doc |
The pubspec would also need to support a |
I was thinking that rather than a new platform field, it would be a new subfield. Something like:
That way we aren't conflating conceptual platforms with the directories. If we do that, it's entirely local to Flutter, with no |
Adding just that key is easier. Got it working in draft PR #115337, it needs an end-to-end integration test.
Also requires documentation updates: |
Agreed this seems like a pretty sensible approach for code that's common across both platforms (i.e. not UIKit or AppKit specific). You could imagine cases where there's some shared Darwin code but also some AppKit or UIKit code; in such a case we'd want to support shared Darwin code in |
Pods don't allow references outside of the pod root, so that gets to be problematic. My thought was that if enough is common that you're using using |
Finally got back to this: https://flutter.dev/go/plugin-shared-ios-macos |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
See previous discussion in #52285. At that time the decision was to use symlinks, but that's kind of a pain due to dart-lang/pub#3143, which means all files have to be symlinked, rather than the directories (which wasn't true when the decision was made initially). For non-trivial plugins that can be a lot of files (e.g.,
in_app_purchase
).I'd need to look at the logic again, but I think it would be plausible to have a pubspec.yaml entry in the platform section that would allow opting into a shared directory instead of the currently hard-code
ios
ormacos
. If it's not too much complexity, I think the maintenance benefits for plugins would be worth the effort.See also #114179
(/cc @jmagman for thoughts)
The text was updated successfully, but these errors were encountered: