-
Notifications
You must be signed in to change notification settings - Fork 27.1k
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
Do not create plugins from dev_dependencies #56591
Comments
I think, ideally, it would be possible to include or not include a plugin based on a build flag or somesuch. for integration_test (formerly known as e2e), we need some way to include the plugin in builds that need it, and strip it out for builds that do not. |
IOW, it seems like it'd be very nice if the tool could do something like this: if a plugin is in dev_dependencies, ignore it unless building for a test target (do not add it to any generated files for "regular" builds). We'd need some meaningful way to discriminate between test builds and non. |
It's very similar, although I guess this one is proposing a specific solution to it that's a bit different from what I'm suggesting. |
yeah, that can be added to
That probably requires generating a new plugin registrant based on which target the user is running. In Objective-C you could use compile-time constants passed to Xcode, right @jmagman ? |
When do we re-generate the GeneratedPluginRegistrant code? |
pub get, currently |
flutter/packages/flutter_tools/lib/src/plugins.dart Lines 1172 to 1183 in bb29c88
Why would the native-side app ever need to register dev_dependencies? |
Because for integration_test, it has to report test results up to the native side test harness - e.g. to XCTest or JUnit. |
Then shouldn't the test target be handling the registration? |
I guess that makes sense, then we would just need to exclude it from the generated plugin registrant |
With the addition of integration_test in every pubspec this opts every app into a dependency on CocoaPods. |
Raising priority on this. |
I filed #74274 separately in case there's an |
@jonahwilliams any progress on this issue? The change below is affected by this issue: |
Currently the flutter tool creates a plugin for all package dependencies, even though in the dev_dependencies section. We'd like to remove this behavior, since it can lead to plugins used for testing accidentally getting included in released builds. This will be a breaking change, so we can proceed in several steps.
Compute both the current and dependencies-only plugin list and use the current strategy. If discrepancies are found, print a warning that this will be disabled in a future release and how to fix.
Compute both the current and dependencies-only plugin list and use the dependencies only strategy. If discrepancies are found, print a warning/notification that certain plugins have been disabled and include how to fix.
Remove the current strategy, remove the warning.
The text was updated successfully, but these errors were encountered: