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 import 'dart:math' as math; | 8 import 'dart:math' as math; |
9 | 9 |
10 import 'package:analyzer/src/generated/ast.dart'; | 10 import 'package:analyzer/src/generated/ast.dart'; |
11 import 'package:analyzer/src/generated/element.dart'; | 11 import 'package:analyzer/src/generated/element.dart'; |
12 import 'package:analyzer/src/generated/engine.dart' hide AnalysisTask; | 12 import 'package:analyzer/src/generated/engine.dart' hide AnalysisTask; |
13 import 'package:analyzer/src/generated/error.dart'; | 13 import 'package:analyzer/src/generated/error.dart'; |
14 import 'package:analyzer/src/generated/error_verifier.dart'; | 14 import 'package:analyzer/src/generated/error_verifier.dart'; |
15 import 'package:analyzer/src/generated/java_engine.dart'; | 15 import 'package:analyzer/src/generated/java_engine.dart'; |
16 import 'package:analyzer/src/generated/parser.dart'; | 16 import 'package:analyzer/src/generated/parser.dart'; |
17 import 'package:analyzer/src/generated/resolver.dart'; | 17 import 'package:analyzer/src/generated/resolver.dart'; |
18 import 'package:analyzer/src/generated/scanner.dart'; | 18 import 'package:analyzer/src/generated/scanner.dart'; |
19 import 'package:analyzer/src/generated/sdk.dart'; | 19 import 'package:analyzer/src/generated/sdk.dart'; |
20 import 'package:analyzer/src/generated/source.dart'; | 20 import 'package:analyzer/src/generated/source.dart'; |
21 import 'package:analyzer/src/generated/utilities_general.dart'; | 21 import 'package:analyzer/src/generated/utilities_general.dart'; |
22 import 'package:analyzer/src/task/driver.dart'; | 22 import 'package:analyzer/src/task/driver.dart'; |
23 import 'package:analyzer/src/task/general.dart'; | 23 import 'package:analyzer/src/task/general.dart'; |
24 import 'package:analyzer/task/dart.dart'; | 24 import 'package:analyzer/task/dart.dart'; |
25 import 'package:analyzer/task/general.dart'; | 25 import 'package:analyzer/task/general.dart'; |
26 import 'package:analyzer/task/model.dart'; | 26 import 'package:analyzer/task/model.dart'; |
| 27 import 'package:analyzer/src/task/inputs.dart'; |
27 | 28 |
28 /** | 29 /** |
29 * The errors produced while resolving a library directives. | 30 * The errors produced while resolving a library directives. |
30 * | 31 * |
31 * The list will be empty if there were no errors, but will not be `null`. | 32 * The list will be empty if there were no errors, but will not be `null`. |
32 * | 33 * |
33 * The result is only available for targets representing a Dart library. | 34 * The result is only available for targets representing a Dart library. |
34 */ | 35 */ |
35 final ResultDescriptor<List<AnalysisError>> BUILD_DIRECTIVES_ERRORS = | 36 final ResultDescriptor<List<AnalysisError>> BUILD_DIRECTIVES_ERRORS = |
36 new ResultDescriptor<List<AnalysisError>>( | 37 new ResultDescriptor<List<AnalysisError>>( |
(...skipping 1967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2004 } | 2005 } |
2005 | 2006 |
2006 /** | 2007 /** |
2007 * Return a map from the names of the inputs of this kind of task to the task | 2008 * Return a map from the names of the inputs of this kind of task to the task |
2008 * input descriptors describing those inputs for a task with the | 2009 * input descriptors describing those inputs for a task with the |
2009 * given [target]. | 2010 * given [target]. |
2010 */ | 2011 */ |
2011 static Map<String, TaskInput> buildInputs(Source libSource) { | 2012 static Map<String, TaskInput> buildInputs(Source libSource) { |
2012 return <String, TaskInput>{ | 2013 return <String, TaskInput>{ |
2013 LIBRARY_INPUT: LIBRARY_ELEMENT4.of(libSource), | 2014 LIBRARY_INPUT: LIBRARY_ELEMENT4.of(libSource), |
2014 'resolvedUnits': UNITS.of(libSource).toMap((Source source) => | 2015 'resolvedUnits': IMPORT_SOURCE_CLOSURE |
2015 RESOLVED_UNIT4.of(new LibraryUnitTarget(libSource, source))) | 2016 .of(libSource) |
| 2017 .toMapOf(UNITS) |
| 2018 .toFlattenList((Source library, Source unit) => |
| 2019 RESOLVED_UNIT4.of(new LibraryUnitTarget(library, unit))) |
2016 }; | 2020 }; |
2017 } | 2021 } |
2018 | 2022 |
2019 /** | 2023 /** |
2020 * Create a [ResolveLibraryTypeNamesTask] based on the given [target] in | 2024 * Create a [ResolveLibraryTypeNamesTask] based on the given [target] in |
2021 * the given [context]. | 2025 * the given [context]. |
2022 */ | 2026 */ |
2023 static ResolveLibraryTypeNamesTask createTask( | 2027 static ResolveLibraryTypeNamesTask createTask( |
2024 AnalysisContext context, AnalysisTarget target) { | 2028 AnalysisContext context, AnalysisTarget target) { |
2025 return new ResolveLibraryTypeNamesTask(context, target); | 2029 return new ResolveLibraryTypeNamesTask(context, target); |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2446 @override | 2450 @override |
2447 bool moveNext() { | 2451 bool moveNext() { |
2448 if (_newSources.isEmpty) { | 2452 if (_newSources.isEmpty) { |
2449 return false; | 2453 return false; |
2450 } | 2454 } |
2451 currentTarget = _newSources.first; | 2455 currentTarget = _newSources.first; |
2452 _newSources.remove(currentTarget); | 2456 _newSources.remove(currentTarget); |
2453 return true; | 2457 return true; |
2454 } | 2458 } |
2455 } | 2459 } |
OLD | NEW |