| 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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 | 263 |
| 264 // Create the context. | 264 // Create the context. |
| 265 context = AnalysisEngine.instance.createAnalysisContext(); | 265 context = AnalysisEngine.instance.createAnalysisContext(); |
| 266 context.sourceFactory = new SourceFactory(<UriResolver>[ | 266 context.sourceFactory = new SourceFactory(<UriResolver>[ |
| 267 new DartUriResolver(sdk), | 267 new DartUriResolver(sdk), |
| 268 new InSummaryUriResolver(resourceProvider, summaryDataStore), | 268 new InSummaryUriResolver(resourceProvider, summaryDataStore), |
| 269 new ExplicitSourceResolver(uriToFileMap) | 269 new ExplicitSourceResolver(uriToFileMap) |
| 270 ]); | 270 ]); |
| 271 | 271 |
| 272 // Set context options. | 272 // Set context options. |
| 273 Driver.setAnalysisContextOptions(resourceProvider, context, options, | 273 Driver.setAnalysisContextOptions( |
| 274 resourceProvider, context.sourceFactory, context, options, |
| 274 (AnalysisOptionsImpl contextOptions) { | 275 (AnalysisOptionsImpl contextOptions) { |
| 275 if (options.buildSummaryOnlyDiet) { | 276 if (options.buildSummaryOnlyDiet) { |
| 276 contextOptions.analyzeFunctionBodies = false; | 277 contextOptions.analyzeFunctionBodies = false; |
| 277 } | 278 } |
| 278 }); | 279 }); |
| 279 | 280 |
| 280 if (!options.buildSummaryOnly) { | 281 if (!options.buildSummaryOnly) { |
| 281 // Configure using summaries. | 282 // Configure using summaries. |
| 282 context.typeProvider = sdk.context.typeProvider; | 283 context.typeProvider = sdk.context.typeProvider; |
| 283 context.resultProvider = | 284 context.resultProvider = |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 * Build the inverse mapping of [uriToSourceMap]. | 416 * Build the inverse mapping of [uriToSourceMap]. |
| 416 */ | 417 */ |
| 417 static Map<String, Uri> _computePathToUriMap(Map<Uri, File> uriToSourceMap) { | 418 static Map<String, Uri> _computePathToUriMap(Map<Uri, File> uriToSourceMap) { |
| 418 Map<String, Uri> pathToUriMap = <String, Uri>{}; | 419 Map<String, Uri> pathToUriMap = <String, Uri>{}; |
| 419 uriToSourceMap.forEach((Uri uri, File file) { | 420 uriToSourceMap.forEach((Uri uri, File file) { |
| 420 pathToUriMap[file.path] = uri; | 421 pathToUriMap[file.path] = uri; |
| 421 }); | 422 }); |
| 422 return pathToUriMap; | 423 return pathToUriMap; |
| 423 } | 424 } |
| 424 } | 425 } |
| OLD | NEW |