Skip to content

refactor(flutter_tools): share FlutterCommand options and OptionBundles - #194356

Merged
auto-submit[bot] merged 4 commits into
flutter:masterfrom
kevmoo:phase5-spine
Oct 14, 2026
Merged

auto-submit[bot] merged 4 commits into
flutter:masterfrom
kevmoo:phase5-spine

Conversation

@kevmoo

@kevmoo kevmoo commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

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.

Part of #194338

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
  • All existing and new tests are passing.

…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
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Oct 14, 2026
@github-actions github-actions Bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Oct 14, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@kevmoo
kevmoo requested review from a team as code owners October 14, 2026 13:33
@github-actions github-actions Bot added team-ios Owned by iOS platform team team-macos Owned by the macOS platform team labels Oct 14, 2026
@kevmoo kevmoo changed the title refactor(flutter_tools): migrate shared FlutterCommand options and bundles to OptionDescriptor refactor(flutter_tools): share FlutterCommand options and OptionBundles Oct 14, 2026
@kevmoo
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.

@kevmoo
kevmoo requested a review from harryterkelsen October 14, 2026 21:12

@harryterkelsen harryterkelsen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kevmoo kevmoo added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 14, 2026
@vashworth
vashworth self-requested a review October 14, 2026 21:50
@auto-submit
auto-submit Bot added this pull request to the merge queue Oct 14, 2026

@bkonyi bkonyi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall! Just a couple of small nits.

Merged via the queue into flutter:master with commit 9301753 Oct 14, 2026
23 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 14, 2026
kevmoo added a commit to kevmoo/flutter that referenced this pull request Oct 14, 2026
@kevmoo
kevmoo deleted the phase5-spine branch October 15, 2026 16:58
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD team-ios Owned by iOS platform team team-macos Owned by the macOS 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