| 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'; |
| 11 import 'package:analyzer/src/generated/engine.dart' hide AnalysisTask; | 11 import 'package:analyzer/src/generated/engine.dart' hide AnalysisTask; |
| 12 import 'package:analyzer/src/generated/error.dart'; | 12 import 'package:analyzer/src/generated/error.dart'; |
| 13 import 'package:analyzer/src/generated/java_engine.dart'; | 13 import 'package:analyzer/src/generated/java_engine.dart'; |
| 14 import 'package:analyzer/src/generated/parser.dart'; | 14 import 'package:analyzer/src/generated/parser.dart'; |
| 15 import 'package:analyzer/src/generated/resolver.dart'; | 15 import 'package:analyzer/src/generated/resolver.dart'; |
| 16 import 'package:analyzer/src/generated/scanner.dart'; | 16 import 'package:analyzer/src/generated/scanner.dart'; |
| 17 import 'package:analyzer/src/generated/sdk.dart'; | 17 import 'package:analyzer/src/generated/sdk.dart'; |
| 18 import 'package:analyzer/src/generated/source.dart'; | 18 import 'package:analyzer/src/generated/source.dart'; |
| 19 import 'package:analyzer/src/generated/utilities_general.dart'; | 19 import 'package:analyzer/src/generated/utilities_general.dart'; |
| 20 import 'package:analyzer/src/task/driver.dart'; | 20 import 'package:analyzer/src/task/driver.dart'; |
| 21 import 'package:analyzer/src/task/general.dart'; | 21 import 'package:analyzer/src/task/general.dart'; |
| 22 import 'package:analyzer/src/task/inputs.dart'; | |
| 23 import 'package:analyzer/task/dart.dart'; | 22 import 'package:analyzer/task/dart.dart'; |
| 24 import 'package:analyzer/task/general.dart'; | 23 import 'package:analyzer/task/general.dart'; |
| 25 import 'package:analyzer/task/model.dart'; | 24 import 'package:analyzer/task/model.dart'; |
| 26 | 25 |
| 27 /** | 26 /** |
| 28 * The errors produced while resolving a library directives. | 27 * The errors produced while resolving a library directives. |
| 29 * | 28 * |
| 30 * The list will be empty if there were no errors, but will not be `null`. | 29 * The list will be empty if there were no errors, but will not be `null`. |
| 31 * | 30 * |
| 32 * The result is only available for targets representing a Dart library. | 31 * The result is only available for targets representing a Dart library. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 58 final ResultDescriptor<List<AnalysisError>> BUILD_LIBRARY_ERRORS = | 57 final ResultDescriptor<List<AnalysisError>> BUILD_LIBRARY_ERRORS = |
| 59 new ResultDescriptor<List<AnalysisError>>( | 58 new ResultDescriptor<List<AnalysisError>>( |
| 60 'BUILD_LIBRARY_ERRORS', AnalysisError.NO_ERRORS, | 59 'BUILD_LIBRARY_ERRORS', AnalysisError.NO_ERRORS, |
| 61 contributesTo: DART_ERRORS); | 60 contributesTo: DART_ERRORS); |
| 62 | 61 |
| 63 /** | 62 /** |
| 64 * The sources representing the export closure of a library. | 63 * The sources representing the export closure of a library. |
| 65 * | 64 * |
| 66 * The result is only available for targets representing a Dart library. | 65 * The result is only available for targets representing a Dart library. |
| 67 */ | 66 */ |
| 68 final ResultDescriptor<List<Source>> EXPORT_SOURCE_CLOSURE = | 67 final ListResultDescriptor<Source> EXPORT_SOURCE_CLOSURE = |
| 69 new ResultDescriptor<List<Source>>('EXPORT_SOURCE_CLOSURE', null); | 68 new ListResultDescriptor<Source>('EXPORT_SOURCE_CLOSURE', null); |
| 70 | 69 |
| 71 /** | 70 /** |
| 72 * The partial [LibraryElement] associated with a library. | 71 * The partial [LibraryElement] associated with a library. |
| 73 * | 72 * |
| 74 * The [LibraryElement] and its [CompilationUnitElement]s are attached to each | 73 * The [LibraryElement] and its [CompilationUnitElement]s are attached to each |
| 75 * other. Directives 'library', 'part' and 'part of' are resolved. | 74 * other. Directives 'library', 'part' and 'part of' are resolved. |
| 76 * | 75 * |
| 77 * The result is only available for targets representing a Dart library. | 76 * The result is only available for targets representing a Dart library. |
| 78 */ | 77 */ |
| 79 final ResultDescriptor<LibraryElement> LIBRARY_ELEMENT1 = | 78 final ResultDescriptor<LibraryElement> LIBRARY_ELEMENT1 = |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 outputs[RESOLVED_UNIT1] = unit; | 234 outputs[RESOLVED_UNIT1] = unit; |
| 236 } | 235 } |
| 237 | 236 |
| 238 /** | 237 /** |
| 239 * Return a map from the names of the inputs of this kind of task to the task | 238 * Return a map from the names of the inputs of this kind of task to the task |
| 240 * input descriptors describing those inputs for a task with the given | 239 * input descriptors describing those inputs for a task with the given |
| 241 * [target]. | 240 * [target]. |
| 242 */ | 241 */ |
| 243 static Map<String, TaskInput> buildInputs(LibraryUnitTarget target) { | 242 static Map<String, TaskInput> buildInputs(LibraryUnitTarget target) { |
| 244 return <String, TaskInput>{ | 243 return <String, TaskInput>{ |
| 245 PARSED_UNIT_INPUT_NAME: PARSED_UNIT.inputFor(target.unit) | 244 PARSED_UNIT_INPUT_NAME: PARSED_UNIT.of(target.unit) |
| 246 }; | 245 }; |
| 247 } | 246 } |
| 248 | 247 |
| 249 /** | 248 /** |
| 250 * Create a [BuildCompilationUnitElementTask] based on the given [target] in | 249 * Create a [BuildCompilationUnitElementTask] based on the given [target] in |
| 251 * the given [context]. | 250 * the given [context]. |
| 252 */ | 251 */ |
| 253 static BuildCompilationUnitElementTask createTask( | 252 static BuildCompilationUnitElementTask createTask( |
| 254 AnalysisContext context, AnalysisTarget target) { | 253 AnalysisContext context, AnalysisTarget target) { |
| 255 return new BuildCompilationUnitElementTask(context, target); | 254 return new BuildCompilationUnitElementTask(context, target); |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 outputs[BUILD_DIRECTIVES_ERRORS] = errors; | 432 outputs[BUILD_DIRECTIVES_ERRORS] = errors; |
| 434 } | 433 } |
| 435 | 434 |
| 436 /** | 435 /** |
| 437 * Return a map from the names of the inputs of this kind of task to the task | 436 * Return a map from the names of the inputs of this kind of task to the task |
| 438 * input descriptors describing those inputs for a task with the | 437 * input descriptors describing those inputs for a task with the |
| 439 * given library [libSource]. | 438 * given library [libSource]. |
| 440 */ | 439 */ |
| 441 static Map<String, TaskInput> buildInputs(Source libSource) { | 440 static Map<String, TaskInput> buildInputs(Source libSource) { |
| 442 return <String, TaskInput>{ | 441 return <String, TaskInput>{ |
| 443 'defining_LIBRARY_ELEMENT1': LIBRARY_ELEMENT1.inputFor(libSource), | 442 'defining_LIBRARY_ELEMENT1': LIBRARY_ELEMENT1.of(libSource), |
| 444 UNIT_INPUT_NAME: | 443 UNIT_INPUT_NAME: |
| 445 RESOLVED_UNIT1.inputFor(new LibraryUnitTarget(libSource, libSource)), | 444 RESOLVED_UNIT1.of(new LibraryUnitTarget(libSource, libSource)), |
| 446 IMPORTS_LIBRARY_ELEMENT_INPUT_NAME: | 445 IMPORTS_LIBRARY_ELEMENT_INPUT_NAME: |
| 447 new ListToMapTaskInput<Source, LibraryElement>( | 446 IMPORTED_LIBRARIES.of(libSource).toMapOf(LIBRARY_ELEMENT1), |
| 448 IMPORTED_LIBRARIES.inputFor(libSource), | |
| 449 (Source source) => LIBRARY_ELEMENT1.inputFor(source)), | |
| 450 EXPORTS_LIBRARY_ELEMENT_INPUT_NAME: | 447 EXPORTS_LIBRARY_ELEMENT_INPUT_NAME: |
| 451 new ListToMapTaskInput<Source, LibraryElement>( | 448 EXPORTED_LIBRARIES.of(libSource).toMapOf(LIBRARY_ELEMENT1), |
| 452 EXPORTED_LIBRARIES.inputFor(libSource), | |
| 453 (Source source) => LIBRARY_ELEMENT1.inputFor(source)), | |
| 454 IMPORTS_SOURCE_KIND_INPUT_NAME: | 449 IMPORTS_SOURCE_KIND_INPUT_NAME: |
| 455 new ListToMapTaskInput<Source, SourceKind>( | 450 IMPORTED_LIBRARIES.of(libSource).toMapOf(SOURCE_KIND), |
| 456 IMPORTED_LIBRARIES.inputFor(libSource), | |
| 457 (Source source) => SOURCE_KIND.inputFor(source)), | |
| 458 EXPORTS_SOURCE_KIND_INPUT_NAME: | 451 EXPORTS_SOURCE_KIND_INPUT_NAME: |
| 459 new ListToMapTaskInput<Source, SourceKind>( | 452 EXPORTED_LIBRARIES.of(libSource).toMapOf(SOURCE_KIND) |
| 460 EXPORTED_LIBRARIES.inputFor(libSource), | |
| 461 (Source source) => SOURCE_KIND.inputFor(source)) | |
| 462 }; | 453 }; |
| 463 } | 454 } |
| 464 | 455 |
| 465 /** | 456 /** |
| 466 * Create a [BuildDirectiveElementsTask] based on the given [target] in | 457 * Create a [BuildDirectiveElementsTask] based on the given [target] in |
| 467 * the given [context]. | 458 * the given [context]. |
| 468 */ | 459 */ |
| 469 static BuildDirectiveElementsTask createTask( | 460 static BuildDirectiveElementsTask createTask( |
| 470 AnalysisContext context, AnalysisTarget target) { | 461 AnalysisContext context, AnalysisTarget target) { |
| 471 return new BuildDirectiveElementsTask(context, target); | 462 return new BuildDirectiveElementsTask(context, target); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 outputs[RESOLVED_UNIT2] = unit; | 537 outputs[RESOLVED_UNIT2] = unit; |
| 547 } | 538 } |
| 548 | 539 |
| 549 /** | 540 /** |
| 550 * Return a map from the names of the inputs of this kind of task to the task | 541 * Return a map from the names of the inputs of this kind of task to the task |
| 551 * input descriptors describing those inputs for a task with the | 542 * input descriptors describing those inputs for a task with the |
| 552 * given [target]. | 543 * given [target]. |
| 553 */ | 544 */ |
| 554 static Map<String, TaskInput> buildInputs(LibraryUnitTarget target) { | 545 static Map<String, TaskInput> buildInputs(LibraryUnitTarget target) { |
| 555 return <String, TaskInput>{ | 546 return <String, TaskInput>{ |
| 556 TYPE_PROVIDER_INPUT: | 547 TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request), |
| 557 TYPE_PROVIDER.inputFor(AnalysisContextTarget.request), | 548 UNIT_INPUT: RESOLVED_UNIT1.of(target) |
| 558 UNIT_INPUT: RESOLVED_UNIT1.inputFor(target) | |
| 559 }; | 549 }; |
| 560 } | 550 } |
| 561 | 551 |
| 562 /** | 552 /** |
| 563 * Create a [BuildEnumMemberElementsTask] based on the given [target] in | 553 * Create a [BuildEnumMemberElementsTask] based on the given [target] in |
| 564 * the given [context]. | 554 * the given [context]. |
| 565 */ | 555 */ |
| 566 static BuildEnumMemberElementsTask createTask( | 556 static BuildEnumMemberElementsTask createTask( |
| 567 AnalysisContext context, AnalysisTarget target) { | 557 AnalysisContext context, AnalysisTarget target) { |
| 568 return new BuildEnumMemberElementsTask(context, target); | 558 return new BuildEnumMemberElementsTask(context, target); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 outputs[LIBRARY_ELEMENT4] = library; | 606 outputs[LIBRARY_ELEMENT4] = library; |
| 617 } | 607 } |
| 618 | 608 |
| 619 /** | 609 /** |
| 620 * Return a map from the names of the inputs of this kind of task to the task | 610 * Return a map from the names of the inputs of this kind of task to the task |
| 621 * input descriptors describing those inputs for a task with the | 611 * input descriptors describing those inputs for a task with the |
| 622 * given library [libSource]. | 612 * given library [libSource]. |
| 623 */ | 613 */ |
| 624 static Map<String, TaskInput> buildInputs(Source libSource) { | 614 static Map<String, TaskInput> buildInputs(Source libSource) { |
| 625 return <String, TaskInput>{ | 615 return <String, TaskInput>{ |
| 626 LIBRARY_INPUT: LIBRARY_ELEMENT3.inputFor(libSource), | 616 LIBRARY_INPUT: LIBRARY_ELEMENT3.of(libSource), |
| 627 'exportsLibraryPublicNamespace': | 617 'exportsLibraryPublicNamespace': |
| 628 new ListToMapTaskInput<Source, LibraryElement>( | 618 EXPORT_SOURCE_CLOSURE.of(libSource).toMapOf(LIBRARY_ELEMENT3) |
| 629 EXPORT_SOURCE_CLOSURE.inputFor(libSource), | |
| 630 (Source source) => LIBRARY_ELEMENT3.inputFor(source)) | |
| 631 }; | 619 }; |
| 632 } | 620 } |
| 633 | 621 |
| 634 /** | 622 /** |
| 635 * Create a [BuildExportNamespaceTask] based on the given [target] in | 623 * Create a [BuildExportNamespaceTask] based on the given [target] in |
| 636 * the given [context]. | 624 * the given [context]. |
| 637 */ | 625 */ |
| 638 static BuildExportNamespaceTask createTask( | 626 static BuildExportNamespaceTask createTask( |
| 639 AnalysisContext context, AnalysisTarget target) { | 627 AnalysisContext context, AnalysisTarget target) { |
| 640 return new BuildExportNamespaceTask(context, target); | 628 return new BuildExportNamespaceTask(context, target); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 outputs[EXPORT_SOURCE_CLOSURE] = sources; | 667 outputs[EXPORT_SOURCE_CLOSURE] = sources; |
| 680 } | 668 } |
| 681 | 669 |
| 682 /** | 670 /** |
| 683 * Return a map from the names of the inputs of this kind of task to the task | 671 * Return a map from the names of the inputs of this kind of task to the task |
| 684 * input descriptors describing those inputs for a task with the | 672 * input descriptors describing those inputs for a task with the |
| 685 * given library [libSource]. | 673 * given library [libSource]. |
| 686 */ | 674 */ |
| 687 static Map<String, TaskInput> buildInputs(Source libSource) { | 675 static Map<String, TaskInput> buildInputs(Source libSource) { |
| 688 return <String, TaskInput>{ | 676 return <String, TaskInput>{ |
| 689 LIBRARY2_ELEMENT_INPUT: LIBRARY_ELEMENT2.inputFor(libSource) | 677 LIBRARY2_ELEMENT_INPUT: LIBRARY_ELEMENT2.of(libSource) |
| 690 }; | 678 }; |
| 691 } | 679 } |
| 692 | 680 |
| 693 /** | 681 /** |
| 694 * Create a [BuildExportSourceClosureTask] based on the given [target] in | 682 * Create a [BuildExportSourceClosureTask] based on the given [target] in |
| 695 * the given [context]. | 683 * the given [context]. |
| 696 */ | 684 */ |
| 697 static BuildExportSourceClosureTask createTask( | 685 static BuildExportSourceClosureTask createTask( |
| 698 AnalysisContext context, AnalysisTarget target) { | 686 AnalysisContext context, AnalysisTarget target) { |
| 699 return new BuildExportSourceClosureTask(context, target); | 687 return new BuildExportSourceClosureTask(context, target); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 772 outputs[RESOLVED_UNIT3] = unit; | 760 outputs[RESOLVED_UNIT3] = unit; |
| 773 } | 761 } |
| 774 | 762 |
| 775 /** | 763 /** |
| 776 * Return a map from the names of the inputs of this kind of task to the task | 764 * Return a map from the names of the inputs of this kind of task to the task |
| 777 * input descriptors describing those inputs for a task with the | 765 * input descriptors describing those inputs for a task with the |
| 778 * given [target]. | 766 * given [target]. |
| 779 */ | 767 */ |
| 780 static Map<String, TaskInput> buildInputs(LibraryUnitTarget target) { | 768 static Map<String, TaskInput> buildInputs(LibraryUnitTarget target) { |
| 781 return <String, TaskInput>{ | 769 return <String, TaskInput>{ |
| 782 TYPE_PROVIDER_INPUT: | 770 TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request), |
| 783 TYPE_PROVIDER.inputFor(AnalysisContextTarget.request), | 771 'importsExportNamespace': |
| 784 'importsExportNamespace': new ListToMapTaskInput<Source, LibraryElement>( | 772 IMPORTED_LIBRARIES.of(target.library).toMapOf(LIBRARY_ELEMENT4), |
| 785 IMPORTED_LIBRARIES.inputFor(target.library), | 773 LIBRARY_INPUT: LIBRARY_ELEMENT4.of(target.library), |
| 786 (Source importSource) => LIBRARY_ELEMENT4.inputFor(importSource)), | 774 UNIT_INPUT: RESOLVED_UNIT2.of(target) |
| 787 LIBRARY_INPUT: LIBRARY_ELEMENT4.inputFor(target.library), | |
| 788 UNIT_INPUT: RESOLVED_UNIT2.inputFor(target) | |
| 789 }; | 775 }; |
| 790 } | 776 } |
| 791 | 777 |
| 792 /** | 778 /** |
| 793 * Create a [BuildFunctionTypeAliasesTask] based on the given [target] in | 779 * Create a [BuildFunctionTypeAliasesTask] based on the given [target] in |
| 794 * the given [context]. | 780 * the given [context]. |
| 795 */ | 781 */ |
| 796 static BuildFunctionTypeAliasesTask createTask( | 782 static BuildFunctionTypeAliasesTask createTask( |
| 797 AnalysisContext context, AnalysisTarget target) { | 783 AnalysisContext context, AnalysisTarget target) { |
| 798 return new BuildFunctionTypeAliasesTask(context, target); | 784 return new BuildFunctionTypeAliasesTask(context, target); |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1039 } | 1025 } |
| 1040 | 1026 |
| 1041 /** | 1027 /** |
| 1042 * Return a map from the names of the inputs of this kind of task to the task | 1028 * Return a map from the names of the inputs of this kind of task to the task |
| 1043 * input descriptors describing those inputs for a task with the given | 1029 * input descriptors describing those inputs for a task with the given |
| 1044 * [libSource]. | 1030 * [libSource]. |
| 1045 */ | 1031 */ |
| 1046 static Map<String, TaskInput> buildInputs(Source libSource) { | 1032 static Map<String, TaskInput> buildInputs(Source libSource) { |
| 1047 return <String, TaskInput>{ | 1033 return <String, TaskInput>{ |
| 1048 DEFINING_UNIT_INPUT: | 1034 DEFINING_UNIT_INPUT: |
| 1049 RESOLVED_UNIT1.inputFor(new LibraryUnitTarget(libSource, libSource)), | 1035 RESOLVED_UNIT1.of(new LibraryUnitTarget(libSource, libSource)), |
| 1050 PARTS_UNIT_INPUT: new ListToListTaskInput<Source, CompilationUnit>( | 1036 PARTS_UNIT_INPUT: INCLUDED_PARTS.of(libSource).toList((Source unit) { |
| 1051 INCLUDED_PARTS.inputFor(libSource), (Source source) => | 1037 LibraryUnitTarget lut = new LibraryUnitTarget(libSource, unit); |
| 1052 RESOLVED_UNIT1.inputFor(new LibraryUnitTarget(libSource, source))) | 1038 return RESOLVED_UNIT1.of(lut); |
| 1039 }) |
| 1053 }; | 1040 }; |
| 1054 } | 1041 } |
| 1055 | 1042 |
| 1056 /** | 1043 /** |
| 1057 * Create a [BuildLibraryElementTask] based on the given [target] in the | 1044 * Create a [BuildLibraryElementTask] based on the given [target] in the |
| 1058 * given [context]. | 1045 * given [context]. |
| 1059 */ | 1046 */ |
| 1060 static BuildLibraryElementTask createTask( | 1047 static BuildLibraryElementTask createTask( |
| 1061 AnalysisContext context, AnalysisTarget target) { | 1048 AnalysisContext context, AnalysisTarget target) { |
| 1062 return new BuildLibraryElementTask(context, target); | 1049 return new BuildLibraryElementTask(context, target); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 1092 library.publicNamespace = new PublicNamespaceBuilder().build(library); | 1079 library.publicNamespace = new PublicNamespaceBuilder().build(library); |
| 1093 outputs[LIBRARY_ELEMENT3] = library; | 1080 outputs[LIBRARY_ELEMENT3] = library; |
| 1094 } | 1081 } |
| 1095 | 1082 |
| 1096 /** | 1083 /** |
| 1097 * Return a map from the names of the inputs of this kind of task to the task | 1084 * Return a map from the names of the inputs of this kind of task to the task |
| 1098 * input descriptors describing those inputs for a task with the | 1085 * input descriptors describing those inputs for a task with the |
| 1099 * given library [libSource]. | 1086 * given library [libSource]. |
| 1100 */ | 1087 */ |
| 1101 static Map<String, TaskInput> buildInputs(Source libSource) { | 1088 static Map<String, TaskInput> buildInputs(Source libSource) { |
| 1102 return <String, TaskInput>{ | 1089 return <String, TaskInput>{LIBRARY_INPUT: LIBRARY_ELEMENT2.of(libSource)}; |
| 1103 LIBRARY_INPUT: LIBRARY_ELEMENT2.inputFor(libSource) | |
| 1104 }; | |
| 1105 } | 1090 } |
| 1106 | 1091 |
| 1107 /** | 1092 /** |
| 1108 * Create a [BuildPublicNamespaceTask] based on the given [target] in | 1093 * Create a [BuildPublicNamespaceTask] based on the given [target] in |
| 1109 * the given [context]. | 1094 * the given [context]. |
| 1110 */ | 1095 */ |
| 1111 static BuildPublicNamespaceTask createTask( | 1096 static BuildPublicNamespaceTask createTask( |
| 1112 AnalysisContext context, AnalysisTarget target) { | 1097 AnalysisContext context, AnalysisTarget target) { |
| 1113 return new BuildPublicNamespaceTask(context, target); | 1098 return new BuildPublicNamespaceTask(context, target); |
| 1114 } | 1099 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1155 new TypeProviderImpl.forNamespaces(coreNamespace, asyncNamespace); | 1140 new TypeProviderImpl.forNamespaces(coreNamespace, asyncNamespace); |
| 1156 (context as ExtendedAnalysisContext).typeProvider = typeProvider; | 1141 (context as ExtendedAnalysisContext).typeProvider = typeProvider; |
| 1157 outputs[TYPE_PROVIDER] = typeProvider; | 1142 outputs[TYPE_PROVIDER] = typeProvider; |
| 1158 } | 1143 } |
| 1159 | 1144 |
| 1160 static Map<String, TaskInput> buildInputs(AnalysisContextTarget target) { | 1145 static Map<String, TaskInput> buildInputs(AnalysisContextTarget target) { |
| 1161 SourceFactory sourceFactory = target.context.sourceFactory; | 1146 SourceFactory sourceFactory = target.context.sourceFactory; |
| 1162 Source coreSource = sourceFactory.forUri(DartSdk.DART_CORE); | 1147 Source coreSource = sourceFactory.forUri(DartSdk.DART_CORE); |
| 1163 Source asyncSource = sourceFactory.forUri(DartSdk.DART_ASYNC); | 1148 Source asyncSource = sourceFactory.forUri(DartSdk.DART_ASYNC); |
| 1164 return <String, TaskInput>{ | 1149 return <String, TaskInput>{ |
| 1165 CORE_INPUT: LIBRARY_ELEMENT3.inputFor(coreSource), | 1150 CORE_INPUT: LIBRARY_ELEMENT3.of(coreSource), |
| 1166 ASYNC_INPUT: LIBRARY_ELEMENT3.inputFor(asyncSource) | 1151 ASYNC_INPUT: LIBRARY_ELEMENT3.of(asyncSource) |
| 1167 }; | 1152 }; |
| 1168 } | 1153 } |
| 1169 | 1154 |
| 1170 /** | 1155 /** |
| 1171 * Create a [BuildTypeProviderTask] based on the given [context]. | 1156 * Create a [BuildTypeProviderTask] based on the given [context]. |
| 1172 */ | 1157 */ |
| 1173 static BuildTypeProviderTask createTask( | 1158 static BuildTypeProviderTask createTask( |
| 1174 AnalysisContext context, AnalysisContextTarget target) { | 1159 AnalysisContext context, AnalysisContextTarget target) { |
| 1175 return new BuildTypeProviderTask(context, target); | 1160 return new BuildTypeProviderTask(context, target); |
| 1176 } | 1161 } |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1408 outputs[SOURCE_KIND] = sourceKind; | 1393 outputs[SOURCE_KIND] = sourceKind; |
| 1409 } | 1394 } |
| 1410 | 1395 |
| 1411 /** | 1396 /** |
| 1412 * Return a map from the names of the inputs of this kind of task to the task | 1397 * Return a map from the names of the inputs of this kind of task to the task |
| 1413 * input descriptors describing those inputs for a task with the given | 1398 * input descriptors describing those inputs for a task with the given |
| 1414 * [source]. | 1399 * [source]. |
| 1415 */ | 1400 */ |
| 1416 static Map<String, TaskInput> buildInputs(Source source) { | 1401 static Map<String, TaskInput> buildInputs(Source source) { |
| 1417 return <String, TaskInput>{ | 1402 return <String, TaskInput>{ |
| 1418 LINE_INFO_INPUT_NAME: LINE_INFO.inputFor(source), | 1403 LINE_INFO_INPUT_NAME: LINE_INFO.of(source), |
| 1419 TOKEN_STREAM_INPUT_NAME: TOKEN_STREAM.inputFor(source) | 1404 TOKEN_STREAM_INPUT_NAME: TOKEN_STREAM.of(source) |
| 1420 }; | 1405 }; |
| 1421 } | 1406 } |
| 1422 | 1407 |
| 1423 /** | 1408 /** |
| 1424 * Create a [ParseDartTask] based on the given [target] in the given | 1409 * Create a [ParseDartTask] based on the given [target] in the given |
| 1425 * [context]. | 1410 * [context]. |
| 1426 */ | 1411 */ |
| 1427 static ParseDartTask createTask( | 1412 static ParseDartTask createTask( |
| 1428 AnalysisContext context, AnalysisTarget target) { | 1413 AnalysisContext context, AnalysisTarget target) { |
| 1429 return new ParseDartTask(context, target); | 1414 return new ParseDartTask(context, target); |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1540 outputs[LIBRARY_ELEMENT5] = library; | 1525 outputs[LIBRARY_ELEMENT5] = library; |
| 1541 } | 1526 } |
| 1542 | 1527 |
| 1543 /** | 1528 /** |
| 1544 * Return a map from the names of the inputs of this kind of task to the task | 1529 * Return a map from the names of the inputs of this kind of task to the task |
| 1545 * input descriptors describing those inputs for a task with the | 1530 * input descriptors describing those inputs for a task with the |
| 1546 * given [target]. | 1531 * given [target]. |
| 1547 */ | 1532 */ |
| 1548 static Map<String, TaskInput> buildInputs(Source libSource) { | 1533 static Map<String, TaskInput> buildInputs(Source libSource) { |
| 1549 return <String, TaskInput>{ | 1534 return <String, TaskInput>{ |
| 1550 LIBRARY_INPUT: LIBRARY_ELEMENT4.inputFor(libSource), | 1535 LIBRARY_INPUT: LIBRARY_ELEMENT4.of(libSource), |
| 1551 'resolvedDefiningUnit': | 1536 'resolvedDefiningUnit': |
| 1552 RESOLVED_UNIT4.inputFor(new LibraryUnitTarget(libSource, libSource)), | 1537 RESOLVED_UNIT4.of(new LibraryUnitTarget(libSource, libSource)), |
| 1553 'resolvedPartsUnit': new ListToMapTaskInput<Source, CompilationUnit>( | 1538 'resolvedPartsUnit': INCLUDED_PARTS.of(libSource).toMap((Source source) => |
| 1554 INCLUDED_PARTS.inputFor(libSource), (Source source) => RESOLVED_UNIT4 | 1539 RESOLVED_UNIT4.of(new LibraryUnitTarget(libSource, source))) |
| 1555 .inputFor(new LibraryUnitTarget(libSource, source))), | |
| 1556 }; | 1540 }; |
| 1557 } | 1541 } |
| 1558 | 1542 |
| 1559 /** | 1543 /** |
| 1560 * Create a [ResolveLibraryTypeNamesTask] based on the given [target] in | 1544 * Create a [ResolveLibraryTypeNamesTask] based on the given [target] in |
| 1561 * the given [context]. | 1545 * the given [context]. |
| 1562 */ | 1546 */ |
| 1563 static ResolveLibraryTypeNamesTask createTask( | 1547 static ResolveLibraryTypeNamesTask createTask( |
| 1564 AnalysisContext context, AnalysisTarget target) { | 1548 AnalysisContext context, AnalysisTarget target) { |
| 1565 return new ResolveLibraryTypeNamesTask(context, target); | 1549 return new ResolveLibraryTypeNamesTask(context, target); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1612 outputs[RESOLVE_TYPE_NAMES_ERRORS] = errorListener.errors; | 1596 outputs[RESOLVE_TYPE_NAMES_ERRORS] = errorListener.errors; |
| 1613 outputs[RESOLVED_UNIT4] = unit; | 1597 outputs[RESOLVED_UNIT4] = unit; |
| 1614 } | 1598 } |
| 1615 | 1599 |
| 1616 /** | 1600 /** |
| 1617 * Return a map from the names of the inputs of this kind of task to the task | 1601 * Return a map from the names of the inputs of this kind of task to the task |
| 1618 * input descriptors describing those inputs for a task with the | 1602 * input descriptors describing those inputs for a task with the |
| 1619 * given [target]. | 1603 * given [target]. |
| 1620 */ | 1604 */ |
| 1621 static Map<String, TaskInput> buildInputs(LibraryUnitTarget target) { | 1605 static Map<String, TaskInput> buildInputs(LibraryUnitTarget target) { |
| 1622 return <String, TaskInput>{UNIT_INPUT: RESOLVED_UNIT3.inputFor(target)}; | 1606 return <String, TaskInput>{UNIT_INPUT: RESOLVED_UNIT3.of(target)}; |
| 1623 } | 1607 } |
| 1624 | 1608 |
| 1625 /** | 1609 /** |
| 1626 * Create a [ResolveUnitTypeNamesTask] based on the given [target] in | 1610 * Create a [ResolveUnitTypeNamesTask] based on the given [target] in |
| 1627 * the given [context]. | 1611 * the given [context]. |
| 1628 */ | 1612 */ |
| 1629 static ResolveUnitTypeNamesTask createTask( | 1613 static ResolveUnitTypeNamesTask createTask( |
| 1630 AnalysisContext context, AnalysisTarget target) { | 1614 AnalysisContext context, AnalysisTarget target) { |
| 1631 return new ResolveUnitTypeNamesTask(context, target); | 1615 return new ResolveUnitTypeNamesTask(context, target); |
| 1632 } | 1616 } |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1674 outputs[LINE_INFO] = new LineInfo(scanner.lineStarts); | 1658 outputs[LINE_INFO] = new LineInfo(scanner.lineStarts); |
| 1675 outputs[SCAN_ERRORS] = errorListener.getErrorsForSource(source); | 1659 outputs[SCAN_ERRORS] = errorListener.getErrorsForSource(source); |
| 1676 } | 1660 } |
| 1677 | 1661 |
| 1678 /** | 1662 /** |
| 1679 * Return a map from the names of the inputs of this kind of task to the task | 1663 * Return a map from the names of the inputs of this kind of task to the task |
| 1680 * input descriptors describing those inputs for a task with the given | 1664 * input descriptors describing those inputs for a task with the given |
| 1681 * [source]. | 1665 * [source]. |
| 1682 */ | 1666 */ |
| 1683 static Map<String, TaskInput> buildInputs(Source source) { | 1667 static Map<String, TaskInput> buildInputs(Source source) { |
| 1684 return <String, TaskInput>{CONTENT_INPUT_NAME: CONTENT.inputFor(source)}; | 1668 return <String, TaskInput>{CONTENT_INPUT_NAME: CONTENT.of(source)}; |
| 1685 } | 1669 } |
| 1686 | 1670 |
| 1687 /** | 1671 /** |
| 1688 * Create a [ScanDartTask] based on the given [target] in the given [context]. | 1672 * Create a [ScanDartTask] based on the given [target] in the given [context]. |
| 1689 */ | 1673 */ |
| 1690 static ScanDartTask createTask( | 1674 static ScanDartTask createTask( |
| 1691 AnalysisContext context, AnalysisTarget target) { | 1675 AnalysisContext context, AnalysisTarget target) { |
| 1692 return new ScanDartTask(context, target); | 1676 return new ScanDartTask(context, target); |
| 1693 } | 1677 } |
| 1694 } | 1678 } |
| OLD | NEW |