Unverified Commit bdbe6774 authored by James D. Lin's avatar James D. Lin Committed by GitHub

[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.
parent e72d26a7
...@@ -17,7 +17,7 @@ import 'linux_workflow.dart'; ...@@ -17,7 +17,7 @@ import 'linux_workflow.dart';
/// A device that represents a desktop Linux target. /// A device that represents a desktop Linux target.
class LinuxDevice extends DesktopDevice { class LinuxDevice extends DesktopDevice {
LinuxDevice() : super( LinuxDevice() : super(
'Linux', 'linux',
platformType: PlatformType.linux, platformType: PlatformType.linux,
ephemeral: false, ephemeral: false,
); );
...@@ -26,7 +26,7 @@ class LinuxDevice extends DesktopDevice { ...@@ -26,7 +26,7 @@ class LinuxDevice extends DesktopDevice {
bool isSupported() => true; bool isSupported() => true;
@override @override
String get name => 'Linux'; String get name => 'Linux desktop';
@override @override
Future<TargetPlatform> get targetPlatform async => TargetPlatform.linux_x64; Future<TargetPlatform> get targetPlatform async => TargetPlatform.linux_x64;
......
...@@ -15,7 +15,7 @@ import 'macos_workflow.dart'; ...@@ -15,7 +15,7 @@ import 'macos_workflow.dart';
/// A device that represents a desktop MacOS target. /// A device that represents a desktop MacOS target.
class MacOSDevice extends DesktopDevice { class MacOSDevice extends DesktopDevice {
MacOSDevice() : super( MacOSDevice() : super(
'macOS', 'macos',
platformType: PlatformType.macos, platformType: PlatformType.macos,
ephemeral: false, ephemeral: false,
); );
...@@ -24,7 +24,7 @@ class MacOSDevice extends DesktopDevice { ...@@ -24,7 +24,7 @@ class MacOSDevice extends DesktopDevice {
bool isSupported() => true; bool isSupported() => true;
@override @override
String get name => 'macOS'; String get name => 'macOS desktop';
@override @override
Future<TargetPlatform> get targetPlatform async => TargetPlatform.darwin_x64; Future<TargetPlatform> get targetPlatform async => TargetPlatform.darwin_x64;
......
...@@ -18,7 +18,7 @@ import 'windows_workflow.dart'; ...@@ -18,7 +18,7 @@ import 'windows_workflow.dart';
/// A device that represents a desktop Windows target. /// A device that represents a desktop Windows target.
class WindowsDevice extends DesktopDevice { class WindowsDevice extends DesktopDevice {
WindowsDevice() : super( WindowsDevice() : super(
'Windows', 'windows',
platformType: PlatformType.windows, platformType: PlatformType.windows,
ephemeral: false, ephemeral: false,
); );
...@@ -27,7 +27,7 @@ class WindowsDevice extends DesktopDevice { ...@@ -27,7 +27,7 @@ class WindowsDevice extends DesktopDevice {
bool isSupported() => true; bool isSupported() => true;
@override @override
String get name => 'Windows'; String get name => 'Windows desktop';
@override @override
Future<TargetPlatform> get targetPlatform async => TargetPlatform.windows_x64; Future<TargetPlatform> get targetPlatform async => TargetPlatform.windows_x64;
......
...@@ -28,7 +28,7 @@ void main() { ...@@ -28,7 +28,7 @@ void main() {
testWithoutContext('LinuxDevice defaults', () async { testWithoutContext('LinuxDevice defaults', () async {
final PrebuiltLinuxApp linuxApp = PrebuiltLinuxApp(executable: 'foo'); final PrebuiltLinuxApp linuxApp = PrebuiltLinuxApp(executable: 'foo');
expect(await device.targetPlatform, TargetPlatform.linux_x64); 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.installApp(linuxApp), true);
expect(await device.uninstallApp(linuxApp), true); expect(await device.uninstallApp(linuxApp), true);
expect(await device.isLatestBuildInstalled(linuxApp), true); expect(await device.isLatestBuildInstalled(linuxApp), true);
......
...@@ -40,7 +40,7 @@ void main() { ...@@ -40,7 +40,7 @@ void main() {
testUsingContext('defaults', () async { testUsingContext('defaults', () async {
final MockMacOSApp mockMacOSApp = MockMacOSApp(); final MockMacOSApp mockMacOSApp = MockMacOSApp();
expect(await device.targetPlatform, TargetPlatform.darwin_x64); 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.installApp(mockMacOSApp), true);
expect(await device.uninstallApp(mockMacOSApp), true); expect(await device.uninstallApp(mockMacOSApp), true);
expect(await device.isLatestBuildInstalled(mockMacOSApp), true); expect(await device.isLatestBuildInstalled(mockMacOSApp), true);
......
...@@ -32,7 +32,7 @@ void main() { ...@@ -32,7 +32,7 @@ void main() {
testUsingContext('defaults', () async { testUsingContext('defaults', () async {
final PrebuiltWindowsApp windowsApp = PrebuiltWindowsApp(executable: 'foo'); final PrebuiltWindowsApp windowsApp = PrebuiltWindowsApp(executable: 'foo');
expect(await device.targetPlatform, TargetPlatform.windows_x64); 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.installApp(windowsApp), true);
expect(await device.uninstallApp(windowsApp), true); expect(await device.uninstallApp(windowsApp), true);
expect(await device.isLatestBuildInstalled(windowsApp), true); expect(await device.isLatestBuildInstalled(windowsApp), true);
......
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