[flutter tools] Change the desktop device names and IDs (#58812)

In google3, the Linux device is always available, and it has confused
people who run the Flutter doctor and see
"• Linux • Linux • linux-x64 • Linux" listed.

Rename the Linux device name to "Linux desktop" and the device ID to
be "linux". Make similar changes to the Windows and macOS
devices for consistency.  This is also  consistent with the web
devices.

The device ID change shouldn't be break -d usage since that does a
case-insensitive prefix match.
This commit is contained in:
James D. Lin 2020-06-18 15:30:00 -07:00 committed by GitHub
parent e72d26a720
commit bdbe6774a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 9 additions and 9 deletions

View File

@ -17,7 +17,7 @@ import 'linux_workflow.dart';
/// A device that represents a desktop Linux target.
class LinuxDevice extends DesktopDevice {
LinuxDevice() : super(
'Linux',
'linux',
platformType: PlatformType.linux,
ephemeral: false,
);
@ -26,7 +26,7 @@ class LinuxDevice extends DesktopDevice {
bool isSupported() => true;
@override
String get name => 'Linux';
String get name => 'Linux desktop';
@override
Future<TargetPlatform> get targetPlatform async => TargetPlatform.linux_x64;

View File

@ -15,7 +15,7 @@ import 'macos_workflow.dart';
/// A device that represents a desktop MacOS target.
class MacOSDevice extends DesktopDevice {
MacOSDevice() : super(
'macOS',
'macos',
platformType: PlatformType.macos,
ephemeral: false,
);
@ -24,7 +24,7 @@ class MacOSDevice extends DesktopDevice {
bool isSupported() => true;
@override
String get name => 'macOS';
String get name => 'macOS desktop';
@override
Future<TargetPlatform> get targetPlatform async => TargetPlatform.darwin_x64;

View File

@ -18,7 +18,7 @@ import 'windows_workflow.dart';
/// A device that represents a desktop Windows target.
class WindowsDevice extends DesktopDevice {
WindowsDevice() : super(
'Windows',
'windows',
platformType: PlatformType.windows,
ephemeral: false,
);
@ -27,7 +27,7 @@ class WindowsDevice extends DesktopDevice {
bool isSupported() => true;
@override
String get name => 'Windows';
String get name => 'Windows desktop';
@override
Future<TargetPlatform> get targetPlatform async => TargetPlatform.windows_x64;

View File

@ -28,7 +28,7 @@ void main() {
testWithoutContext('LinuxDevice defaults', () async {
final PrebuiltLinuxApp linuxApp = PrebuiltLinuxApp(executable: 'foo');
expect(await device.targetPlatform, TargetPlatform.linux_x64);
expect(device.name, 'Linux');
expect(device.name, 'Linux desktop');
expect(await device.installApp(linuxApp), true);
expect(await device.uninstallApp(linuxApp), true);
expect(await device.isLatestBuildInstalled(linuxApp), true);

View File

@ -40,7 +40,7 @@ void main() {
testUsingContext('defaults', () async {
final MockMacOSApp mockMacOSApp = MockMacOSApp();
expect(await device.targetPlatform, TargetPlatform.darwin_x64);
expect(device.name, 'macOS');
expect(device.name, 'macOS desktop');
expect(await device.installApp(mockMacOSApp), true);
expect(await device.uninstallApp(mockMacOSApp), true);
expect(await device.isLatestBuildInstalled(mockMacOSApp), true);

View File

@ -32,7 +32,7 @@ void main() {
testUsingContext('defaults', () async {
final PrebuiltWindowsApp windowsApp = PrebuiltWindowsApp(executable: 'foo');
expect(await device.targetPlatform, TargetPlatform.windows_x64);
expect(device.name, 'Windows');
expect(device.name, 'Windows desktop');
expect(await device.installApp(windowsApp), true);
expect(await device.uninstallApp(windowsApp), true);
expect(await device.isLatestBuildInstalled(windowsApp), true);