Revert "[flutter_tools] show web-server in flutter devices"
This commit is contained in:
committed by
GitHub
parent
fd65fd1b16
commit
5c334d10df
@@ -18,6 +18,7 @@ import '../cache.dart';
|
||||
import '../convert.dart';
|
||||
import '../globals.dart' as globals;
|
||||
import '../tester/flutter_tester.dart';
|
||||
import '../web/web_device.dart';
|
||||
|
||||
class FlutterCommandRunner extends CommandRunner<void> {
|
||||
FlutterCommandRunner({ bool verboseHelp = false }) : super(
|
||||
@@ -111,6 +112,11 @@ class FlutterCommandRunner extends CommandRunner<void> {
|
||||
hide: !verboseHelp,
|
||||
help: 'List the special "flutter-tester" device in device listings. '
|
||||
'This headless device is used to test Flutter tooling.');
|
||||
argParser.addFlag('show-web-server-device',
|
||||
negatable: false,
|
||||
hide: !verboseHelp,
|
||||
help: 'List the special "web-server" device in device listings.',
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -209,6 +215,10 @@ class FlutterCommandRunner extends CommandRunner<void> {
|
||||
|| topLevelResults['device-id'] == FlutterTesterDevices.kTesterDeviceId) {
|
||||
FlutterTesterDevices.showFlutterTesterDevice = true;
|
||||
}
|
||||
if (((topLevelResults['show-web-server-device'] as bool?) ?? false)
|
||||
|| topLevelResults['device-id'] == WebServerDevice.kWebServerDeviceId) {
|
||||
WebServerDevice.showWebServerDevice = true;
|
||||
}
|
||||
|
||||
// Set up the tooling configuration.
|
||||
final EngineBuildPaths? engineBuildPaths = await globals.localEngineLocator?.findEnginePath(
|
||||
|
||||
@@ -111,7 +111,7 @@ abstract class ChromiumDevice extends Device {
|
||||
Future<String?> get emulatorId async => null;
|
||||
|
||||
@override
|
||||
bool isSupported() => chromeLauncher.canFindExecutable();
|
||||
bool isSupported() => chromeLauncher.canFindExecutable();
|
||||
|
||||
@override
|
||||
DevicePortForwarder? get portForwarder => const NoOpDevicePortForwarder();
|
||||
@@ -357,7 +357,8 @@ class WebDevices extends PollingDeviceDiscovery {
|
||||
}
|
||||
final MicrosoftEdgeDevice? edgeDevice = _edgeDevice;
|
||||
return <Device>[
|
||||
_webServerDevice,
|
||||
if (WebServerDevice.showWebServerDevice)
|
||||
_webServerDevice,
|
||||
if (_chromeDevice.isSupported())
|
||||
_chromeDevice,
|
||||
if (edgeDevice != null && await edgeDevice._meetsVersionConstraint())
|
||||
@@ -391,6 +392,7 @@ class WebServerDevice extends Device {
|
||||
);
|
||||
|
||||
static const String kWebServerDeviceId = 'web-server';
|
||||
static bool showWebServerDevice = false;
|
||||
|
||||
final Logger _logger;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user