| 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 16 matching lines...) Expand all Loading... |
| 27 import 'package:analyzer/src/generated/constant.dart'; | 27 import 'package:analyzer/src/generated/constant.dart'; |
| 28 import 'package:analyzer/src/generated/element.dart'; | 28 import 'package:analyzer/src/generated/element.dart'; |
| 29 import 'package:analyzer/src/generated/engine.dart'; | 29 import 'package:analyzer/src/generated/engine.dart'; |
| 30 import 'package:analyzer/src/generated/java_io.dart'; | 30 import 'package:analyzer/src/generated/java_io.dart'; |
| 31 import 'package:analyzer/src/generated/sdk.dart'; | 31 import 'package:analyzer/src/generated/sdk.dart'; |
| 32 import 'package:analyzer/src/generated/sdk_io.dart'; | 32 import 'package:analyzer/src/generated/sdk_io.dart'; |
| 33 import 'package:analyzer/src/generated/source.dart'; | 33 import 'package:analyzer/src/generated/source.dart'; |
| 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 import 'package:plugin/manager.dart'; |
| 37 | 38 |
| 38 /** | 39 /** |
| 39 * Generate the target .dot file. | 40 * Generate the target .dot file. |
| 40 */ | 41 */ |
| 41 main() { | 42 main() { |
| 42 String script = Platform.script.toFilePath(windows: Platform.isWindows); | 43 String script = Platform.script.toFilePath(windows: Platform.isWindows); |
| 43 String pkgPath = normalize(join(dirname(script), '..', '..')); | 44 String pkgPath = normalize(join(dirname(script), '..', '..')); |
| 44 GeneratedContent.generateAll(pkgPath, <GeneratedContent>[target]); | 45 GeneratedContent.generateAll(pkgPath, <GeneratedContent>[target]); |
| 45 } | 46 } |
| 46 | 47 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 node.accept(new GetterFinder(resultDescriptorType, resultDescriptors.add)); | 114 node.accept(new GetterFinder(resultDescriptorType, resultDescriptors.add)); |
| 114 for (PropertyAccessorElement resultDescriptor in resultDescriptors) { | 115 for (PropertyAccessorElement resultDescriptor in resultDescriptors) { |
| 115 callback(resultDescriptor.name); | 116 callback(resultDescriptor.name); |
| 116 } | 117 } |
| 117 } | 118 } |
| 118 | 119 |
| 119 /** | 120 /** |
| 120 * Generate the task dependency graph and return it as a [String]. | 121 * Generate the task dependency graph and return it as a [String]. |
| 121 */ | 122 */ |
| 122 String generateFileContents() { | 123 String generateFileContents() { |
| 124 ExtensionManager extensionManager = new ExtensionManager(); |
| 125 extensionManager.processPlugins(AnalysisEngine.instance.supportedPlugins); |
| 126 |
| 123 List<String> lines = <String>[]; | 127 List<String> lines = <String>[]; |
| 124 resourceProvider = PhysicalResourceProvider.INSTANCE; | 128 resourceProvider = PhysicalResourceProvider.INSTANCE; |
| 125 DartSdk sdk = DirectoryBasedDartSdk.defaultSdk; | 129 DartSdk sdk = DirectoryBasedDartSdk.defaultSdk; |
| 126 context = AnalysisEngine.instance.createAnalysisContext(); | 130 context = AnalysisEngine.instance.createAnalysisContext(); |
| 127 String packageRootPath; | 131 String packageRootPath; |
| 128 if (Platform.packageRoot.isNotEmpty) { | 132 if (Platform.packageRoot.isNotEmpty) { |
| 129 packageRootPath = Platform.packageRoot; | 133 packageRootPath = Platform.packageRoot; |
| 130 } else { | 134 } else { |
| 131 packageRootPath = path.join(rootDir, 'packages'); | 135 packageRootPath = path.join(rootDir, 'packages'); |
| 132 } | 136 } |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 @override | 313 @override |
| 310 visitIdentifier(Identifier node) { | 314 visitIdentifier(Identifier node) { |
| 311 Element element = node.staticElement; | 315 Element element = node.staticElement; |
| 312 if (element is PropertyAccessorElement && | 316 if (element is PropertyAccessorElement && |
| 313 element.isGetter && | 317 element.isGetter && |
| 314 element.returnType.isSubtypeOf(type)) { | 318 element.returnType.isSubtypeOf(type)) { |
| 315 callback(element); | 319 callback(element); |
| 316 } | 320 } |
| 317 } | 321 } |
| 318 } | 322 } |
| OLD | NEW |