Unverified Commit c6aeaa30 authored by Hannes Winkler's avatar Hannes Winkler Committed by GitHub

fix flutter not finding custom device (#108884)

parent 1a4dcd6a
......@@ -21,6 +21,7 @@ import 'base/terminal.dart';
import 'base/user_messages.dart';
import 'base/utils.dart';
import 'cache.dart';
import 'custom_devices/custom_device_workflow.dart';
import 'device.dart';
import 'doctor_validator.dart';
import 'features.dart';
......@@ -93,6 +94,10 @@ class _DefaultDoctorValidatorsProvider implements DoctorValidatorsProvider {
featureFlags: featureFlags,
);
late final CustomDeviceWorkflow customDeviceWorkflow = CustomDeviceWorkflow(
featureFlags: featureFlags,
);
@override
List<DoctorValidator> get validators {
if (_validators != null) {
......@@ -200,6 +205,9 @@ class _DefaultDoctorValidatorsProvider implements DoctorValidatorsProvider {
_workflows!.add(webWorkflow);
}
if (customDeviceWorkflow.appliesToHostPlatform) {
_workflows!.add(customDeviceWorkflow);
}
}
return _workflows!;
}
......
......@@ -17,6 +17,7 @@ import 'package:flutter_tools/src/base/user_messages.dart';
import 'package:flutter_tools/src/build_info.dart';
import 'package:flutter_tools/src/cache.dart';
import 'package:flutter_tools/src/commands/doctor.dart';
import 'package:flutter_tools/src/custom_devices/custom_device_workflow.dart';
import 'package:flutter_tools/src/device.dart';
import 'package:flutter_tools/src/doctor.dart';
import 'package:flutter_tools/src/doctor_validator.dart';
......@@ -750,6 +751,20 @@ void main() {
ProcessManager: () => fakeProcessManager,
});
testUsingContext('CustomDevicesWorkflow is a part of validator workflows if enabled', () async {
final List<Workflow> workflows = DoctorValidatorsProvider.test(
featureFlags: TestFeatureFlags(areCustomDevicesEnabled: true),
platform: FakePlatform(),
).workflows;
expect(
workflows,
contains(isA<CustomDeviceWorkflow>()),
);
}, overrides: <Type, Generator>{
FileSystem: () => MemoryFileSystem.test(),
ProcessManager: () => fakeProcessManager,
});
testUsingContext('Fetches tags to get the right version', () async {
Cache.disableLocking();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment