| 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/src/generated/ast.dart'; | 9 import 'package:analyzer/src/generated/ast.dart'; |
| 10 import 'package:analyzer/src/generated/element.dart'; | 10 import 'package:analyzer/src/generated/element.dart'; |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 | 340 |
| 341 /** | 341 /** |
| 342 * Return a map from the names of the inputs of this kind of task to the task | 342 * Return a map from the names of the inputs of this kind of task to the task |
| 343 * input descriptors describing those inputs for a task with the | 343 * input descriptors describing those inputs for a task with the |
| 344 * given [target]. | 344 * given [target]. |
| 345 */ | 345 */ |
| 346 static Map<String, TaskInput> buildInputs(AnalysisTarget target) { | 346 static Map<String, TaskInput> buildInputs(AnalysisTarget target) { |
| 347 return <String, TaskInput>{ | 347 return <String, TaskInput>{ |
| 348 RESOLVED_UNIT2_INPUT_NAME: RESOLVED_UNIT2.inputFor(target), | 348 RESOLVED_UNIT2_INPUT_NAME: RESOLVED_UNIT2.inputFor(target), |
| 349 IMPORTS_LIBRARY_ELEMENT1_INPUT_NAME: | 349 IMPORTS_LIBRARY_ELEMENT1_INPUT_NAME: |
| 350 new MapBasedTaskInput<Source, LibraryElement>( | 350 new ListToMapTaskInput<Source, LibraryElement>( |
| 351 IMPORTED_LIBRARIES.inputFor(target), | 351 IMPORTED_LIBRARIES.inputFor(target), |
| 352 (Source source) => LIBRARY_ELEMENT1.inputFor(source)), | 352 (Source source) => LIBRARY_ELEMENT1.inputFor(source)), |
| 353 EXPORTS_LIBRARY_ELEMENT1_INPUT_NAME: | 353 EXPORTS_LIBRARY_ELEMENT1_INPUT_NAME: |
| 354 new MapBasedTaskInput<Source, LibraryElement>( | 354 new ListToMapTaskInput<Source, LibraryElement>( |
| 355 EXPORTED_LIBRARIES.inputFor(target), | 355 EXPORTED_LIBRARIES.inputFor(target), |
| 356 (Source source) => LIBRARY_ELEMENT1.inputFor(source)), | 356 (Source source) => LIBRARY_ELEMENT1.inputFor(source)), |
| 357 IMPORTS_SOURCE_KIND_INPUT_NAME: new MapBasedTaskInput<Source, SourceKind>( | 357 IMPORTS_SOURCE_KIND_INPUT_NAME: |
| 358 IMPORTED_LIBRARIES.inputFor(target), | 358 new ListToMapTaskInput<Source, SourceKind>( |
| 359 (Source source) => SOURCE_KIND.inputFor(source)), | 359 IMPORTED_LIBRARIES.inputFor(target), |
| 360 EXPORTS_SOURCE_KIND_INPUT_NAME: new MapBasedTaskInput<Source, SourceKind>( | 360 (Source source) => SOURCE_KIND.inputFor(source)), |
| 361 EXPORTED_LIBRARIES.inputFor(target), | 361 EXPORTS_SOURCE_KIND_INPUT_NAME: |
| 362 (Source source) => SOURCE_KIND.inputFor(source)) | 362 new ListToMapTaskInput<Source, SourceKind>( |
| 363 EXPORTED_LIBRARIES.inputFor(target), |
| 364 (Source source) => SOURCE_KIND.inputFor(source)) |
| 363 }; | 365 }; |
| 364 } | 366 } |
| 365 | 367 |
| 366 /** | 368 /** |
| 367 * Create a [BuildDirectiveElementsTask] based on the given [target] in | 369 * Create a [BuildDirectiveElementsTask] based on the given [target] in |
| 368 * the given [context]. | 370 * the given [context]. |
| 369 */ | 371 */ |
| 370 static BuildDirectiveElementsTask createTask( | 372 static BuildDirectiveElementsTask createTask( |
| 371 AnalysisContext context, AnalysisTarget target) { | 373 AnalysisContext context, AnalysisTarget target) { |
| 372 return new BuildDirectiveElementsTask(context, target); | 374 return new BuildDirectiveElementsTask(context, target); |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 /** | 636 /** |
| 635 * Return a map from the names of the inputs of this kind of task to the task | 637 * Return a map from the names of the inputs of this kind of task to the task |
| 636 * input descriptors describing those inputs for a task with the given | 638 * input descriptors describing those inputs for a task with the given |
| 637 * [target]. | 639 * [target]. |
| 638 */ | 640 */ |
| 639 static Map<String, TaskInput> buildInputs(AnalysisTarget target) { | 641 static Map<String, TaskInput> buildInputs(AnalysisTarget target) { |
| 640 return <String, TaskInput>{ | 642 return <String, TaskInput>{ |
| 641 DEFINING_RESOLVER_UNIT1_INPUT_NAME: | 643 DEFINING_RESOLVER_UNIT1_INPUT_NAME: |
| 642 new SimpleTaskInput(target, RESOLVED_UNIT1), | 644 new SimpleTaskInput(target, RESOLVED_UNIT1), |
| 643 PARTS_RESOLVED_UNIT1_INPUT_NAME: | 645 PARTS_RESOLVED_UNIT1_INPUT_NAME: |
| 644 new ListBasedTaskInput<Source, CompilationUnit>( | 646 new ListToListTaskInput<Source, CompilationUnit>( |
| 645 INCLUDED_PARTS.inputFor(target), | 647 INCLUDED_PARTS.inputFor(target), |
| 646 (Source source) => RESOLVED_UNIT1.inputFor(source)) | 648 (Source source) => RESOLVED_UNIT1.inputFor(source)) |
| 647 }; | 649 }; |
| 648 } | 650 } |
| 649 | 651 |
| 650 /** | 652 /** |
| 651 * Create a [BuildLibraryElementTask] based on the given [target] in the | 653 * Create a [BuildLibraryElementTask] based on the given [target] in the |
| 652 * given [context]. | 654 * given [context]. |
| 653 */ | 655 */ |
| 654 static BuildLibraryElementTask createTask( | 656 static BuildLibraryElementTask createTask( |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 } | 932 } |
| 931 | 933 |
| 932 /** | 934 /** |
| 933 * Create a [ScanDartTask] based on the given [target] in the given [context]. | 935 * Create a [ScanDartTask] based on the given [target] in the given [context]. |
| 934 */ | 936 */ |
| 935 static ScanDartTask createTask( | 937 static ScanDartTask createTask( |
| 936 AnalysisContext context, AnalysisTarget target) { | 938 AnalysisContext context, AnalysisTarget target) { |
| 937 return new ScanDartTask(context, target); | 939 return new ScanDartTask(context, target); |
| 938 } | 940 } |
| 939 } | 941 } |
| OLD | NEW |