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