Repository navigation
refactor(flutter_tools): share FlutterCommand options and OptionBundles - #194356
Merged
Merged
Conversation
…OptionDescriptor Delegates the remaining shared `FlutterCommand` `uses*` / `add*` helpers and internal `boolArg` / `stringArg` / `stringsArg` lookups to typed `OptionDescriptor` instances and reusable `OptionBundle` classes (`DeviceDiscoveryOptionsBundle`, `FilesystemOptionsBundle`, `VmServicePortOptionsBundle`, `DdsAndDevToolsOptionsBundle`, `ResidentCompilerOptionsBundle`, and `EngineRenderingFlagsBundle`), and enhances `BuildModeOptionsBundle` (`defaultToRelease`, `excludeDebug`, `excludeRelease`). Part of flutter#194338
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors command-line option definitions and parsing in flutter_tools by migrating raw option configurations to structured option descriptors and bundles, such as BuildModeOptionsBundle and DeviceDiscoveryOptionsBundle. Feedback on the changes suggests adding an assertion to BuildModeOptionsBundle to prevent configuring an invalid state where the default build mode is excluded.
This was referenced Oct 14, 2026
Merged
harryterkelsen
previously requested changes
Oct 14, 2026
kevmoo
dismissed
harryterkelsen’s stale review
October 14, 2026 21:12
Addressed in 7bf51d0 (delegated FlutterCommand helpers to OptionBundle.register); re-requesting review from @harryterkelsen.
bkonyi
approved these changes
Oct 14, 2026
bkonyi
left a comment
Contributor
There was a problem hiding this comment.
LGTM overall! Just a couple of small nits.
kevmoo
added a commit
to kevmoo/flutter
that referenced
this pull request
Oct 14, 2026
…oolContext + addAll)
17 of 19 tasks
This was referenced Oct 15, 2026
dbebawy
pushed a commit
to dbebawy/flutter
that referenced
this pull request
Oct 15, 2026
…lutter#194358) Migrates `flutter assemble` CLI options to declarative option descriptors and shared bundles introduced in flutter#194356, replacing untyped string-keyed argument lookups with typed descriptor reads. Also addresses two follow-up cleanup nits from flutter#194356 (`FakeToolContext` + `testWithoutContext` in `option_descriptor_test.dart`, and `dartDefineConfigJsonMap.addAll(...)` in `flutter_command.dart`). Part of flutter#194338 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing.
auto-submit Bot
pushed a commit
to flutter/packages
that referenced
this pull request
Oct 15, 2026
flutter/flutter@426be96...5c7e45a 2026-10-15 [email protected] [web_paragraph] Honor TextHeightBehavior.leadingDistribution and default to proportional (flutter/flutter#193736) 2026-10-15 [email protected] Roll Skia from 79a00d7c4898 to d131b7789482 (2 revisions) (flutter/flutter#194446) 2026-10-15 [email protected] Roll Dart SDK from b8ffa9233096 to 84686ea04815 (1 revision) (flutter/flutter#194442) 2026-10-15 [email protected] Roll Dart SDK from e81af2dac9d1 to b8ffa9233096 (1 revision) (flutter/flutter#194432) 2026-10-15 [email protected] Roll Skia from ef24b8f87a2a to 79a00d7c4898 (4 revisions) (flutter/flutter#194431) 2026-10-15 [email protected] Roll Skia from 48c51004ee4e to ef24b8f87a2a (1 revision) (flutter/flutter#194427) 2026-10-15 [email protected] Roll Dart SDK from 6b50116630d0 to e81af2dac9d1 (5 revisions) (flutter/flutter#194422) 2026-10-15 [email protected] Roll Skia from b1be97266d3a to 48c51004ee4e (10 revisions) (flutter/flutter#194421) 2026-10-15 [email protected] RawAutocomplete: Fix focusNode listener mismatch in didUpdateWidget/dispose (flutter/flutter#190686) 2026-10-14 [email protected] [flutter_tools] Wait for iOS simulator log stream before launch (flutter/flutter#193142) 2026-10-14 [email protected] Move Material/Cupertino PRs from design triage to framework triage (flutter/flutter#194244) 2026-10-14 [email protected] refactor(flutter_tools): share FlutterCommand options and OptionBundles (flutter/flutter#194356) 2026-10-14 [email protected] Roll pub packages (flutter/flutter#194413) 2026-10-14 [email protected] Add ContextMenuButtonKind (flutter/flutter#193528) 2026-10-14 [email protected] Split SwiftPM plugin into multiple products (flutter/flutter#193521) 2026-10-14 [email protected] Roll Skia from 43d707a3be0e to b1be97266d3a (8 revisions) (flutter/flutter#194392) 2026-10-14 [email protected] Roll pub packages (flutter/flutter#194398) 2026-10-14 [email protected] [flutter_tools] Migrate AndroidSdk and AndroidStudio away from globals (flutter/flutter#193650) 2026-10-14 [email protected] [flutter_tools] Reload widget-preview when data assets change (flutter/flutter#193437) 2026-10-14 [email protected] [flutter tool] suppress sub-tool analytics during first run (flutter/flutter#194320) 2026-10-14 [email protected] Roll Skia from acde3755d2e2 to 43d707a3be0e (1 revision) (flutter/flutter#194385) 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
jmagman
pushed a commit
to jmagman/flutter
that referenced
this pull request
Oct 15, 2026
…d OptionBundle (flutter#194359) Migrates `flutter attach` to the shared option bundles and typed option descriptors introduced in flutter#194356, replacing imperative flag registration and untyped argument lookups. Part of flutter#194338 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing.
Renzo-Olivares
pushed a commit
to Renzo-Olivares/flutter
that referenced
this pull request
Oct 15, 2026
…on (flutter#194360) Completes the `flutter drive` migration to typed option descriptors and shared option definitions from flutter#194356, removing the last untyped argument lookups in `drive.dart`. Part of flutter#194338 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing.
opensource-fork-sync Bot
pushed a commit
to cla7aye15I4nd/opensource-flutter__flutter
that referenced
this pull request
Oct 16, 2026
…onBundle migration (flutter#194361) Completes the `flutter test` migration to the shared option bundles and web/debugging descriptors from flutter#194356, removing the remaining imperative option helpers and untyped argument lookups. Part of flutter#194338 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing.
ditman
pushed a commit
to ditman/flutter-flutter
that referenced
this pull request
Oct 16, 2026
…ionDescriptor and OptionBundle (flutter#194362) Migrates `flutter run` to the shared option bundles and typed option descriptors introduced in flutter#194356, replacing imperative flag setup and untyped argument reads. Part of flutter#194338 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing.
suryaKommana2662
pushed a commit
to suryaKommana2662/flutter
that referenced
this pull request
Oct 29, 2026
…es (flutter#194356) Moves the remaining shared CLI options on `FlutterCommand` into declarative option descriptors and bundles, and replaces untyped argument lookups in the command runner with typed descriptor reads. - **Shared option bundles for leaf commands**: Groups common CLI flags—device discovery, VM service/DevTools ports, filesystem overrides, resident compiler settings, engine rendering flags, and build mode configuration—into reusable bundles. This sets the stage for follow-up PRs migrating `assemble` (flutter#194358), `attach` (flutter#194359), `drive` (flutter#194360), `test` (flutter#194361), and `run` (flutter#194362). - **Deduplicated build flags**: Consolidates duplicate definitions and drifted help text for `--config-only`, `--target-platform` (`build apk`, `build aar`, `build appbundle`), `--static` (`build ios-framework`, `build macos-framework`, `build swift-package`), and `--performance-measurement-file`. Part of flutter#194338 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing.
suryaKommana2662
pushed a commit
to suryaKommana2662/flutter
that referenced
this pull request
Oct 29, 2026
…lutter#194358) Migrates `flutter assemble` CLI options to declarative option descriptors and shared bundles introduced in flutter#194356, replacing untyped string-keyed argument lookups with typed descriptor reads. Also addresses two follow-up cleanup nits from flutter#194356 (`FakeToolContext` + `testWithoutContext` in `option_descriptor_test.dart`, and `dartDefineConfigJsonMap.addAll(...)` in `flutter_command.dart`). Part of flutter#194338 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing.
suryaKommana2662
pushed a commit
to suryaKommana2662/flutter
that referenced
this pull request
Oct 29, 2026
…d OptionBundle (flutter#194359) Migrates `flutter attach` to the shared option bundles and typed option descriptors introduced in flutter#194356, replacing imperative flag registration and untyped argument lookups. Part of flutter#194338 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing.
suryaKommana2662
pushed a commit
to suryaKommana2662/flutter
that referenced
this pull request
Oct 29, 2026
…on (flutter#194360) Completes the `flutter drive` migration to typed option descriptors and shared option definitions from flutter#194356, removing the last untyped argument lookups in `drive.dart`. Part of flutter#194338 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing.
suryaKommana2662
pushed a commit
to suryaKommana2662/flutter
that referenced
this pull request
Oct 29, 2026
…onBundle migration (flutter#194361) Completes the `flutter test` migration to the shared option bundles and web/debugging descriptors from flutter#194356, removing the remaining imperative option helpers and untyped argument lookups. Part of flutter#194338 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing.
suryaKommana2662
pushed a commit
to suryaKommana2662/flutter
that referenced
this pull request
Oct 29, 2026
…ionDescriptor and OptionBundle (flutter#194362) Migrates `flutter run` to the shared option bundles and typed option descriptors introduced in flutter#194356, replacing imperative flag setup and untyped argument reads. Part of flutter#194338 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing.
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.
Moves the remaining shared CLI options on
FlutterCommandinto declarative option descriptors and bundles, and replaces untyped argument lookups in the command runner with typed descriptor reads.assemble(refactor(flutter_tools): migrate AssembleCommand to OptionDescriptor #194358),attach(refactor(flutter_tools): migrate AttachCommand to OptionDescriptor and OptionBundle #194359),drive(refactor(flutter_tools): finish DriveCommand OptionDescriptor migration #194360),test(refactor(flutter_tools): finish TestCommand OptionDescriptor and OptionBundle migration #194361), andrun(refactor(flutter_tools): migrate RunCommand and RunCommandBase to OptionDescriptor and OptionBundle #194362).--config-only,--target-platform(build apk,build aar,build appbundle),--static(build ios-framework,build macos-framework,build swift-package), and--performance-measurement-file.Part of #194338
Pre-launch Checklist
///).