Commit e504dabd authored by Ian Hickson's avatar Ian Hickson Committed by GitHub

Minor style tweaks (#9766)

parent ba4bba74
...@@ -49,10 +49,11 @@ class IOSDevice extends Device { ...@@ -49,10 +49,11 @@ class IOSDevice extends Device {
_loggerPath = _checkForCommand('idevicesyslog'); _loggerPath = _checkForCommand('idevicesyslog');
_screenshotPath = _checkForCommand('idevicescreenshot'); _screenshotPath = _checkForCommand('idevicescreenshot');
_pusherPath = _checkForCommand( _pusherPath = _checkForCommand(
'ios-deploy', 'ios-deploy',
'To copy files to iOS devices, please install ios-deploy. To install, run:\n' 'To copy files to iOS devices, please install ios-deploy. To install, run:\n'
'brew update\n' 'brew update\n'
'brew install ios-deploy'); 'brew install ios-deploy'
);
} }
String _installerPath; String _installerPath;
...@@ -162,7 +163,7 @@ class IOSDevice extends Device { ...@@ -162,7 +163,7 @@ class IOSDevice extends Device {
final IOSApp iosApp = app; final IOSApp iosApp = app;
final Directory bundle = fs.directory(iosApp.deviceBundlePath); final Directory bundle = fs.directory(iosApp.deviceBundlePath);
if (!bundle.existsSync()) { if (!bundle.existsSync()) {
printError("Could not find application bundle at ${bundle.path}; have you run 'flutter build ios'?"); printError('Could not find application bundle at ${bundle.path}; have you run "flutter build ios"?');
return false; return false;
} }
...@@ -225,16 +226,16 @@ class IOSDevice extends Device { ...@@ -225,16 +226,16 @@ class IOSDevice extends Device {
} }
// Step 3: Attempt to install the application on the device. // Step 3: Attempt to install the application on the device.
final List<String> launchArguments = <String>["--enable-dart-profiling"]; final List<String> launchArguments = <String>['--enable-dart-profiling'];
if (debuggingOptions.startPaused) if (debuggingOptions.startPaused)
launchArguments.add("--start-paused"); launchArguments.add('--start-paused');
if (debuggingOptions.useTestFonts) if (debuggingOptions.useTestFonts)
launchArguments.add("--use-test-fonts"); launchArguments.add('--use-test-fonts');
if (debuggingOptions.debuggingEnabled) { if (debuggingOptions.debuggingEnabled) {
launchArguments.add("--enable-checked-mode"); launchArguments.add('--enable-checked-mode');
// Note: We do NOT need to set the observatory port since this is going to // Note: We do NOT need to set the observatory port since this is going to
// be setup on the device. Let it pick a port automatically. We will check // be setup on the device. Let it pick a port automatically. We will check
...@@ -266,12 +267,12 @@ class IOSDevice extends Device { ...@@ -266,12 +267,12 @@ class IOSDevice extends Device {
if (!debuggingOptions.debuggingEnabled) { if (!debuggingOptions.debuggingEnabled) {
// If debugging is not enabled, just launch the application and continue. // If debugging is not enabled, just launch the application and continue.
printTrace("Debugging is not enabled"); printTrace('Debugging is not enabled');
installationResult = await runCommandAndStreamOutput(launchCommand, trace: true); installationResult = await runCommandAndStreamOutput(launchCommand, trace: true);
} else { } else {
// Debugging is enabled, look for the observatory and diagnostic server // Debugging is enabled, look for the observatory and diagnostic server
// ports post launch. // ports post launch.
printTrace("Debugging is enabled, connecting to observatory and the diagnostic server"); printTrace('Debugging is enabled, connecting to observatory and the diagnostic server');
// TODO(danrubel): The Android device class does something similar to this code below. // TODO(danrubel): The Android device class does something similar to this code below.
// The various Device subclasses should be refactored and common code moved into the superclass. // The various Device subclasses should be refactored and common code moved into the superclass.
...@@ -294,11 +295,11 @@ class IOSDevice extends Device { ...@@ -294,11 +295,11 @@ class IOSDevice extends Device {
installationResult = result; installationResult = result;
if (result != 0) { if (result != 0) {
printTrace("Failed to launch the application on device."); printTrace('Failed to launch the application on device.');
return <Uri>[null, null]; return <Uri>[null, null];
} }
printTrace("Application launched on the device. Attempting to forward ports."); printTrace('Application launched on the device. Attempting to forward ports.');
return await Future.wait(<Future<Uri>>[forwardObsUri, forwardDiagUri]); return await Future.wait(<Future<Uri>>[forwardObsUri, forwardDiagUri]);
}).whenComplete(() { }).whenComplete(() {
observatoryDiscovery.cancel(); observatoryDiscovery.cancel();
...@@ -459,7 +460,7 @@ class _IOSDevicePortForwarder extends DevicePortForwarder { ...@@ -459,7 +460,7 @@ class _IOSDevicePortForwarder extends DevicePortForwarder {
final ForwardedPort forwardedPort = new ForwardedPort.withContext(hostPort, final ForwardedPort forwardedPort = new ForwardedPort.withContext(hostPort,
devicePort, process); devicePort, process);
printTrace("Forwarded port $forwardedPort"); printTrace('Forwarded port $forwardedPort');
_forwardedPorts.add(forwardedPort); _forwardedPorts.add(forwardedPort);
...@@ -473,14 +474,14 @@ class _IOSDevicePortForwarder extends DevicePortForwarder { ...@@ -473,14 +474,14 @@ class _IOSDevicePortForwarder extends DevicePortForwarder {
return null; return null;
} }
printTrace("Unforwarding port $forwardedPort"); printTrace('Unforwarding port $forwardedPort');
final Process process = forwardedPort.context; final Process process = forwardedPort.context;
if (process != null) { if (process != null) {
processManager.killPid(process.pid); processManager.killPid(process.pid);
} else { } else {
printError("Forwarded port did not have a valid process"); printError('Forwarded port did not have a valid process');
} }
return null; return null;
......
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