| 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.src.task.dart; | 5 library analyzer.src.task.dart; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
| 10 import 'package:analyzer/dart/element/type.dart'; | 10 import 'package:analyzer/dart/element/type.dart'; |
| 11 import 'package:analyzer/src/context/cache.dart'; | 11 import 'package:analyzer/src/context/cache.dart'; |
| 12 import 'package:analyzer/src/context/context.dart'; |
| 12 import 'package:analyzer/src/dart/element/element.dart'; | 13 import 'package:analyzer/src/dart/element/element.dart'; |
| 13 import 'package:analyzer/src/generated/ast.dart'; | 14 import 'package:analyzer/src/generated/ast.dart'; |
| 14 import 'package:analyzer/src/generated/constant.dart'; | 15 import 'package:analyzer/src/generated/constant.dart'; |
| 15 import 'package:analyzer/src/generated/engine.dart'; | 16 import 'package:analyzer/src/generated/engine.dart'; |
| 16 import 'package:analyzer/src/generated/error.dart'; | 17 import 'package:analyzer/src/generated/error.dart'; |
| 17 import 'package:analyzer/src/generated/error_verifier.dart'; | 18 import 'package:analyzer/src/generated/error_verifier.dart'; |
| 18 import 'package:analyzer/src/generated/incremental_resolver.dart'; | 19 import 'package:analyzer/src/generated/incremental_resolver.dart'; |
| 19 import 'package:analyzer/src/generated/java_engine.dart'; | 20 import 'package:analyzer/src/generated/java_engine.dart'; |
| 20 import 'package:analyzer/src/generated/parser.dart'; | 21 import 'package:analyzer/src/generated/parser.dart'; |
| 21 import 'package:analyzer/src/generated/resolver.dart'; | 22 import 'package:analyzer/src/generated/resolver.dart'; |
| (...skipping 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1481 owningContext = internalContext.getContextFor(librarySource); | 1482 owningContext = internalContext.getContextFor(librarySource); |
| 1482 } | 1483 } |
| 1483 LibraryElementImpl libraryElement = | 1484 LibraryElementImpl libraryElement = |
| 1484 new LibraryElementImpl.forNode(owningContext, libraryNameNode); | 1485 new LibraryElementImpl.forNode(owningContext, libraryNameNode); |
| 1485 libraryElement.definingCompilationUnit = definingCompilationUnitElement; | 1486 libraryElement.definingCompilationUnit = definingCompilationUnitElement; |
| 1486 libraryElement.entryPoint = entryPoint; | 1487 libraryElement.entryPoint = entryPoint; |
| 1487 libraryElement.parts = sourcedCompilationUnits; | 1488 libraryElement.parts = sourcedCompilationUnits; |
| 1488 for (Directive directive in directivesToResolve) { | 1489 for (Directive directive in directivesToResolve) { |
| 1489 directive.element = libraryElement; | 1490 directive.element = libraryElement; |
| 1490 } | 1491 } |
| 1491 BuildLibraryElementUtils.patchTopLevelAccessors(libraryElement); | 1492 BuildLibraryElementUtils.patchTopLevelAccessors(libraryElement); |
| 1492 if (libraryDirective != null) { | 1493 if (libraryDirective != null) { |
| 1493 _setDoc(libraryElement, libraryDirective); | 1494 _setDoc(libraryElement, libraryDirective); |
| 1494 } | 1495 } |
| 1495 // | 1496 // |
| 1496 // Record outputs. | 1497 // Record outputs. |
| 1497 // | 1498 // |
| 1498 outputs[BUILD_LIBRARY_ERRORS] = errors; | 1499 outputs[BUILD_LIBRARY_ERRORS] = errors; |
| 1499 outputs[LIBRARY_ELEMENT1] = libraryElement; | 1500 outputs[LIBRARY_ELEMENT1] = libraryElement; |
| 1500 outputs[IS_LAUNCHABLE] = entryPoint != null; | 1501 outputs[IS_LAUNCHABLE] = entryPoint != null; |
| 1501 } | 1502 } |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1710 | 1711 |
| 1711 @override | 1712 @override |
| 1712 void internalPerform() { | 1713 void internalPerform() { |
| 1713 LibraryElement coreLibrary = getRequiredInput(CORE_INPUT); | 1714 LibraryElement coreLibrary = getRequiredInput(CORE_INPUT); |
| 1714 LibraryElement asyncLibrary = getRequiredInput(ASYNC_INPUT); | 1715 LibraryElement asyncLibrary = getRequiredInput(ASYNC_INPUT); |
| 1715 Namespace coreNamespace = coreLibrary.publicNamespace; | 1716 Namespace coreNamespace = coreLibrary.publicNamespace; |
| 1716 Namespace asyncNamespace = asyncLibrary.publicNamespace; | 1717 Namespace asyncNamespace = asyncLibrary.publicNamespace; |
| 1717 // | 1718 // |
| 1718 // Record outputs. | 1719 // Record outputs. |
| 1719 // | 1720 // |
| 1721 if (!context.analysisOptions.enableAsync) { |
| 1722 AnalysisContextImpl contextImpl = context; |
| 1723 asyncLibrary = contextImpl.createMockAsyncLib(coreLibrary); |
| 1724 asyncNamespace = asyncLibrary.publicNamespace; |
| 1725 } |
| 1720 TypeProvider typeProvider = | 1726 TypeProvider typeProvider = |
| 1721 new TypeProviderImpl.forNamespaces(coreNamespace, asyncNamespace); | 1727 new TypeProviderImpl.forNamespaces(coreNamespace, asyncNamespace); |
| 1722 (context as InternalAnalysisContext).typeProvider = typeProvider; | 1728 (context as InternalAnalysisContext).typeProvider = typeProvider; |
| 1723 outputs[TYPE_PROVIDER] = typeProvider; | 1729 outputs[TYPE_PROVIDER] = typeProvider; |
| 1724 } | 1730 } |
| 1725 | 1731 |
| 1726 static Map<String, TaskInput> buildInputs(AnalysisTarget target) { | 1732 static Map<String, TaskInput> buildInputs(AnalysisTarget target) { |
| 1727 AnalysisContextTarget contextTarget = target; | 1733 AnalysisContextTarget contextTarget = target; |
| 1728 SourceFactory sourceFactory = contextTarget.context.sourceFactory; | 1734 SourceFactory sourceFactory = contextTarget.context.sourceFactory; |
| 1729 Source coreSource = sourceFactory.forUri(DartSdk.DART_CORE); | 1735 Source coreSource = sourceFactory.forUri(DartSdk.DART_CORE); |
| (...skipping 3708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5438 | 5444 |
| 5439 @override | 5445 @override |
| 5440 bool moveNext() { | 5446 bool moveNext() { |
| 5441 if (_newSources.isEmpty) { | 5447 if (_newSources.isEmpty) { |
| 5442 return false; | 5448 return false; |
| 5443 } | 5449 } |
| 5444 currentTarget = _newSources.removeLast(); | 5450 currentTarget = _newSources.removeLast(); |
| 5445 return true; | 5451 return true; |
| 5446 } | 5452 } |
| 5447 } | 5453 } |
| OLD | NEW |