| 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/context/cache.dart'; | 10 import 'package:analyzer/src/context/cache.dart'; |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 outputs[CONSTRUCTORS_ERRORS] = errors; | 494 outputs[CONSTRUCTORS_ERRORS] = errors; |
| 495 } | 495 } |
| 496 } | 496 } |
| 497 | 497 |
| 498 /** | 498 /** |
| 499 * Return a map from the names of the inputs of this kind of task to the task | 499 * Return a map from the names of the inputs of this kind of task to the task |
| 500 * input descriptors describing those inputs for a task with the | 500 * input descriptors describing those inputs for a task with the |
| 501 * given [classElement]. | 501 * given [classElement]. |
| 502 */ | 502 */ |
| 503 static Map<String, TaskInput> buildInputs(ClassElement classElement) { | 503 static Map<String, TaskInput> buildInputs(ClassElement classElement) { |
| 504 // TODO(scheglov) Here we implicitly depend on LIBRARY_ELEMENT5, i.e. that | 504 Source librarySource = classElement.library.source; |
| 505 // "supertype" for the "classElement" is set. | |
| 506 // We need to make it an explicit dependency. | |
| 507 DartType superType = classElement.supertype; | 505 DartType superType = classElement.supertype; |
| 508 if (superType is InterfaceType) { | 506 if (superType is InterfaceType) { |
| 509 if (classElement.isTypedef || classElement.mixins.isNotEmpty) { | 507 if (classElement.isTypedef || classElement.mixins.isNotEmpty) { |
| 510 ClassElement superElement = superType.element; | 508 ClassElement superElement = superType.element; |
| 511 return <String, TaskInput>{ | 509 return <String, TaskInput>{ |
| 510 'libraryDep': LIBRARY_ELEMENT5.of(librarySource), |
| 512 SUPER_CONSTRUCTORS: CONSTRUCTORS.of(superElement) | 511 SUPER_CONSTRUCTORS: CONSTRUCTORS.of(superElement) |
| 513 }; | 512 }; |
| 514 } | 513 } |
| 515 } | 514 } |
| 516 // No implicit constructors, no inputs required. | 515 // No implicit constructors. |
| 517 return <String, TaskInput>{}; | 516 // Depend on LIBRARY_ELEMENT5 for invalidation. |
| 517 return <String, TaskInput>{ |
| 518 'libraryDep': LIBRARY_ELEMENT5.of(librarySource) |
| 519 }; |
| 518 } | 520 } |
| 519 | 521 |
| 520 /** | 522 /** |
| 521 * Create a [BuildClassConstructorsTask] based on the given | 523 * Create a [BuildClassConstructorsTask] based on the given |
| 522 * [target] in the given [context]. | 524 * [target] in the given [context]. |
| 523 */ | 525 */ |
| 524 static BuildClassConstructorsTask createTask( | 526 static BuildClassConstructorsTask createTask( |
| 525 AnalysisContext context, AnalysisTarget target) { | 527 AnalysisContext context, AnalysisTarget target) { |
| 526 return new BuildClassConstructorsTask(context, target); | 528 return new BuildClassConstructorsTask(context, target); |
| 527 } | 529 } |
| (...skipping 2831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3359 @override | 3361 @override |
| 3360 bool moveNext() { | 3362 bool moveNext() { |
| 3361 if (_newSources.isEmpty) { | 3363 if (_newSources.isEmpty) { |
| 3362 return false; | 3364 return false; |
| 3363 } | 3365 } |
| 3364 currentTarget = _newSources.first; | 3366 currentTarget = _newSources.first; |
| 3365 _newSources.remove(currentTarget); | 3367 _newSources.remove(currentTarget); |
| 3366 return true; | 3368 return true; |
| 3367 } | 3369 } |
| 3368 } | 3370 } |
| OLD | NEW |