Repository navigation
[flutter_tools] Migrate BuildBundleCommand to modular dependency injection - #192462
Merged
auto-submit[bot] merged 9 commits intoSep 15, 2026
Merged
Conversation
…ction Migrate `BuildBundleCommand` to modular dependency injection, removing ambient globals from `build_bundle.dart` and moving tests to hermetic `testWithoutContext`.
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors BuildBundleCommand to inject dependencies such as BuildSystem, FeatureFlags, and ToolContext instead of relying on global context. It also migrates the bundle build tests to a hermetic setup using testWithoutContext and deletes the old context-based test file. Feedback on the changes suggests extracting duplicated FeatureFlags lookup logic in FlutterCommand into a private helper getter to improve maintainability, and removing a redundant @visibleForTesting annotation in the test's FakeBundleBuilder to align with the base class.
chingjun
previously approved these changes
Sep 11, 2026
dcharkes
approved these changes
Sep 15, 2026
dcharkes
left a comment
Contributor
There was a problem hiding this comment.
approving after merge and format
This was referenced Sep 16, 2026
auto-submit Bot
pushed a commit
to flutter/packages
that referenced
this pull request
Sep 17, 2026
…12890) Manual roll requested by [email protected] flutter/flutter@27fec0e...8737f11 2026-09-15 [email protected] [flutter_tools] Migrate BuildBundleCommand to modular dependency injection (flutter/flutter#192462) 2026-09-15 [email protected] Migrate SDK constraints for record_use and data_asset integration test packages to ^3.13.0-0 (flutter/flutter#192728) 2026-09-15 [email protected] [tool] Defer app.restart until the app has finished starting (flutter/flutter#192650) 2026-09-15 [email protected] Suggest the -d flag after interactive device selection (flutter/flutter#188941) 2026-09-15 [email protected] Roll Packages from 9caa77c to bebbb57 (9 revisions) (flutter/flutter#192809) 2026-09-15 [email protected] Add a compiler warning for fragment shaders containing both texture samplers and early returns. (flutter/flutter#191969) 2026-09-15 [email protected] feat(flutter_tools): migrate Android build commands to typed options (flutter/flutter#192524) 2026-09-15 [email protected] Roll Fuchsia Linux SDK from 7R1l5MhSZZUr1Q6D1... to XCxrICzX1DWvyfqhA... (flutter/flutter#192789) 2026-09-15 [email protected] Roll Dart SDK from 7253dff72c96 to c870e8afe036 (1 revision) (flutter/flutter#192791) If this roll has caused a breakage, revert this CL and set the roller to dry run mode using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
flutter-zl
pushed a commit
to flutter-zl/flutter
that referenced
this pull request
Sep 29, 2026
…ncy injection (flutter#190783) ## Summary Part 17 of the modular dependency injection migration. > [!NOTE] > Stacked on [flutter#192462](flutter#192462) (`di/17a-build-bundle-command`), which migrated `BuildBundleCommand` to modular DI. * Migrates Web build subcommand and toolchain components to modular constructor dependency injection: - `BuildWebCommand({required BuildSystem buildSystem, required FeatureFlags featureFlags, required ToolContext toolContext, required super.verboseHelp, BuildTargets buildTargets = const BuildTargetsImpl(), WebBuilder? webBuilder})` * Passes `ToolContext` directly to subcommands, eliminating `context.get` fallbacks in `BuildCommand` and `WebBuilder`. * Injects `FileSystem` into `defaultDepfilePath` and `getAssetBuildDirectory`. * Migrates unit tests in `test/commands.shard/hermetic/build_web_test.dart` to hermetic `testWithoutContext`. Part of flutter#188471
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR splits
BuildBundleCommandmigration out of #190783 (part of modular dependency injection migration in flutter_tools).BuildBundleCommandto modular dependency injection withBuildSystem,FeatureFlags, andToolContext.FeatureFlags? featureFlagsonFlutterCommandRunner.FlutterCommand.targetFileto usetoolContext?.fs.build_bundle_test.dartfrom permeable context tests to hermetictestWithoutContexttests.