Skip to content

Conversation

@hig-dev
Copy link

@hig-dev hig-dev commented Jul 1, 2025

In the latest stable release version of Flutter dev_dependencies are excluded from release builds. This leads to the issues #170119 and #167377. The PR #171015 fixed this issues only for iOS and macOS build by going a step backward. The PR changed the behavior to always include the dev_dependencies even in release build. This has the downside that the release build gets bigger again and maybe it could lead to other problems as well. So, in general it is desireable to strip out the dev_dependencies in release builds. However, there are scenarios like integration testing in which you want to have a release build including dev_dependencies.

So my PR adds the build option --force-include-dev-dependencies that ensures that the dev_dependencies are included in all build modes.

I would prefer this PR over #171015 because it does not go a step backward and solves the same issues. This PR is not a breaking change.

Example usage:

flutter build ios integration_test/foo_test.dart --release --force-include-dev-dependencies

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@hig-dev hig-dev requested review from a team as code owners July 1, 2025 14:37
@github-actions github-actions bot added tool Affects the "flutter" command-line tool. See also t: labels. team-android Owned by Android platform team team-ios Owned by iOS platform team labels Jul 1, 2025
@github-actions github-actions bot added a: tests "flutter test", flutter_test, or one of our tests framework flutter/packages/flutter repository. See also f: labels. f: integration_test The flutter/packages/integration_test plugin labels Jul 1, 2025
@reidbaker
Copy link
Contributor

Thank you for your contribution. I'm really glad you're excited about Flutter!
There is a way to have dependencies show up in builds that is "dependencies" dev-dependencies are intentionally scoped to not be included. Expanding access or building a second way of controlling dependency availability is not in line with the technical direction we want to go.

@vashworth
Copy link
Contributor

The PR #171015 fixed this issues only for iOS and macOS build by going a step backward. The PR changed the behavior to always include the dev_dependencies even in release build. This has the downside that the release build gets bigger again and maybe it could lead to other problems as well. So, in general it is desireable to strip out the dev_dependencies in release builds.

For future reference, excluding dev_dependencies was never fully implemented for iOS/macOS. They were still being included in the bundle, even before #171015. They just weren't being imported into the project.

I added a note to our tracking issue (#163874), with what I believe the intention of this PR was. @hig-dev Feel free to comment on #163874 with your feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: tests "flutter test", flutter_test, or one of our tests f: integration_test The flutter/packages/integration_test plugin framework flutter/packages/flutter repository. See also f: labels. team-android Owned by Android platform team team-ios Owned by iOS platform team tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants