 +  final List<Uri> sources = <Uri>[];
  
    bool _suppressCompilerMessages;
++  bool _expectSources;
  
    void handler(String message) {
 +    printTrace('-> $message');
      const String kResultPrefix = 'result ';
      if (boundaryKey == null && message.startsWith(kResultPrefix)) {
        boundaryKey = message.substring(kResultPrefix.length);
-     } else if (message.startsWith(boundaryKey)) {
--      if (message.length <= boundaryKey.length) {
--        compilerOutput.complete(null);
--        return;
-+      if (state == StdoutState.CollectDiagnostic) {
-+        state = StdoutState.CollectDependencies;
-+      } else {
-+        if (message.length <= boundaryKey.length) {
-+          compilerOutput.complete(null);
+-    } else if (message.startsWith(boundaryKey)) {
++      return;
++    }
++    if (message.startsWith(boundaryKey)) {
++      if (_expectSources) {
++        if (state == StdoutState.CollectDiagnostic) {
++          state = StdoutState.CollectDependencies;
 +          return;
 +        }
-+        final int spaceDelimiter = message.lastIndexOf(' ');
-+        compilerOutput.complete(
-+            CompilerOutput(
-+                message.substring(boundaryKey.length + 1, spaceDelimiter),
-+                int.parse(message.substring(spaceDelimiter + 1).trim()),
-+                sources));
++      }
+       if (message.length <= boundaryKey.length) {
+         compilerOutput.complete(null);
+         return;
        }
--      final int spaceDelimiter = message.lastIndexOf(' ');
--      compilerOutput.complete(
+       final int spaceDelimiter = message.lastIndexOf(' ');
+       compilerOutput.complete(
 -        CompilerOutput(
 -          message.substring(boundaryKey.length + 1, spaceDelimiter),
 -          int.parse(message.substring(spaceDelimiter + 1).trim())));

-      if (compilerMessageReceived == false) {
-        consumer('\nCompiler message:');
-        compilerMessageReceived = true;
+    } else {
+      if (state == StdoutState.CollectDiagnostic) {
+        if (!_suppressCompilerMessages) {
+          if (compilerMessageReceived == false) {
+            consumer('\nCompiler message:');
+            compilerMessageReceived = true;
+          }
+          consumer(message);
+        }
+      } else {
+        assert(state == StdoutState.CollectDependencies);
+        switch (message[0]) {
+          case '+':
+            sources.add(Uri.parse(message.substring(1)));
+            break;
+          case '-':
+            sources.remove(Uri.parse(message.substring(1)));
+            break;
+          default:
+            printTrace('Unexpected prefix for $message uri - ignoring');
+        }
       }
-      consumer(message);
     }
   }
 
@@ -106,6 +133,7 @@ class StdoutHandler {
     compilerMessageReceived = false;
     compilerOutput = Completer<CompilerOutput>();
     _suppressCompilerMessages = suppressCompilerMessages;
+    state = StdoutState.CollectDiagnostic;
   }
 }
 
@@ -200,7 +228,7 @@ class KernelCompiler {
 
       if (await fingerprinter.doesFingerprintMatch()) {
         printTrace('Skipping kernel compilation. Fingerprint match.');

diff --git a/packages/flutter_tools/lib/src/compile.dart b/packages/flutter_tools/lib/src/compile.dart
index 12c0770ab..b7945fd64 100644
--- a/packages/flutter_tools/lib/src/compile.dart
+++ b/packages/flutter_tools/lib/src/compile.dart
@@ -57,12 +57,15 @@ class TargetModel {
