Commit fbe6779f authored by Matt Perry's avatar Matt Perry

Merge pull request #1539 from mpcomplete/start

'flutter start' calls 'flutter apk' if necessary.
parents ac9e016a 5d2281b6
......@@ -253,6 +253,7 @@ class AppDomain extends Domain {
command.devices,
command.applicationPackages,
command.toolchain,
command.buildConfigurations,
target: args['target'],
route: args['route'],
checked: args['checked'] ?? true
......
......@@ -41,6 +41,7 @@ class ListenCommand extends StartCommandBase {
devices,
applicationPackages,
toolchain,
buildConfigurations,
target: argResults['target'],
install: firstTime,
stop: true,
......
......@@ -10,10 +10,12 @@ import 'package:path/path.dart' as path;
import '../application_package.dart';
import '../base/common.dart';
import '../base/context.dart';
import '../build_configuration.dart';
import '../device.dart';
import '../flx.dart';
import '../runner/flutter_command.dart';
import '../toolchain.dart';
import 'apk.dart';
import 'install.dart';
import 'stop.dart';
......@@ -94,7 +96,9 @@ class StartCommand extends StartCommandBase {
devices,
applicationPackages,
toolchain,
buildConfigurations,
target: argResults['target'],
enginePath: runner.enginePath,
install: true,
stop: argResults['full-restart'],
checked: argResults['checked'],
......@@ -113,8 +117,10 @@ class StartCommand extends StartCommandBase {
Future<int> startApp(
DeviceStore devices,
ApplicationPackageStore applicationPackages,
Toolchain toolchain, {
Toolchain toolchain,
List<BuildConfiguration> configs, {
String target,
String enginePath,
bool stop: true,
bool install: true,
bool checked: true,
......@@ -134,6 +140,14 @@ Future<int> startApp(
return 1;
}
if (install) {
printTrace('Running build command.');
applicationPackages = await buildAll(
devices, applicationPackages, toolchain, configs,
enginePath: enginePath,
target: target);
}
if (stop) {
printTrace('Running stop command.');
stopAll(devices, applicationPackages);
......
......@@ -614,7 +614,7 @@ class _IOSSimulatorLogReader extends DeviceLogReader {
}
);
return result;
return await result;
}
int get hashCode => device.logFilePath.hashCode;
......
......@@ -18,6 +18,7 @@ dependencies:
stack_trace: ^1.4.0
test: 0.12.6+1 # see note below
yaml: ^2.1.3
xml: ^2.4.1
flx:
path: ../flx
......
......@@ -4,6 +4,7 @@
import 'package:args/command_runner.dart';
import 'package:flutter_tools/src/commands/listen.dart';
import 'package:flutter_tools/src/runner/flutter_command_runner.dart';
import 'package:mockito/mockito.dart';
import 'package:test/test.dart';
......@@ -22,8 +23,7 @@ defineTests() {
when(mockDevices.iOS.isConnected()).thenReturn(false);
when(mockDevices.iOSSimulator.isConnected()).thenReturn(false);
CommandRunner runner = new CommandRunner('test_flutter', '')
..addCommand(command);
CommandRunner runner = new FlutterCommandRunner()..addCommand(command);
runner.run(['listen']).then((int code) => expect(code, equals(0)));
});
});
......
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