From bdbe6774a39ca2204fdf04f12b8fdf7bee4b4848 Mon Sep 17 00:00:00 2001 From: "James D. Lin" Date: Thu, 18 Jun 2020 15:30:00 -0700 Subject: [PATCH] [flutter tools] Change the desktop device names and IDs (#58812) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- packages/flutter_tools/lib/src/linux/linux_device.dart | 4 ++-- packages/flutter_tools/lib/src/macos/macos_device.dart | 4 ++-- packages/flutter_tools/lib/src/windows/windows_device.dart | 4 ++-- .../test/general.shard/linux/linux_device_test.dart | 2 +- .../test/general.shard/macos/macos_device_test.dart | 2 +- .../test/general.shard/windows/windows_device_test.dart | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/flutter_tools/lib/src/linux/linux_device.dart b/packages/flutter_tools/lib/src/linux/linux_device.dart index 29d7b0a75d4..4b83156f500 100644 --- a/packages/flutter_tools/lib/src/linux/linux_device.dart +++ b/packages/flutter_tools/lib/src/linux/linux_device.dart @@ -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 get targetPlatform async => TargetPlatform.linux_x64; diff --git a/packages/flutter_tools/lib/src/macos/macos_device.dart b/packages/flutter_tools/lib/src/macos/macos_device.dart index ac224421414..1ce7df49a12 100644 --- a/packages/flutter_tools/lib/src/macos/macos_device.dart +++ b/packages/flutter_tools/lib/src/macos/macos_device.dart @@ -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 get targetPlatform async => TargetPlatform.darwin_x64; diff --git a/packages/flutter_tools/lib/src/windows/windows_device.dart b/packages/flutter_tools/lib/src/windows/windows_device.dart index 5b6ac09b626..50ebcf58dc5 100644 --- a/packages/flutter_tools/lib/src/windows/windows_device.dart +++ b/packages/flutter_tools/lib/src/windows/windows_device.dart @@ -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 get targetPlatform async => TargetPlatform.windows_x64; diff --git a/packages/flutter_tools/test/general.shard/linux/linux_device_test.dart b/packages/flutter_tools/test/general.shard/linux/linux_device_test.dart index 72ec9f7985e..c4f976a1c9c 100644 --- a/packages/flutter_tools/test/general.shard/linux/linux_device_test.dart +++ b/packages/flutter_tools/test/general.shard/linux/linux_device_test.dart @@ -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); diff --git a/packages/flutter_tools/test/general.shard/macos/macos_device_test.dart b/packages/flutter_tools/test/general.shard/macos/macos_device_test.dart index 728a596d5e7..c893914d10c 100644 --- a/packages/flutter_tools/test/general.shard/macos/macos_device_test.dart +++ b/packages/flutter_tools/test/general.shard/macos/macos_device_test.dart @@ -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); diff --git a/packages/flutter_tools/test/general.shard/windows/windows_device_test.dart b/packages/flutter_tools/test/general.shard/windows/windows_device_test.dart index 2641677df38..b8b9bb27a91 100644 --- a/packages/flutter_tools/test/general.shard/windows/windows_device_test.dart +++ b/packages/flutter_tools/test/general.shard/windows/windows_device_test.dart @@ -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);