From ba918fea260551601787f0d593aba47fb4fecca9 Mon Sep 17 00:00:00 2001 From: Hixie Date: Fri, 26 Feb 2016 18:59:07 -0800 Subject: [PATCH] flutter analyze: handle missing files --- packages/flutter_tools/lib/src/commands/analyze.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/flutter_tools/lib/src/commands/analyze.dart b/packages/flutter_tools/lib/src/commands/analyze.dart index f31af72d69..489364bfcd 100644 --- a/packages/flutter_tools/lib/src/commands/analyze.dart +++ b/packages/flutter_tools/lib/src/commands/analyze.dart @@ -361,6 +361,7 @@ linter: RegExp constructorTearOffsPattern = new RegExp('.+#.+// analyzer doesn\'t like constructor tear-offs'); RegExp ignorePattern = new RegExp(r'// analyzer says "([^"]+)"'); RegExp conflictingNamesPattern = new RegExp('^The imported libraries \'([^\']+)\' and \'([^\']+)\' cannot have the same name \'([^\']+)\'\$'); + RegExp missingFilePattern = new RegExp('^Target of URI does not exist: \'([^\')]+)\'\$'); Set changedFiles = new Set(); // files about which we've complained that they changed @@ -393,8 +394,11 @@ linter: bool shouldIgnore = false; if (filename == mainFile.path) { Match libs = conflictingNamesPattern.firstMatch(errorMessage); + Match missing = missingFilePattern.firstMatch(errorMessage); if (libs != null) { errorLine = '[$level] $errorMessage (${dartFiles[lineNumber-1]})'; // strip the reference to the generated main.dart + } else if (missing != null) { + errorLine = '[$level] File does not exist (${missing[1]})'; } else { errorLine += ' (Please file a bug on the "flutter analyze" command saying that you saw this message.)'; }