| 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 /** | 5 /** |
| 6 * This file contains code to output a description of tasks and their | 6 * This file contains code to output a description of tasks and their |
| 7 * dependencies in ".dot" format. Prior to running, the user should run "pub | 7 * dependencies in ".dot" format. Prior to running, the user should run "pub |
| 8 * get" in the analyzer directory to ensure that a "packages" folder exists. | 8 * get" in the analyzer directory to ensure that a "packages" folder exists. |
| 9 * | 9 * |
| 10 * TODO(paulberry): | 10 * TODO(paulberry): |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 import 'package:analyzer/src/generated/source_io.dart'; | 34 import 'package:analyzer/src/generated/source_io.dart'; |
| 35 import 'package:path/path.dart' as path; | 35 import 'package:path/path.dart' as path; |
| 36 import 'package:path/path.dart'; | 36 import 'package:path/path.dart'; |
| 37 | 37 |
| 38 /** | 38 /** |
| 39 * Generate the target .dot file. | 39 * Generate the target .dot file. |
| 40 */ | 40 */ |
| 41 main() { | 41 main() { |
| 42 String script = Platform.script.toFilePath(windows: Platform.isWindows); | 42 String script = Platform.script.toFilePath(windows: Platform.isWindows); |
| 43 String pkgPath = normalize(join(dirname(script), '..', '..')); | 43 String pkgPath = normalize(join(dirname(script), '..', '..')); |
| 44 target.generate(pkgPath); | 44 GeneratedContent.generateAll(pkgPath, <GeneratedContent>[target]); |
| 45 } | 45 } |
| 46 | 46 |
| 47 final GeneratedFile target = new GeneratedFile( | 47 final GeneratedFile target = new GeneratedFile( |
| 48 'tool/task_dependency_graph/tasks.dot', | 48 'tool/task_dependency_graph/tasks.dot', |
| 49 (String pkgPath) => new Driver(pkgPath).generateFileContents()); | 49 (String pkgPath) => new Driver(pkgPath).generateFileContents()); |
| 50 | 50 |
| 51 typedef void GetterFinderCallback(PropertyAccessorElement element); | 51 typedef void GetterFinderCallback(PropertyAccessorElement element); |
| 52 | 52 |
| 53 class Driver { | 53 class Driver { |
| 54 PhysicalResourceProvider resourceProvider; | 54 PhysicalResourceProvider resourceProvider; |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 @override | 309 @override |
| 310 visitIdentifier(Identifier node) { | 310 visitIdentifier(Identifier node) { |
| 311 Element element = node.staticElement; | 311 Element element = node.staticElement; |
| 312 if (element is PropertyAccessorElement && | 312 if (element is PropertyAccessorElement && |
| 313 element.isGetter && | 313 element.isGetter && |
| 314 element.returnType.isSubtypeOf(type)) { | 314 element.returnType.isSubtypeOf(type)) { |
| 315 callback(element); | 315 callback(element); |
| 316 } | 316 } |
| 317 } | 317 } |
| 318 } | 318 } |
| OLD | NEW |