| 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): |
| 11 * - Add general.dart and html.dart for completeness. | 11 * - Add general.dart and html.dart for completeness. |
| 12 * - Use Graphviz's "record" feature to produce more compact output | 12 * - Use Graphviz's "record" feature to produce more compact output |
| 13 * (http://www.graphviz.org/content/node-shapes#record) | 13 * (http://www.graphviz.org/content/node-shapes#record) |
| 14 * - Produce a warning if a result descriptor is found which isn't the output | 14 * - Produce a warning if a result descriptor is found which isn't the output |
| 15 * of exactly one task. | 15 * of exactly one task. |
| 16 * - Convert this tool to use package_config to find the package map. | 16 * - Convert this tool to use package_config to find the package map. |
| 17 */ | 17 */ |
| 18 library analyzer.tool.task_dependency_graph.generate; | 18 library analyzer.tool.task_dependency_graph.generate; |
| 19 | 19 |
| 20 import 'dart:io' hide File; | 20 import 'dart:io' hide File; |
| 21 import 'dart:io' as io; | 21 import 'dart:io' as io; |
| 22 | 22 |
| 23 import 'package:analyzer/analyzer.dart'; | 23 import 'package:analyzer/analyzer.dart'; |
| 24 import 'package:analyzer/dart/element/element.dart'; | 24 import 'package:analyzer/dart/element/element.dart'; |
| 25 import 'package:analyzer/dart/element/type.dart'; | 25 import 'package:analyzer/dart/element/type.dart'; |
| 26 import 'package:analyzer/file_system/file_system.dart'; | 26 import 'package:analyzer/file_system/file_system.dart'; |
| 27 import 'package:analyzer/file_system/physical_file_system.dart'; | 27 import 'package:analyzer/file_system/physical_file_system.dart'; |
| 28 import 'package:analyzer/source/package_map_resolver.dart'; | 28 import 'package:analyzer/source/package_map_resolver.dart'; |
| 29 import 'package:analyzer/src/codegen/tools.dart'; | |
| 30 import 'package:analyzer/src/context/builder.dart'; | 29 import 'package:analyzer/src/context/builder.dart'; |
| 31 import 'package:analyzer/src/dart/sdk/sdk.dart'; | 30 import 'package:analyzer/src/dart/sdk/sdk.dart'; |
| 32 import 'package:analyzer/src/generated/constant.dart'; | 31 import 'package:analyzer/src/generated/constant.dart'; |
| 33 import 'package:analyzer/src/generated/engine.dart'; | 32 import 'package:analyzer/src/generated/engine.dart'; |
| 34 import 'package:analyzer/src/generated/sdk.dart'; | 33 import 'package:analyzer/src/generated/sdk.dart'; |
| 35 import 'package:analyzer/src/generated/source.dart'; | 34 import 'package:analyzer/src/generated/source.dart'; |
| 36 import 'package:analyzer/src/generated/source_io.dart'; | 35 import 'package:analyzer/src/generated/source_io.dart'; |
| 36 import 'package:front_end/src/codegen/tools.dart'; |
| 37 import 'package:path/path.dart' as path; | 37 import 'package:path/path.dart' as path; |
| 38 import 'package:path/path.dart'; | 38 import 'package:path/path.dart'; |
| 39 | 39 |
| 40 /** | 40 /** |
| 41 * Generate the target .dot file. | 41 * Generate the target .dot file. |
| 42 */ | 42 */ |
| 43 main() { | 43 main() { |
| 44 String script = Platform.script.toFilePath(windows: Platform.isWindows); | 44 String script = Platform.script.toFilePath(windows: Platform.isWindows); |
| 45 String pkgPath = normalize(join(dirname(script), '..', '..')); | 45 String pkgPath = normalize(join(dirname(script), '..', '..')); |
| 46 GeneratedContent.generateAll(pkgPath, <GeneratedContent>[target, htmlTarget]); | 46 GeneratedContent.generateAll(pkgPath, <GeneratedContent>[target, htmlTarget]); |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 @override | 374 @override |
| 375 visitIdentifier(Identifier node) { | 375 visitIdentifier(Identifier node) { |
| 376 Element element = node.staticElement; | 376 Element element = node.staticElement; |
| 377 if (element is PropertyAccessorElement && | 377 if (element is PropertyAccessorElement && |
| 378 element.isGetter && | 378 element.isGetter && |
| 379 element.returnType.isSubtypeOf(type)) { | 379 element.returnType.isSubtypeOf(type)) { |
| 380 callback(element); | 380 callback(element); |
| 381 } | 381 } |
| 382 } | 382 } |
| 383 } | 383 } |
| OLD | NEW |