| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library analyzer_cli.src.build_mode; | 5 library analyzer_cli.src.build_mode; |
| 6 | 6 |
| 7 import 'dart:core'; | 7 import 'dart:core'; |
| 8 import 'dart:io' as io; | 8 import 'dart:io' as io; |
| 9 | 9 |
| 10 import 'package:analyzer/dart/ast/ast.dart' show CompilationUnit; | 10 import 'package:analyzer/dart/ast/ast.dart' show CompilationUnit; |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 // BuildMode expects sourceFiles in the format "<uri>|<filepath>", | 162 // BuildMode expects sourceFiles in the format "<uri>|<filepath>", |
| 163 // but the rest of the code base does not understand this format. | 163 // but the rest of the code base does not understand this format. |
| 164 // Rewrite sourceFiles, stripping the "<uri>|" prefix, so that it | 164 // Rewrite sourceFiles, stripping the "<uri>|" prefix, so that it |
| 165 // does not cause problems with code that does not expect this format. | 165 // does not cause problems with code that does not expect this format. |
| 166 options.rewriteSourceFiles(options.sourceFiles | 166 options.rewriteSourceFiles(options.sourceFiles |
| 167 .map((String uriPipePath) => | 167 .map((String uriPipePath) => |
| 168 uriPipePath.substring(uriPipePath.indexOf('|') + 1)) | 168 uriPipePath.substring(uriPipePath.indexOf('|') + 1)) |
| 169 .toList()); | 169 .toList()); |
| 170 | 170 |
| 171 // Prepare the analysis context. | 171 // Prepare the analysis context. |
| 172 _createContext(); | 172 try { |
| 173 _createContext(); |
| 174 } on ConflictingSummaryException catch (e) { |
| 175 errorSink.writeln('$e'); |
| 176 io.exitCode = ErrorSeverity.ERROR.ordinal; |
| 177 return ErrorSeverity.ERROR; |
| 178 } |
| 173 | 179 |
| 174 // Add sources. | 180 // Add sources. |
| 175 ChangeSet changeSet = new ChangeSet(); | 181 ChangeSet changeSet = new ChangeSet(); |
| 176 for (Uri uri in uriToFileMap.keys) { | 182 for (Uri uri in uriToFileMap.keys) { |
| 177 File file = uriToFileMap[uri]; | 183 File file = uriToFileMap[uri]; |
| 178 if (!file.exists) { | 184 if (!file.exists) { |
| 179 errorSink.writeln('File not found: ${file.path}'); | 185 errorSink.writeln('File not found: ${file.path}'); |
| 180 io.exitCode = ErrorSeverity.ERROR.ordinal; | 186 io.exitCode = ErrorSeverity.ERROR.ordinal; |
| 181 return ErrorSeverity.ERROR; | 187 return ErrorSeverity.ERROR; |
| 182 } | 188 } |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 * Build the inverse mapping of [uriToSourceMap]. | 426 * Build the inverse mapping of [uriToSourceMap]. |
| 421 */ | 427 */ |
| 422 static Map<String, Uri> _computePathToUriMap(Map<Uri, File> uriToSourceMap) { | 428 static Map<String, Uri> _computePathToUriMap(Map<Uri, File> uriToSourceMap) { |
| 423 Map<String, Uri> pathToUriMap = <String, Uri>{}; | 429 Map<String, Uri> pathToUriMap = <String, Uri>{}; |
| 424 uriToSourceMap.forEach((Uri uri, File file) { | 430 uriToSourceMap.forEach((Uri uri, File file) { |
| 425 pathToUriMap[file.path] = uri; | 431 pathToUriMap[file.path] = uri; |
| 426 }); | 432 }); |
| 427 return pathToUriMap; | 433 return pathToUriMap; |
| 428 } | 434 } |
| 429 } | 435 } |
| OLD | NEW |