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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 return null; | 388 return null; |
389 } | 389 } |
390 return uriToUnit.putIfAbsent(uri, () { | 390 return uriToUnit.putIfAbsent(uri, () { |
391 CompilationUnit unit = context.computeResult(source, PARSED_UNIT); | 391 CompilationUnit unit = context.computeResult(source, PARSED_UNIT); |
392 UnlinkedUnitBuilder unlinkedUnit = serializeAstUnlinked(unit); | 392 UnlinkedUnitBuilder unlinkedUnit = serializeAstUnlinked(unit); |
393 assembler.addUnlinkedUnit(source, unlinkedUnit); | 393 assembler.addUnlinkedUnit(source, unlinkedUnit); |
394 return unlinkedUnit; | 394 return unlinkedUnit; |
395 }); | 395 }); |
396 } | 396 } |
397 | 397 |
398 Map<String, LinkedLibraryBuilder> linkResult = | 398 Map<String, LinkedLibraryBuilder> linkResult = link( |
399 link(sourceUris, _getDependency, _getUnit, options.strongMode); | 399 sourceUris, |
| 400 _getDependency, |
| 401 _getUnit, |
| 402 context.declaredVariables.get, |
| 403 options.strongMode); |
400 linkResult.forEach(assembler.addLinkedLibrary); | 404 linkResult.forEach(assembler.addLinkedLibrary); |
401 } | 405 } |
402 } | 406 } |
403 | 407 |
404 /** | 408 /** |
405 * Instances of the class [ExplicitSourceResolver] map URIs to files on disk | 409 * Instances of the class [ExplicitSourceResolver] map URIs to files on disk |
406 * using a fixed mapping provided at construction time. | 410 * using a fixed mapping provided at construction time. |
407 */ | 411 */ |
408 class ExplicitSourceResolver extends UriResolver { | 412 class ExplicitSourceResolver extends UriResolver { |
409 final Map<Uri, File> uriToFileMap; | 413 final Map<Uri, File> uriToFileMap; |
(...skipping 27 matching lines...) Expand all Loading... |
437 * Build the inverse mapping of [uriToSourceMap]. | 441 * Build the inverse mapping of [uriToSourceMap]. |
438 */ | 442 */ |
439 static Map<String, Uri> _computePathToUriMap(Map<Uri, File> uriToSourceMap) { | 443 static Map<String, Uri> _computePathToUriMap(Map<Uri, File> uriToSourceMap) { |
440 Map<String, Uri> pathToUriMap = <String, Uri>{}; | 444 Map<String, Uri> pathToUriMap = <String, Uri>{}; |
441 uriToSourceMap.forEach((Uri uri, File file) { | 445 uriToSourceMap.forEach((Uri uri, File file) { |
442 pathToUriMap[file.path] = uri; | 446 pathToUriMap[file.path] = uri; |
443 }); | 447 }); |
444 return pathToUriMap; | 448 return pathToUriMap; |
445 } | 449 } |
446 } | 450 } |
OLD | NEW |