Commit 5d2281b6 authored by Matt Perry's avatar Matt Perry

'flutter start' calls 'flutter apk' if necessary.

flutter start no longer depends on a pre-built SkyShell.apk. It builds a
new one, as long as an AndroidManifest.xml exists.

We rebuild the .apk every time either AndroidManifest.xml or
flutter.yaml changes.
parent 4b7d601e
......@@ -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,9 +10,11 @@ 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 '../runner/flutter_command.dart';
import '../toolchain.dart';
import 'apk.dart';
import 'install.dart';
import 'stop.dart';
......@@ -92,7 +94,9 @@ class StartCommand extends StartCommandBase {
devices,
applicationPackages,
toolchain,
buildConfigurations,
target: argResults['target'],
enginePath: runner.enginePath,
install: true,
stop: argResults['full-restart'],
checked: argResults['checked'],
......@@ -111,8 +115,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,
......@@ -132,6 +138,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