some updates to the launch verbiage (#7236)

This commit is contained in:
Devon Carew
2016-12-12 09:31:58 -08:00
committed by GitHub
parent cffe4812b4
commit bf25b31a65
4 changed files with 18 additions and 6 deletions

View File

@@ -337,6 +337,9 @@ class AppDomain extends Domain {
throw 'unhandle build mode: $buildMode';
}
if (device.isLocalEmulator && !isEmulatorBuildMode(buildMode))
throw '${toTitleCase(getModeName(buildMode))} mode is not supported for emulators.';
// We change the current working directory for the duration of the `start` command.
Directory cwd = Directory.current;
Directory.current = new Directory(projectDirectory);

View File

@@ -171,9 +171,14 @@ class RunCommand extends RunCommandBase {
if (argResults['machine']) {
Daemon daemon = new Daemon(stdinCommandStream, stdoutCommandResponse,
notifyingLogger: new NotifyingLogger(), logToStdout: true);
AppInstance app = daemon.appDomain.startApp(
device, Directory.current.path, targetFile, route,
getBuildMode(), argResults['start-paused'], hotMode);
AppInstance app;
try {
app = daemon.appDomain.startApp(
device, Directory.current.path, targetFile, route,
getBuildMode(), argResults['start-paused'], hotMode);
} catch (error) {
throwToolExit(error.toString());
}
int result = await app.runner.waitForAppToFinish();
if (result != 0)
throwToolExit(null, exitCode: result);

View File

@@ -196,7 +196,8 @@ class HotRunner extends ResidentRunner {
await startEchoingDeviceLog(_package);
printStatus('Launching ${getDisplayPath(_mainPath)} on ${device.name}...');
String modeName = getModeName(debuggingOptions.buildMode);
printStatus('Launching ${getDisplayPath(_mainPath)} on ${device.name} in $modeName mode...');
// Start the application.
Future<LaunchResult> futureResult = device.startApp(

View File

@@ -10,6 +10,7 @@ import 'package:stack_trace/stack_trace.dart';
import 'application_package.dart';
import 'base/utils.dart';
import 'build_info.dart';
import 'commands/trace.dart';
import 'device.dart';
import 'globals.dart';
@@ -94,11 +95,13 @@ class RunAndStayResident extends ResidentRunner {
platformArgs = <String, dynamic>{ 'trace-startup': traceStartup };
await startEchoingDeviceLog(_package);
String modeName = getModeName(debuggingOptions.buildMode);
if (_mainPath == null) {
assert(prebuiltMode);
printStatus('Running ${_package.displayName} on ${device.name}');
printStatus('Launching ${_package.displayName} on ${device.name} in $modeName mode...');
} else {
printStatus('Running ${getDisplayPath(_mainPath)} on ${device.name}...');
printStatus('Launching ${getDisplayPath(_mainPath)} on ${device.name} in $modeName mode...');
}
_result = await device.startApp(