From b474557ef464f23703674d291d7203348f371758 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Fri, 16 Jun 2017 11:20:23 -0700 Subject: [PATCH] Eliminate unnecessary public getters for iOS tools (#10784) None of these is used outside of devices.dart and being public covers up analysis warnings when they're unused. --- .../flutter_tools/lib/src/ios/devices.dart | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/packages/flutter_tools/lib/src/ios/devices.dart b/packages/flutter_tools/lib/src/ios/devices.dart index 1ee7290083..106174ce09 100644 --- a/packages/flutter_tools/lib/src/ios/devices.dart +++ b/packages/flutter_tools/lib/src/ios/devices.dart @@ -54,19 +54,10 @@ class IOSDevice extends Device { } String _installerPath; - String get installerPath => _installerPath; - String _iproxyPath; - String get iproxyPath => _iproxyPath; - String _loggerPath; - String get loggerPath => _loggerPath; - String _screenshotPath; - String get screenshotPath => _screenshotPath; - String _pusherPath; - String get pusherPath => _pusherPath; @override bool get supportsHotMode => true; @@ -116,7 +107,7 @@ class IOSDevice extends Device { @override Future isAppInstalled(ApplicationPackage app) async { try { - final RunResult apps = await runCheckedAsync([installerPath, '--list-apps']); + final RunResult apps = await runCheckedAsync([_installerPath, '--list-apps']); if (new RegExp(app.id, multiLine: true).hasMatch(apps.stdout)) { return true; } @@ -139,7 +130,7 @@ class IOSDevice extends Device { } try { - await runCheckedAsync([installerPath, '-i', iosApp.deviceBundlePath]); + await runCheckedAsync([_installerPath, '-i', iosApp.deviceBundlePath]); return true; } catch (e) { return false; @@ -149,7 +140,7 @@ class IOSDevice extends Device { @override Future uninstallApp(ApplicationPackage app) async { try { - await runCheckedAsync([installerPath, '-U', app.id]); + await runCheckedAsync([_installerPath, '-U', app.id]); return true; } catch (e) { return false; @@ -304,7 +295,7 @@ class IOSDevice extends Device { Future pushFile(ApplicationPackage app, String localFile, String targetFile) async { if (platform.isMacOS) { runSync([ - pusherPath, + _pusherPath, '-t', '1', '--bundle_id', @@ -344,11 +335,11 @@ class IOSDevice extends Device { } @override - bool get supportsScreenshot => screenshotPath != null && screenshotPath.isNotEmpty; + bool get supportsScreenshot => _screenshotPath != null && _screenshotPath.isNotEmpty; @override Future takeScreenshot(File outputFile) { - return runCheckedAsync([screenshotPath, outputFile.path]); + return runCheckedAsync([_screenshotPath, outputFile.path]); } } @@ -381,7 +372,7 @@ class _IOSDeviceLogReader extends DeviceLogReader { String get name => device.name; void _start() { - runCommand([device.loggerPath]).then((Process process) { + runCommand([device._loggerPath]).then((Process process) { _process = process; _process.stdout.transform(UTF8.decoder).transform(const LineSplitter()).listen(_onLine); _process.stderr.transform(UTF8.decoder).transform(const LineSplitter()).listen(_onLine); @@ -425,7 +416,7 @@ class _IOSDevicePortForwarder extends DevicePortForwarder { // Usage: iproxy LOCAL_TCP_PORT DEVICE_TCP_PORT UDID final Process process = await runCommand([ - device.iproxyPath, + device._iproxyPath, hostPort.toString(), devicePort.toString(), device.id,