diff --git a/packages/flutter_tools/lib/src/compile.dart b/packages/flutter_tools/lib/src/compile.dart index 2ee9cbe132a..a65a876a944 100644 --- a/packages/flutter_tools/lib/src/compile.dart +++ b/packages/flutter_tools/lib/src/compile.dart @@ -468,6 +468,7 @@ abstract class ResidentCompiler { List dartDefines, }) = DefaultResidentCompiler; + /// If invoked for the first time, it compiles Dart script identified by /// [mainPath], [invalidatedFiles] list is ignored. /// On successive runs [invalidatedFiles] indicates which files need to be diff --git a/packages/flutter_tools/lib/src/devfs.dart b/packages/flutter_tools/lib/src/devfs.dart index 1616dfa399e..129c09baa20 100644 --- a/packages/flutter_tools/lib/src/devfs.dart +++ b/packages/flutter_tools/lib/src/devfs.dart @@ -487,9 +487,6 @@ class DevFS { if (fullRestart) { generator.reset(); } - // On a full restart, or on an initial compile for the attach based workflow, - // this will produce a full dill. Subsequent invocations will produce incremental - // dill files that depend on the invalidated files. printTrace('Compiling dart to kernel with ${invalidatedFiles.length} updated files'); final CompilerOutput compilerOutput = await generator.recompile( mainPath, diff --git a/packages/flutter_tools/lib/src/run_hot.dart b/packages/flutter_tools/lib/src/run_hot.dart index c3698589310..649e3265e3f 100644 --- a/packages/flutter_tools/lib/src/run_hot.dart +++ b/packages/flutter_tools/lib/src/run_hot.dart @@ -18,7 +18,6 @@ import 'base/platform.dart'; import 'base/terminal.dart'; import 'base/utils.dart'; import 'build_info.dart'; -import 'bundle.dart'; import 'compile.dart'; import 'convert.dart'; import 'devfs.dart'; @@ -263,31 +262,14 @@ class HotRunner extends ResidentRunner { firstBuildTime = DateTime.now(); - final List> startupTasks = >[]; for (FlutterDevice device in flutterDevices) { - // Here we initialize the frontend_server conccurently with the gradle - // build, reducing initialization time. This is safe because the first - // invocation of the frontend server produces a full dill file that - // the subsequent invocation in devfs will not overwrite. - if (device.generator != null) { - startupTasks.add( - device.generator.recompile( - mainPath, - [], - outputPath: dillOutputPath ?? - getDefaultApplicationKernelPath(trackWidgetCreation: device.trackWidgetCreation), - packagesFilePath : packagesFilePath, - ).then((CompilerOutput output) => output?.errorCount == 0) - ); - } - startupTasks.add(device.runHot( + final int result = await device.runHot( hotRunner: this, route: route, - ).then((int result) => result == 0)); - } - final List results = await Future.wait(startupTasks); - if (!results.every((bool passed) => passed)) { - return 1; + ); + if (result != 0) { + return result; + } } return attach( diff --git a/packages/flutter_tools/test/integration.shard/hot_reload_test.dart b/packages/flutter_tools/test/integration.shard/hot_reload_test.dart index 59ac90682f6..2d7d3cd7aaf 100644 --- a/packages/flutter_tools/test/integration.shard/hot_reload_test.dart +++ b/packages/flutter_tools/test/integration.shard/hot_reload_test.dart @@ -108,18 +108,13 @@ void main() { }); test('hot reload doesn\'t reassemble if paused', () async { - final Future setup = _flutter.run(withDebugger: true); - final Completer sawTick1 = Completer(); + await _flutter.run(withDebugger: true); final Completer sawTick2 = Completer(); final Completer sawTick3 = Completer(); final Completer sawDebuggerPausedMessage1 = Completer(); final Completer sawDebuggerPausedMessage2 = Completer(); final StreamSubscription subscription = _flutter.stdout.listen( (String line) { - if (line.contains('((((TICK 1))))')) { - expect(sawTick1.isCompleted, isFalse); - sawTick1.complete(); - } if (line.contains('((((TICK 2))))')) { expect(sawTick2.isCompleted, isFalse); sawTick2.complete(); @@ -134,8 +129,6 @@ void main() { } }, ); - await setup; - await sawTick1.future; await _flutter.addBreakpoint( _project.buildBreakpointUri, _project.buildBreakpointLine,