Visitar URL original
[tool] Migrate DoctorCommand to modular dependency injection by bkonyi · Pull Request #190758 · flutter/flutter · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
85aa4f1
[tool] Define modular dependency injection containers and bootstrapper
bkonyi Aug 11, 2026
341b711
[tool] Address review comments on modular dependency injection contai…
bkonyi Aug 11, 2026
5533bb8
[tool] Wire dependency injection into runner and executable with requ…
bkonyi Aug 11, 2026
0125d94
Merge remote-tracking branch 'origin/master' into di/02-runner-bootstrap
bkonyi Aug 12, 2026
cd90309
[tool] Address review feedback on FlutterCommandRunner dependency inj…
bkonyi Aug 12, 2026
9f24ddb
[tool] Require ToolDependencies on FlutterCommandRunner and eliminate…
bkonyi Aug 12, 2026
15d4ff6
[tool] Remove unused getters and store analytics and toolContext dire…
bkonyi Aug 12, 2026
6538999
[tool] Remove unused dart:convert import and revert doc comments in t…
bkonyi Aug 12, 2026
769f12c
[tool] Migrate CleanCommand to modular dependency injection
bkonyi Aug 11, 2026
a772f06
[tool] Migrate ConfigCommand to modular dependency injection
bkonyi Aug 11, 2026
0f80444
[tool] Migrate SymbolizeCommand to modular dependency injection
bkonyi Aug 11, 2026
ba7deb3
[tool] Migrate ChannelCommand to modular dependency injection
bkonyi Aug 11, 2026
a5003c8
[tool] Migrate DoctorCommand to modular dependency injection
bkonyi Aug 11, 2026
fdbe6df
Merge remote-tracking branch 'origin/master' into di/02-clean
bkonyi Aug 20, 2026
af1529f
[tool] Fix globals fallback in runner and signal handlers
bkonyi Aug 20, 2026
95d4d9f
[tool] Simplify analytics fallback in FlutterCommand
bkonyi Aug 20, 2026
1565433
[tool] Encapsulate global fallbacks in FlutterCommand private getters
bkonyi Aug 20, 2026
4a0e9f1
[tool] Address review feedback on CleanCommand DI migration
bkonyi Aug 20, 2026
e477529
[tool] Wire PersistentToolState into ToolContext and FlutterCommand
bkonyi Aug 20, 2026
540aa3b
[tool] Remove unnecessary toolContext == null check from refreshWirel…
bkonyi Aug 20, 2026
1d0f02f
[tool] Remove boilerplate constructor doc comments
bkonyi Aug 20, 2026
68a6474
[tool] Remove single-use local variables and cleanup setupApplication…
bkonyi Aug 20, 2026
f598a0d
[tool] Convert applicationPackages in FlutterCommand to lazy getter
bkonyi Aug 20, 2026
c15fa0f
[tool] Add TODO for ApplicationPackageFactory migration
bkonyi Aug 20, 2026
3aa3487
[tool] Fix license header placement in clean_test.dart
bkonyi Aug 20, 2026
43f55f8
[tool] Fix FakeAnalytics and tool context in BuildSwiftPackage and ar…
bkonyi Aug 20, 2026
5c2a8a1
[tool] Support nullable ToolContext on FlutterCommandRunner with glob…
bkonyi Aug 20, 2026
bb971be
[tool] Enforce required ToolContext on FlutterCommandRunner
bkonyi Aug 20, 2026
1fee3ed
Merge remote-tracking branch 'upstream/master' into di/02-clean
bkonyi Aug 21, 2026
9053eab
Merge remote-tracking branch 'upstream/master' into di/02-clean
bkonyi Aug 21, 2026
7b0c224
[tool] Fall back to globals in FlutterCommand when explicit ToolConte…
bkonyi Aug 24, 2026
adda686
Merge branch 'master' into di/02-clean
bkonyi Aug 25, 2026
4cef6eb
Merge remote-tracking branch 'upstream/master' into di/02-clean
bkonyi Aug 25, 2026
2609b90
[tool] Remove local cache variables for private getters in FlutterCom…
bkonyi Aug 25, 2026
2d2bf21
Merge remote-tracking branch 'upstream/master' into di/02-clean
bkonyi Aug 26, 2026
992756f
[tool] Support hermetic execution without ambient FeatureFlags in Flu…
bkonyi Aug 26, 2026
7354929
[tool] Eliminate context.get<FeatureFlags> from FlutterCommandRunner
bkonyi Aug 26, 2026
d8a870d
Merge branch 'di/02-clean' into di/03-config
bkonyi Aug 26, 2026
f44b1b2
Merge branch 'di/03-config' into di/04-symbolize
bkonyi Aug 26, 2026
7a2782f
[tool] Fix ConfigCommand instantiation in tool extension tests
bkonyi Aug 27, 2026
34327d5
Merge branch 'di/03-config' into di/04-symbolize
bkonyi Aug 27, 2026
0c888bf
[tool] Explicitly inject featureFlags into ConfigCommand in tool exte…
bkonyi Aug 27, 2026
13121b7
Merge branch 'di/03-config' into di/04-symbolize
bkonyi Aug 27, 2026
7e86799
Merge branch 'upstream/master' into di/03-config
bkonyi Aug 27, 2026
e0b3f24
Merge branch 'di/03-config' into di/04-symbolize
bkonyi Aug 27, 2026
c977634
[tool] Restore original description and remove redundant printUsage i…
bkonyi Aug 27, 2026
6a27261
Merge branch 'di/03-config' into di/04-symbolize
bkonyi Aug 27, 2026
508cc17
[tool] Make featureFlags required in ConfigCommand and remove _Defaul…
bkonyi Aug 27, 2026
7642ec2
Merge branch 'di/03-config' into di/04-symbolize
bkonyi Aug 27, 2026
24b7c9c
[tool] Make analytics required in ConfigCommand
bkonyi Aug 27, 2026
dbc5e92
Merge branch 'di/03-config' into di/04-symbolize
bkonyi Aug 27, 2026
be8d28d
[tool] Add analytics parameter to FlutterCommand and use super.analyt…
bkonyi Aug 27, 2026
3b37b45
Merge branch 'di/03-config' into di/04-symbolize
bkonyi Aug 27, 2026
1786481
[tool] Let FlutterCommandRunner own Analytics for FlutterCommand
bkonyi Aug 27, 2026
6d47766
Merge branch 'di/03-config' into di/04-symbolize
bkonyi Aug 27, 2026
16c0f18
[tool] Make featureFlags public in ConfigCommand
bkonyi Aug 27, 2026
b43c3e2
Merge branch 'di/03-config' into di/04-symbolize
bkonyi Aug 27, 2026
5b2972c
[tool] Store non-nullable _toolContext in ConfigCommand
bkonyi Aug 27, 2026
4f45dfb
Merge branch 'di/03-config' into di/04-symbolize
bkonyi Aug 27, 2026
caac485
[tool] Remove unused analytics parameter from createConfigCommand in …
bkonyi Aug 27, 2026
4d39d30
Merge branch 'di/03-config' into di/04-symbolize
bkonyi Aug 27, 2026
a35837d
[tool] Default createConfigCommand to test fixtures in config_test.dart
bkonyi Aug 28, 2026
eb7b9dd
Merge branch 'di/03-config' into di/04-symbolize
bkonyi Aug 28, 2026
4f0fef1
[tool] Explicitly override toolContext getter and assert injection in…
bkonyi Aug 28, 2026
82c6d03
Merge remote-tracking branch 'upstream/master' into di/04-symbolize
bkonyi Aug 28, 2026
f8daa08
Merge branch 'di/04-symbolize' into di/05-channel
bkonyi Aug 28, 2026
79e966c
Merge branch 'di/05-channel' into di/06-doctor
bkonyi Aug 28, 2026
8554b7c
[tool] Explicitly override toolContext getter and assert injection in…
bkonyi Aug 28, 2026
ef6aea3
Merge branch 'di/05-channel' into di/06-doctor
bkonyi Aug 28, 2026
618c28a
[tool] Restore precacheArtifacts documentation and use FakePlatform i…
bkonyi Aug 28, 2026
2f922e8
Merge branch 'di/05-channel' into di/06-doctor
bkonyi Aug 28, 2026
18c47bc
Merge remote-tracking branch 'upstream/master' into di/05-channel
bkonyi Aug 28, 2026
8c55dbd
Merge branch 'di/05-channel' into di/06-doctor
bkonyi Aug 28, 2026
b414cb7
Merge remote-tracking branch 'upstream/master' into di/06-doctor
bkonyi Sep 2, 2026
2cb7264
[tool] Explicitly override toolContext getter and assert injection in…
bkonyi Sep 2, 2026
65e4936
[tool] Make Doctor parameter required in DoctorCommand
bkonyi Sep 2, 2026
69f90bb
[tool] Instantiate Doctor directly in executable.dart
bkonyi Sep 2, 2026
b5ffa51
[tool] Provide shared globals.doctor instance to DoctorCommand in exe…
bkonyi Sep 2, 2026
3b1d0bc
[tool] Make DoctorCommand constructor parameters optional and resolve…
bkonyi Sep 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[tool] Make Doctor parameter required in DoctorCommand
  • Loading branch information
bkonyi committed Sep 2, 2026
commit 65e493688d66610587100e2bcd5e24423a828f2f
2 changes: 1 addition & 1 deletion packages/flutter_tools/lib/executable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ List<FlutterCommand> generateCommands({
DoctorCommand(
verbose: verbose,
toolContext: toolDependencies.toolContext,
doctor: globals.doctor,
doctor: globals.doctor!,
androidLicenseValidator: androidLicenseValidator,
extensionManager: extensionManager,
),
Expand Down
21 changes: 9 additions & 12 deletions packages/flutter_tools/lib/src/commands/doctor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import '../runner/flutter_command.dart';
class DoctorCommand extends FlutterCommand {
DoctorCommand({
required ToolContext toolContext,
Doctor? doctor,
required Doctor doctor,
AndroidLicenseValidator? androidLicenseValidator,
this.verbose = false,
this.extensionManager,
Expand All @@ -36,7 +36,7 @@ class DoctorCommand extends FlutterCommand {
}

final ToolContext _toolContext;
final Doctor? _doctor;
final Doctor _doctor;
final AndroidLicenseValidator? _androidLicenseValidator;
final bool verbose;
final ExtensionManager? extensionManager;
Expand All @@ -55,13 +55,12 @@ class DoctorCommand extends FlutterCommand {

@override
Future<FlutterCommandResult> runCommand() async {
final Doctor? doctor = _doctor;
final AndroidLicenseValidator? androidLicenseValidator = _androidLicenseValidator;

if (argResults?.wasParsed('check-for-remote-artifacts') ?? false) {
final String engineRevision = stringArg('check-for-remote-artifacts')!;
if (engineRevision.startsWith(RegExp(r'[a-f0-9]{1,40}'))) {
final bool success = await doctor?.checkRemoteArtifacts(engineRevision) ?? false;
final bool success = await _doctor.checkRemoteArtifacts(engineRevision);
if (success) {
throwToolExit(
'Artifacts for engine $engineRevision are missing or are '
Expand All @@ -76,14 +75,12 @@ class DoctorCommand extends FlutterCommand {
);
}
}
final bool success =
await doctor?.diagnose(
androidLicenses: boolArg('android-licenses'),
verbose: verbose,
androidLicenseValidator: androidLicenseValidator,
extensionManager: extensionManager,
) ??
false;
final bool success = await _doctor.diagnose(
androidLicenses: boolArg('android-licenses'),
verbose: verbose,
androidLicenseValidator: androidLicenseValidator,
extensionManager: extensionManager,
);
return FlutterCommandResult(success ? ExitStatus.success : ExitStatus.warning);
}
}