Skip to content

feat(flutter_tools): migrate Desktop build commands to typed options - #193323

Merged
auto-submit[bot] merged 4 commits into
flutter:masterfrom
kevmoo:pr7-desktop-build-options
Oct 8, 2026
Merged

auto-submit[bot] merged 4 commits into
flutter:masterfrom
kevmoo:pr7-desktop-build-options

Conversation

@kevmoo

@kevmoo kevmoo commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Migrate BuildLinuxCommand (build linux) and BuildWindowsCommand (build windows) to typed OptionDescriptors and OptionBundles (following #191018, #191510, #191760, #192307, #192455, #192524, and #192818):

  • Add DesktopBuildOptionsBundle in common_options.dart, encapsulating CommonBuildOptionsBundle, BuildModeOptionsBundle, DartCompileOptionsBundle, BuildInfoOptions.flavor, splitDebugInfo, obfuscate, extraFrontEndOptions, extraGenSnapshotOptions, performanceMeasurementFile, analyzeSize, codeSizeDirectory, trackWidgetCreation, and configOnly.
  • Migrate BuildLinuxCommand (build_linux.dart) to DesktopBuildOptionsBundle, DefaultedEnumOptionDescriptor<TargetPlatform> (_targetPlatformOption), and DefaultedStringOptionDescriptor (_targetSysroot), replacing untyped boolArg('config-only'), stringArg('target-platform')!, and stringArg('target-sysroot')! queries.
  • Migrate BuildWindowsCommand (build_windows.dart) to DesktopBuildOptionsBundle and getValue(DesktopBuildOptionsBundle.configOnly).
  • Delete the obsolete FlutterCommand.addCommonDesktopBuildOptions helper method from flutter_command.dart (no remaining callers in flutter_tools).

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.

Migrate `BuildLinuxCommand` (`build linux`) and `BuildWindowsCommand`
(`build windows`) to typed `OptionDescriptor`s and `OptionBundle`s:

- Add `DesktopBuildOptionsBundle` in `common_options.dart` (encapsulating
  `CommonBuildOptionsBundle`, `BuildModeOptionsBundle`, `DartCompileOptionsBundle`,
  `BuildInfoOptions.flavor`, `splitDebugInfo`, `obfuscate`, `extraFrontEndOptions`,
  `extraGenSnapshotOptions`, `performanceMeasurementFile`, `analyzeSize`,
  `codeSizeDirectory`, `trackWidgetCreation`, and `configOnly`).
- Migrate `BuildLinuxCommand` to `DesktopBuildOptionsBundle`,
  `DefaultedEnumOptionDescriptor<TargetPlatform>` (`_targetPlatformOption`),
  and `DefaultedStringOptionDescriptor` (`_targetSysroot`).
- Migrate `BuildWindowsCommand` to `DesktopBuildOptionsBundle`.
- Remove obsolete `FlutterCommand.addCommonDesktopBuildOptions`.
@github-actions github-actions Bot added tool Affects the "flutter" command-line tool. See also t: labels. team-windows Owned by the Windows platform team team-linux Owned by the Linux platform team labels Sep 25, 2026
@kevmoo
kevmoo marked this pull request as ready for review September 25, 2026 04:02
@kevmoo
kevmoo requested review from a team as code owners September 25, 2026 04:02

@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 the desktop build commands for Linux and Windows to use the new DesktopBuildOptionsBundle for registering common build options, removing the deprecated addCommonDesktopBuildOptions helper. Feedback suggests refactoring the _targetPlatformOption in BuildLinuxCommand from a static factory method to a late final instance field to avoid recreating the descriptor when retrieving its value.

Comment thread packages/flutter_tools/lib/src/commands/build_linux.dart Outdated
Comment thread packages/flutter_tools/lib/src/commands/build_linux.dart Outdated
@kevmoo kevmoo added the CICD Run CI/CD label Sep 26, 2026
@kevmoo
kevmoo requested a review from bkonyi October 7, 2026 23:31
@kevmoo kevmoo added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 8, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Oct 8, 2026
Merged via the queue into flutter:master with commit 21d8093 Oct 8, 2026
23 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 8, 2026
@kevmoo
kevmoo deleted the pr7-desktop-build-options branch October 8, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD team-linux Owned by the Linux platform team team-windows Owned by the Windows 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.

2 participants