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'; |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 * The flag specifying that [LIBRARY_ELEMENT6] is ready for a library and its | 434 * The flag specifying that [LIBRARY_ELEMENT6] is ready for a library and its |
435 * import/export closure. | 435 * import/export closure. |
436 * | 436 * |
437 * The result is only available for [Source]s representing a library. | 437 * The result is only available for [Source]s representing a library. |
438 */ | 438 */ |
439 final ResultDescriptor<bool> READY_LIBRARY_ELEMENT6 = | 439 final ResultDescriptor<bool> READY_LIBRARY_ELEMENT6 = |
440 new ResultDescriptor<bool>('READY_LIBRARY_ELEMENT6', false); | 440 new ResultDescriptor<bool>('READY_LIBRARY_ELEMENT6', false); |
441 | 441 |
442 /** | 442 /** |
443 * The flag specifying that [RESOLVED_UNIT] is ready for all of the units of a | 443 * The flag specifying that [RESOLVED_UNIT] is ready for all of the units of a |
444 * library and its import/export closure. | 444 * library. |
445 * | 445 * |
446 * The result is only available for [Source]s representing a library. | 446 * The result is only available for [Source]s representing a library. |
447 */ | 447 */ |
448 final ResultDescriptor<bool> READY_RESOLVED_UNIT = | 448 final ResultDescriptor<bool> READY_RESOLVED_UNIT = |
449 new ResultDescriptor<bool>('READY_RESOLVED_UNIT', false); | 449 new ResultDescriptor<bool>('READY_RESOLVED_UNIT', false); |
450 | 450 |
451 /** | 451 /** |
452 * The flag specifying that [RESOLVED_UNIT10] is ready for all of the units of a | 452 * The flag specifying that [RESOLVED_UNIT10] is ready for all of the units of a |
453 * library and its import/export closure. | 453 * library and its import/export closure. |
454 * | 454 * |
(...skipping 3768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4223 @override | 4223 @override |
4224 void internalPerform() { | 4224 void internalPerform() { |
4225 outputs[READY_RESOLVED_UNIT] = true; | 4225 outputs[READY_RESOLVED_UNIT] = true; |
4226 } | 4226 } |
4227 | 4227 |
4228 static Map<String, TaskInput> buildInputs(AnalysisTarget target) { | 4228 static Map<String, TaskInput> buildInputs(AnalysisTarget target) { |
4229 Source source = target; | 4229 Source source = target; |
4230 return <String, TaskInput>{ | 4230 return <String, TaskInput>{ |
4231 'thisLibraryUnitsReady': | 4231 'thisLibraryUnitsReady': |
4232 LIBRARY_SPECIFIC_UNITS.of(source).toListOf(RESOLVED_UNIT), | 4232 LIBRARY_SPECIFIC_UNITS.of(source).toListOf(RESOLVED_UNIT), |
4233 'directlyImportedLibrariesReady': | |
4234 IMPORTED_LIBRARIES.of(source).toListOf(READY_RESOLVED_UNIT), | |
4235 'directlyExportedLibrariesReady': | |
4236 EXPORTED_LIBRARIES.of(source).toListOf(READY_RESOLVED_UNIT), | |
4237 }; | 4233 }; |
4238 } | 4234 } |
4239 | 4235 |
4240 static ReadyResolvedUnitTask createTask( | 4236 static ReadyResolvedUnitTask createTask( |
4241 AnalysisContext context, AnalysisTarget target) { | 4237 AnalysisContext context, AnalysisTarget target) { |
4242 return new ReadyResolvedUnitTask(context, target); | 4238 return new ReadyResolvedUnitTask(context, target); |
4243 } | 4239 } |
4244 } | 4240 } |
4245 | 4241 |
4246 /** | 4242 /** |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4507 /** | 4503 /** |
4508 * Return a map from the names of the inputs of this kind of task to the task | 4504 * Return a map from the names of the inputs of this kind of task to the task |
4509 * input descriptors describing those inputs for a task with the | 4505 * input descriptors describing those inputs for a task with the |
4510 * given [target]. | 4506 * given [target]. |
4511 */ | 4507 */ |
4512 static Map<String, TaskInput> buildInputs(AnalysisTarget target) { | 4508 static Map<String, TaskInput> buildInputs(AnalysisTarget target) { |
4513 Source source = target; | 4509 Source source = target; |
4514 return <String, TaskInput>{ | 4510 return <String, TaskInput>{ |
4515 LIBRARY_INPUT: LIBRARY_ELEMENT7.of(source), | 4511 LIBRARY_INPUT: LIBRARY_ELEMENT7.of(source), |
4516 UNITS_INPUT: LIBRARY_SPECIFIC_UNITS.of(source).toListOf(RESOLVED_UNIT10), | 4512 UNITS_INPUT: LIBRARY_SPECIFIC_UNITS.of(source).toListOf(RESOLVED_UNIT10), |
4517 'thisLibraryClosureIsReady': READY_RESOLVED_UNIT10.of(source), | |
4518 }; | 4513 }; |
4519 } | 4514 } |
4520 | 4515 |
4521 /** | 4516 /** |
4522 * Create a [ResolveLibraryReferencesTask] based on the given [target] in | 4517 * Create a [ResolveLibraryReferencesTask] based on the given [target] in |
4523 * the given [context]. | 4518 * the given [context]. |
4524 */ | 4519 */ |
4525 static ResolveLibraryReferencesTask createTask( | 4520 static ResolveLibraryReferencesTask createTask( |
4526 AnalysisContext context, AnalysisTarget target) { | 4521 AnalysisContext context, AnalysisTarget target) { |
4527 return new ResolveLibraryReferencesTask(context, target); | 4522 return new ResolveLibraryReferencesTask(context, target); |
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5113 /** | 5108 /** |
5114 * Return a map from the names of the inputs of this kind of task to the task | 5109 * Return a map from the names of the inputs of this kind of task to the task |
5115 * input descriptors describing those inputs for a task with the | 5110 * input descriptors describing those inputs for a task with the |
5116 * given [target]. | 5111 * given [target]. |
5117 */ | 5112 */ |
5118 static Map<String, TaskInput> buildInputs(AnalysisTarget target) { | 5113 static Map<String, TaskInput> buildInputs(AnalysisTarget target) { |
5119 LibrarySpecificUnit unit = target; | 5114 LibrarySpecificUnit unit = target; |
5120 return <String, TaskInput>{ | 5115 return <String, TaskInput>{ |
5121 UNIT_INPUT: RESOLVED_UNIT11.of(unit), | 5116 UNIT_INPUT: RESOLVED_UNIT11.of(unit), |
5122 TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request), | 5117 TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request), |
5123 'thisLibraryClosureIsReady': READY_RESOLVED_UNIT11.of(unit.library), | |
5124 }; | 5118 }; |
5125 } | 5119 } |
5126 | 5120 |
5127 /** | 5121 /** |
5128 * Create a [StrongModeVerifyUnitTask] based on the given [target] in | 5122 * Create a [StrongModeVerifyUnitTask] based on the given [target] in |
5129 * the given [context]. | 5123 * the given [context]. |
5130 */ | 5124 */ |
5131 static StrongModeVerifyUnitTask createTask( | 5125 static StrongModeVerifyUnitTask createTask( |
5132 AnalysisContext context, AnalysisTarget target) { | 5126 AnalysisContext context, AnalysisTarget target) { |
5133 return new StrongModeVerifyUnitTask(context, target); | 5127 return new StrongModeVerifyUnitTask(context, target); |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5360 | 5354 |
5361 @override | 5355 @override |
5362 bool moveNext() { | 5356 bool moveNext() { |
5363 if (_newSources.isEmpty) { | 5357 if (_newSources.isEmpty) { |
5364 return false; | 5358 return false; |
5365 } | 5359 } |
5366 currentTarget = _newSources.removeLast(); | 5360 currentTarget = _newSources.removeLast(); |
5367 return true; | 5361 return true; |
5368 } | 5362 } |
5369 } | 5363 } |
OLD | NEW |