Chromium Code Reviews| 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/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; | 10 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 109 const ResultCachingPolicy<UsedImportedElements> USED_IMPORTED_ELEMENTS_POLICY = | 109 const ResultCachingPolicy<UsedImportedElements> USED_IMPORTED_ELEMENTS_POLICY = |
| 110 const SimpleResultCachingPolicy(-1, -1); | 110 const SimpleResultCachingPolicy(-1, -1); |
| 111 | 111 |
| 112 /** | 112 /** |
| 113 * The [ResultCachingPolicy] for [UsedLocalElements]s. | 113 * The [ResultCachingPolicy] for [UsedLocalElements]s. |
| 114 */ | 114 */ |
| 115 const ResultCachingPolicy<UsedLocalElements> USED_LOCAL_ELEMENTS_POLICY = | 115 const ResultCachingPolicy<UsedLocalElements> USED_LOCAL_ELEMENTS_POLICY = |
| 116 const SimpleResultCachingPolicy(-1, -1); | 116 const SimpleResultCachingPolicy(-1, -1); |
| 117 | 117 |
| 118 /** | 118 /** |
| 119 * The errors produced while resolving a library directives. | 119 * The errors produced while building a library directives. |
|
Brian Wilkerson
2017/01/12 21:34:07
"a library directives" -->
"library directives
| |
| 120 * | 120 * |
| 121 * The list will be empty if there were no errors, but will not be `null`. | 121 * The list will be empty if there were no errors, but will not be `null`. |
| 122 * | 122 * |
| 123 * The result is only available for [Source]s representing a library. | 123 * The result is only available for [Source]s representing a library. |
| 124 */ | 124 */ |
| 125 final ListResultDescriptor<AnalysisError> BUILD_DIRECTIVES_ERRORS = | 125 final ListResultDescriptor<AnalysisError> BUILD_DIRECTIVES_ERRORS = |
| 126 new ListResultDescriptor<AnalysisError>( | 126 new ListResultDescriptor<AnalysisError>( |
| 127 'BUILD_DIRECTIVES_ERRORS', AnalysisError.NO_ERRORS); | 127 'BUILD_DIRECTIVES_ERRORS', AnalysisError.NO_ERRORS); |
| 128 | |
| 129 /** | 128 /** |
| 130 * The errors produced while building a library element. | 129 * The errors produced while building a library element. |
| 131 * | 130 * |
| 132 * The list will be empty if there were no errors, but will not be `null`. | 131 * The list will be empty if there were no errors, but will not be `null`. |
| 133 * | 132 * |
| 134 * The result is only available for [Source]s representing a library. | 133 * The result is only available for [Source]s representing a library. |
| 135 */ | 134 */ |
| 136 final ListResultDescriptor<AnalysisError> BUILD_LIBRARY_ERRORS = | 135 final ListResultDescriptor<AnalysisError> BUILD_LIBRARY_ERRORS = |
| 137 new ListResultDescriptor<AnalysisError>( | 136 new ListResultDescriptor<AnalysisError>( |
| 138 'BUILD_LIBRARY_ERRORS', AnalysisError.NO_ERRORS); | 137 'BUILD_LIBRARY_ERRORS', AnalysisError.NO_ERRORS); |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 345 ]; | 344 ]; |
| 346 | 345 |
| 347 /** | 346 /** |
| 348 * All [AnalysisError]s results in for [LibrarySpecificUnit]s. | 347 * All [AnalysisError]s results in for [LibrarySpecificUnit]s. |
| 349 */ | 348 */ |
| 350 final List<ListResultDescriptor<AnalysisError>> ERROR_UNIT_RESULTS = | 349 final List<ListResultDescriptor<AnalysisError>> ERROR_UNIT_RESULTS = |
| 351 <ListResultDescriptor<AnalysisError>>[ | 350 <ListResultDescriptor<AnalysisError>>[ |
| 352 HINTS, | 351 HINTS, |
| 353 LIBRARY_UNIT_ERRORS, | 352 LIBRARY_UNIT_ERRORS, |
| 354 LINTS, | 353 LINTS, |
| 354 RESOLVE_DIRECTIVES_ERRORS, | |
| 355 RESOLVE_TYPE_BOUNDS_ERRORS, | 355 RESOLVE_TYPE_BOUNDS_ERRORS, |
| 356 RESOLVE_TYPE_NAMES_ERRORS, | 356 RESOLVE_TYPE_NAMES_ERRORS, |
| 357 RESOLVE_UNIT_ERRORS, | 357 RESOLVE_UNIT_ERRORS, |
| 358 STRONG_MODE_ERRORS, | 358 STRONG_MODE_ERRORS, |
| 359 VARIABLE_REFERENCE_ERRORS, | 359 VARIABLE_REFERENCE_ERRORS, |
| 360 VERIFY_ERRORS | 360 VERIFY_ERRORS |
| 361 ]; | 361 ]; |
| 362 | 362 |
| 363 /** | 363 /** |
| 364 * The sources representing the export closure of a library. | 364 * The sources representing the export closure of a library. |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 698 /** | 698 /** |
| 699 * The list of [ConstantEvaluationTarget]s on which error verification depends. | 699 * The list of [ConstantEvaluationTarget]s on which error verification depends. |
| 700 * | 700 * |
| 701 * The result is only available for [LibrarySpecificUnit]s. | 701 * The result is only available for [LibrarySpecificUnit]s. |
| 702 */ | 702 */ |
| 703 final ListResultDescriptor<ConstantEvaluationTarget> REQUIRED_CONSTANTS = | 703 final ListResultDescriptor<ConstantEvaluationTarget> REQUIRED_CONSTANTS = |
| 704 new ListResultDescriptor<ConstantEvaluationTarget>( | 704 new ListResultDescriptor<ConstantEvaluationTarget>( |
| 705 'REQUIRED_CONSTANTS', const <ConstantEvaluationTarget>[]); | 705 'REQUIRED_CONSTANTS', const <ConstantEvaluationTarget>[]); |
| 706 | 706 |
| 707 /** | 707 /** |
| 708 * The errors produced while resolving a library directives. | |
|
Brian Wilkerson
2017/01/12 21:34:07
Same here.
| |
| 709 * | |
| 710 * The list will be empty if there were no errors, but will not be `null`. | |
| 711 * | |
| 712 * The result is only available for [Source]s representing a library. | |
| 713 */ | |
| 714 final ListResultDescriptor<AnalysisError> RESOLVE_DIRECTIVES_ERRORS = | |
| 715 new ListResultDescriptor<AnalysisError>( | |
| 716 'RESOLVE_DIRECTIVES_ERRORS', AnalysisError.NO_ERRORS); | |
| 717 | |
| 718 /** | |
| 708 * The errors produced while resolving bounds of type parameters of classes, | 719 * The errors produced while resolving bounds of type parameters of classes, |
| 709 * class and function aliases. | 720 * class and function aliases. |
| 710 * | 721 * |
| 711 * The list will be empty if there were no errors, but will not be `null`. | 722 * The list will be empty if there were no errors, but will not be `null`. |
| 712 * | 723 * |
| 713 * The result is only available for [LibrarySpecificUnit]s. | 724 * The result is only available for [LibrarySpecificUnit]s. |
| 714 */ | 725 */ |
| 715 final ListResultDescriptor<AnalysisError> RESOLVE_TYPE_BOUNDS_ERRORS = | 726 final ListResultDescriptor<AnalysisError> RESOLVE_TYPE_BOUNDS_ERRORS = |
| 716 new ListResultDescriptor<AnalysisError>( | 727 new ListResultDescriptor<AnalysisError>( |
| 717 'RESOLVE_TYPE_BOUNDS_ERRORS', AnalysisError.NO_ERRORS); | 728 'RESOLVE_TYPE_BOUNDS_ERRORS', AnalysisError.NO_ERRORS); |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1225 importLibraryMap, | 1236 importLibraryMap, |
| 1226 importSourceKindMap, | 1237 importSourceKindMap, |
| 1227 exportLibraryMap, | 1238 exportLibraryMap, |
| 1228 exportSourceKindMap); | 1239 exportSourceKindMap); |
| 1229 libraryUnit.accept(builder); | 1240 libraryUnit.accept(builder); |
| 1230 // See the commentary in the computation of the LIBRARY_CYCLE result | 1241 // See the commentary in the computation of the LIBRARY_CYCLE result |
| 1231 // for details on library cycle invalidation. | 1242 // for details on library cycle invalidation. |
| 1232 libraryElement.invalidateLibraryCycles(); | 1243 libraryElement.invalidateLibraryCycles(); |
| 1233 errors = builder.errors; | 1244 errors = builder.errors; |
| 1234 } else { | 1245 } else { |
| 1235 DirectiveResolver resolver = new DirectiveResolver(); | 1246 DirectiveResolver resolver = new DirectiveResolver( |
| 1247 sourceModificationTimeMap, importSourceKindMap, exportSourceKindMap); | |
| 1236 libraryUnit.accept(resolver); | 1248 libraryUnit.accept(resolver); |
| 1249 errors = resolver.errors; | |
| 1237 } | 1250 } |
| 1238 // | 1251 // |
| 1239 // Record outputs. | 1252 // Record outputs. |
| 1240 // | 1253 // |
| 1241 outputs[LIBRARY_ELEMENT2] = libraryElement; | 1254 outputs[LIBRARY_ELEMENT2] = libraryElement; |
| 1242 outputs[BUILD_DIRECTIVES_ERRORS] = errors; | 1255 outputs[BUILD_DIRECTIVES_ERRORS] = errors; |
| 1243 } | 1256 } |
| 1244 | 1257 |
| 1245 /** | 1258 /** |
| 1246 * Return a map from the names of the inputs of this kind of task to the task | 1259 * Return a map from the names of the inputs of this kind of task to the task |
| (...skipping 2614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3861 */ | 3874 */ |
| 3862 static const String LINTS_INPUT = 'LINTS'; | 3875 static const String LINTS_INPUT = 'LINTS'; |
| 3863 | 3876 |
| 3864 /** | 3877 /** |
| 3865 * The name of the [STATIC_VARIABLE_RESOLUTION_ERRORS_IN_UNIT] input. | 3878 * The name of the [STATIC_VARIABLE_RESOLUTION_ERRORS_IN_UNIT] input. |
| 3866 */ | 3879 */ |
| 3867 static const String STATIC_VARIABLE_RESOLUTION_ERRORS_INPUT = | 3880 static const String STATIC_VARIABLE_RESOLUTION_ERRORS_INPUT = |
| 3868 'STATIC_VARIABLE_RESOLUTION_ERRORS_INPUT'; | 3881 'STATIC_VARIABLE_RESOLUTION_ERRORS_INPUT'; |
| 3869 | 3882 |
| 3870 /** | 3883 /** |
| 3884 * The name of the [RESOLVE_DIRECTIVES_ERRORS] input. | |
| 3885 */ | |
| 3886 static const String RESOLVE_DIRECTIVES_ERRORS_INPUT = | |
| 3887 'RESOLVE_DIRECTIVES_ERRORS'; | |
| 3888 | |
| 3889 /** | |
| 3871 * The name of the [STRONG_MODE_ERRORS] input. | 3890 * The name of the [STRONG_MODE_ERRORS] input. |
| 3872 */ | 3891 */ |
| 3873 static const String STRONG_MODE_ERRORS_INPUT = 'STRONG_MODE_ERRORS'; | 3892 static const String STRONG_MODE_ERRORS_INPUT = 'STRONG_MODE_ERRORS'; |
| 3874 | 3893 |
| 3875 /** | 3894 /** |
| 3876 * The name of the [RESOLVE_TYPE_NAMES_ERRORS] input. | 3895 * The name of the [RESOLVE_TYPE_NAMES_ERRORS] input. |
| 3877 */ | 3896 */ |
| 3878 static const String RESOLVE_TYPE_NAMES_ERRORS_INPUT = | 3897 static const String RESOLVE_TYPE_NAMES_ERRORS_INPUT = |
| 3879 'RESOLVE_TYPE_NAMES_ERRORS'; | 3898 'RESOLVE_TYPE_NAMES_ERRORS'; |
| 3880 | 3899 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3918 @override | 3937 @override |
| 3919 void internalPerform() { | 3938 void internalPerform() { |
| 3920 // | 3939 // |
| 3921 // Prepare inputs. | 3940 // Prepare inputs. |
| 3922 // | 3941 // |
| 3923 List<List<AnalysisError>> errorLists = <List<AnalysisError>>[]; | 3942 List<List<AnalysisError>> errorLists = <List<AnalysisError>>[]; |
| 3924 errorLists.add(getRequiredInput(BUILD_DIRECTIVES_ERRORS_INPUT)); | 3943 errorLists.add(getRequiredInput(BUILD_DIRECTIVES_ERRORS_INPUT)); |
| 3925 errorLists.add(getRequiredInput(BUILD_LIBRARY_ERRORS_INPUT)); | 3944 errorLists.add(getRequiredInput(BUILD_LIBRARY_ERRORS_INPUT)); |
| 3926 errorLists.add(getRequiredInput(HINTS_INPUT)); | 3945 errorLists.add(getRequiredInput(HINTS_INPUT)); |
| 3927 errorLists.add(getRequiredInput(LINTS_INPUT)); | 3946 errorLists.add(getRequiredInput(LINTS_INPUT)); |
| 3947 errorLists.add(getRequiredInput(RESOLVE_DIRECTIVES_ERRORS_INPUT)); | |
| 3928 errorLists.add(getRequiredInput(RESOLVE_TYPE_NAMES_ERRORS_INPUT)); | 3948 errorLists.add(getRequiredInput(RESOLVE_TYPE_NAMES_ERRORS_INPUT)); |
| 3929 errorLists.add(getRequiredInput(RESOLVE_TYPE_NAMES_ERRORS2_INPUT)); | 3949 errorLists.add(getRequiredInput(RESOLVE_TYPE_NAMES_ERRORS2_INPUT)); |
| 3930 errorLists.add(getRequiredInput(RESOLVE_UNIT_ERRORS_INPUT)); | 3950 errorLists.add(getRequiredInput(RESOLVE_UNIT_ERRORS_INPUT)); |
| 3931 errorLists.add(getRequiredInput(STATIC_VARIABLE_RESOLUTION_ERRORS_INPUT)); | 3951 errorLists.add(getRequiredInput(STATIC_VARIABLE_RESOLUTION_ERRORS_INPUT)); |
| 3932 errorLists.add(getRequiredInput(STRONG_MODE_ERRORS_INPUT)); | 3952 errorLists.add(getRequiredInput(STRONG_MODE_ERRORS_INPUT)); |
| 3933 errorLists.add(getRequiredInput(VARIABLE_REFERENCE_ERRORS_INPUT)); | 3953 errorLists.add(getRequiredInput(VARIABLE_REFERENCE_ERRORS_INPUT)); |
| 3934 errorLists.add(getRequiredInput(VERIFY_ERRORS_INPUT)); | 3954 errorLists.add(getRequiredInput(VERIFY_ERRORS_INPUT)); |
| 3935 // | 3955 // |
| 3936 // Record outputs. | 3956 // Record outputs. |
| 3937 // | 3957 // |
| 3938 outputs[LIBRARY_UNIT_ERRORS] = AnalysisError.mergeLists(errorLists); | 3958 outputs[LIBRARY_UNIT_ERRORS] = AnalysisError.mergeLists(errorLists); |
| 3939 } | 3959 } |
| 3940 | 3960 |
| 3941 /** | 3961 /** |
| 3942 * Return a map from the names of the inputs of this kind of task to the task | 3962 * Return a map from the names of the inputs of this kind of task to the task |
| 3943 * input descriptors describing those inputs for a task with the | 3963 * input descriptors describing those inputs for a task with the |
| 3944 * given [unit]. | 3964 * given [unit]. |
| 3945 */ | 3965 */ |
| 3946 static Map<String, TaskInput> buildInputs(AnalysisTarget target) { | 3966 static Map<String, TaskInput> buildInputs(AnalysisTarget target) { |
| 3947 LibrarySpecificUnit unit = target; | 3967 LibrarySpecificUnit unit = target; |
| 3948 Map<String, TaskInput> inputs = <String, TaskInput>{ | 3968 Map<String, TaskInput> inputs = <String, TaskInput>{ |
| 3949 HINTS_INPUT: HINTS.of(unit), | 3969 HINTS_INPUT: HINTS.of(unit), |
| 3950 LINTS_INPUT: LINTS.of(unit), | 3970 LINTS_INPUT: LINTS.of(unit), |
| 3971 RESOLVE_DIRECTIVES_ERRORS_INPUT: RESOLVE_DIRECTIVES_ERRORS.of(unit), | |
| 3951 RESOLVE_TYPE_NAMES_ERRORS_INPUT: RESOLVE_TYPE_NAMES_ERRORS.of(unit), | 3972 RESOLVE_TYPE_NAMES_ERRORS_INPUT: RESOLVE_TYPE_NAMES_ERRORS.of(unit), |
| 3952 RESOLVE_TYPE_NAMES_ERRORS2_INPUT: RESOLVE_TYPE_BOUNDS_ERRORS.of(unit), | 3973 RESOLVE_TYPE_NAMES_ERRORS2_INPUT: RESOLVE_TYPE_BOUNDS_ERRORS.of(unit), |
| 3953 RESOLVE_UNIT_ERRORS_INPUT: RESOLVE_UNIT_ERRORS.of(unit), | 3974 RESOLVE_UNIT_ERRORS_INPUT: RESOLVE_UNIT_ERRORS.of(unit), |
| 3954 STATIC_VARIABLE_RESOLUTION_ERRORS_INPUT: | 3975 STATIC_VARIABLE_RESOLUTION_ERRORS_INPUT: |
| 3955 STATIC_VARIABLE_RESOLUTION_ERRORS_IN_UNIT.of(unit), | 3976 STATIC_VARIABLE_RESOLUTION_ERRORS_IN_UNIT.of(unit), |
| 3956 STRONG_MODE_ERRORS_INPUT: STRONG_MODE_ERRORS.of(unit), | 3977 STRONG_MODE_ERRORS_INPUT: STRONG_MODE_ERRORS.of(unit), |
| 3957 VARIABLE_REFERENCE_ERRORS_INPUT: VARIABLE_REFERENCE_ERRORS.of(unit), | 3978 VARIABLE_REFERENCE_ERRORS_INPUT: VARIABLE_REFERENCE_ERRORS.of(unit), |
| 3958 VERIFY_ERRORS_INPUT: VERIFY_ERRORS.of(unit) | 3979 VERIFY_ERRORS_INPUT: VERIFY_ERRORS.of(unit) |
| 3959 }; | 3980 }; |
| 3960 Source source = unit.source; | 3981 Source source = unit.source; |
| (...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5010 /** | 5031 /** |
| 5011 * The name of the input whose value is the defining [LIBRARY_ELEMENT2]. | 5032 * The name of the input whose value is the defining [LIBRARY_ELEMENT2]. |
| 5012 */ | 5033 */ |
| 5013 static const String LIBRARY_INPUT = 'LIBRARY_INPUT'; | 5034 static const String LIBRARY_INPUT = 'LIBRARY_INPUT'; |
| 5014 | 5035 |
| 5015 /** | 5036 /** |
| 5016 * The name of the input for [RESOLVED_UNIT1] of a unit. | 5037 * The name of the input for [RESOLVED_UNIT1] of a unit. |
| 5017 */ | 5038 */ |
| 5018 static const String UNIT_INPUT = 'UNIT_INPUT'; | 5039 static const String UNIT_INPUT = 'UNIT_INPUT'; |
| 5019 | 5040 |
| 5041 static const String SOURCES_MODIFICATION_TIME_INPUT = | |
| 5042 'SOURCES_MODIFICATION_TIME_INPUT'; | |
| 5043 static const String IMPORTS_SOURCE_KIND_INPUT = 'IMPORTS_SOURCE_KIND_INPUT'; | |
| 5044 static const String EXPORTS_SOURCE_KIND_INPUT = 'EXPORTS_SOURCE_KIND_INPUT'; | |
| 5045 | |
| 5020 /** | 5046 /** |
| 5021 * The task descriptor describing this kind of task. | 5047 * The task descriptor describing this kind of task. |
| 5022 */ | 5048 */ |
| 5023 static final TaskDescriptor DESCRIPTOR = new TaskDescriptor( | 5049 static final TaskDescriptor DESCRIPTOR = new TaskDescriptor( |
| 5024 'ResolveDirectiveElementsTask', | 5050 'ResolveDirectiveElementsTask', |
| 5025 createTask, | 5051 createTask, |
| 5026 buildInputs, | 5052 buildInputs, <ResultDescriptor>[ |
| 5027 <ResultDescriptor>[CREATED_RESOLVED_UNIT2, RESOLVED_UNIT2]); | 5053 CREATED_RESOLVED_UNIT2, |
| 5054 RESOLVED_UNIT2, | |
| 5055 RESOLVE_DIRECTIVES_ERRORS | |
| 5056 ]); | |
| 5028 | 5057 |
| 5029 ResolveDirectiveElementsTask( | 5058 ResolveDirectiveElementsTask( |
| 5030 InternalAnalysisContext context, AnalysisTarget target) | 5059 InternalAnalysisContext context, AnalysisTarget target) |
| 5031 : super(context, target); | 5060 : super(context, target); |
| 5032 | 5061 |
| 5033 @override | 5062 @override |
| 5034 TaskDescriptor get descriptor => DESCRIPTOR; | 5063 TaskDescriptor get descriptor => DESCRIPTOR; |
| 5035 | 5064 |
| 5036 @override | 5065 @override |
| 5037 void internalPerform() { | 5066 void internalPerform() { |
| 5038 LibrarySpecificUnit targetUnit = target; | 5067 LibrarySpecificUnit targetUnit = target; |
| 5039 // | 5068 // |
| 5040 // Prepare inputs. | 5069 // Prepare inputs. |
| 5041 // | 5070 // |
| 5042 CompilationUnit unit = getRequiredInput(UNIT_INPUT); | 5071 CompilationUnit unit = getRequiredInput(UNIT_INPUT); |
| 5072 Map<Source, int> sourceModificationTimeMap = | |
| 5073 getRequiredInput(SOURCES_MODIFICATION_TIME_INPUT); | |
| 5074 Map<Source, SourceKind> importSourceKindMap = | |
| 5075 getRequiredInput(IMPORTS_SOURCE_KIND_INPUT); | |
| 5076 Map<Source, SourceKind> exportSourceKindMap = | |
| 5077 getRequiredInput(EXPORTS_SOURCE_KIND_INPUT); | |
| 5043 // | 5078 // |
| 5044 // Resolve directive AST nodes to elements. | 5079 // Resolve directive AST nodes to elements. |
| 5045 // | 5080 // |
| 5081 List<AnalysisError> errors = const <AnalysisError>[]; | |
| 5046 if (targetUnit.unit == targetUnit.library) { | 5082 if (targetUnit.unit == targetUnit.library) { |
| 5047 DirectiveResolver resolver = new DirectiveResolver(); | 5083 DirectiveResolver resolver = new DirectiveResolver( |
| 5084 sourceModificationTimeMap, importSourceKindMap, exportSourceKindMap); | |
| 5048 unit.accept(resolver); | 5085 unit.accept(resolver); |
| 5086 errors = resolver.errors; | |
| 5049 } | 5087 } |
| 5050 // | 5088 // |
| 5051 // Record outputs. | 5089 // Record outputs. |
| 5052 // | 5090 // |
| 5053 outputs[CREATED_RESOLVED_UNIT2] = true; | 5091 outputs[CREATED_RESOLVED_UNIT2] = true; |
| 5054 outputs[RESOLVED_UNIT2] = unit; | 5092 outputs[RESOLVED_UNIT2] = unit; |
| 5093 outputs[RESOLVE_DIRECTIVES_ERRORS] = errors; | |
| 5055 } | 5094 } |
| 5056 | 5095 |
| 5057 /** | 5096 /** |
| 5058 * Return a map from the names of the inputs of this kind of task to the task | 5097 * Return a map from the names of the inputs of this kind of task to the task |
| 5059 * input descriptors describing those inputs for a task with the | 5098 * input descriptors describing those inputs for a task with the |
| 5060 * given [target]. | 5099 * given [target]. |
| 5061 */ | 5100 */ |
| 5062 static Map<String, TaskInput> buildInputs(AnalysisTarget target) { | 5101 static Map<String, TaskInput> buildInputs(AnalysisTarget target) { |
| 5063 LibrarySpecificUnit unit = target; | 5102 LibrarySpecificUnit unit = target; |
| 5064 return <String, TaskInput>{ | 5103 return <String, TaskInput>{ |
| 5065 LIBRARY_INPUT: LIBRARY_ELEMENT2.of(unit.library), | 5104 LIBRARY_INPUT: LIBRARY_ELEMENT2.of(unit.library), |
| 5066 UNIT_INPUT: RESOLVED_UNIT1.of(unit) | 5105 UNIT_INPUT: RESOLVED_UNIT1.of(unit), |
| 5106 SOURCES_MODIFICATION_TIME_INPUT: | |
| 5107 REFERENCED_SOURCES.of(unit.library).toMapOf(MODIFICATION_TIME), | |
| 5108 IMPORTS_SOURCE_KIND_INPUT: | |
| 5109 IMPORTED_LIBRARIES.of(unit.library).toMapOf(SOURCE_KIND), | |
| 5110 EXPORTS_SOURCE_KIND_INPUT: | |
| 5111 EXPORTED_LIBRARIES.of(unit.library).toMapOf(SOURCE_KIND) | |
| 5067 }; | 5112 }; |
| 5068 } | 5113 } |
| 5069 | 5114 |
| 5070 /** | 5115 /** |
| 5071 * Create a [ResolveDirectiveElementsTask] based on the given [target] in | 5116 * Create a [ResolveDirectiveElementsTask] based on the given [target] in |
| 5072 * the given [context]. | 5117 * the given [context]. |
| 5073 */ | 5118 */ |
| 5074 static ResolveDirectiveElementsTask createTask( | 5119 static ResolveDirectiveElementsTask createTask( |
| 5075 AnalysisContext context, AnalysisTarget target) { | 5120 AnalysisContext context, AnalysisTarget target) { |
| 5076 return new ResolveDirectiveElementsTask(context, target); | 5121 return new ResolveDirectiveElementsTask(context, target); |
| (...skipping 1429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6506 | 6551 |
| 6507 @override | 6552 @override |
| 6508 bool moveNext() { | 6553 bool moveNext() { |
| 6509 if (_newSources.isEmpty) { | 6554 if (_newSources.isEmpty) { |
| 6510 return false; | 6555 return false; |
| 6511 } | 6556 } |
| 6512 currentTarget = _newSources.removeLast(); | 6557 currentTarget = _newSources.removeLast(); |
| 6513 return true; | 6558 return true; |
| 6514 } | 6559 } |
| 6515 } | 6560 } |
| OLD | NEW |