| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 * Generate the task dependency graph and return it as a [String]. | 121 * Generate the task dependency graph and return it as a [String]. |
| 122 */ | 122 */ |
| 123 String generateFileContents() { | 123 String generateFileContents() { |
| 124 AnalysisEngine.instance.processRequiredPlugins(); | 124 AnalysisEngine.instance.processRequiredPlugins(); |
| 125 List<String> lines = <String>[]; | 125 List<String> lines = <String>[]; |
| 126 resourceProvider = PhysicalResourceProvider.INSTANCE; | 126 resourceProvider = PhysicalResourceProvider.INSTANCE; |
| 127 DartSdk sdk = DirectoryBasedDartSdk.defaultSdk; | 127 DartSdk sdk = DirectoryBasedDartSdk.defaultSdk; |
| 128 context = AnalysisEngine.instance.createAnalysisContext(); | 128 context = AnalysisEngine.instance.createAnalysisContext(); |
| 129 String packageRootPath; | 129 String packageRootPath; |
| 130 if (Platform.packageRoot.isNotEmpty) { | 130 if (Platform.packageRoot.isNotEmpty) { |
| 131 packageRootPath = Platform.packageRoot; | 131 Uri packageRootUri = Uri.parse(Platform.packageRoot); |
| 132 packageRootPath = packageRootUri.toFilePath(); |
| 132 } else { | 133 } else { |
| 133 packageRootPath = path.join(rootDir, 'packages'); | 134 packageRootPath = path.join(rootDir, 'packages'); |
| 134 } | 135 } |
| 135 JavaFile packagesDir = new JavaFile(packageRootPath); | 136 JavaFile packagesDir = new JavaFile(packageRootPath); |
| 136 List<UriResolver> uriResolvers = [ | 137 List<UriResolver> uriResolvers = [ |
| 137 new DartUriResolver(sdk), | 138 new DartUriResolver(sdk), |
| 138 new PackageUriResolver(<JavaFile>[packagesDir]), | 139 new PackageUriResolver(<JavaFile>[packagesDir]), |
| 139 new FileUriResolver() | 140 new FileUriResolver() |
| 140 ]; | 141 ]; |
| 141 context.sourceFactory = new SourceFactory(uriResolvers); | 142 context.sourceFactory = new SourceFactory(uriResolvers); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 @override | 312 @override |
| 312 visitIdentifier(Identifier node) { | 313 visitIdentifier(Identifier node) { |
| 313 Element element = node.staticElement; | 314 Element element = node.staticElement; |
| 314 if (element is PropertyAccessorElement && | 315 if (element is PropertyAccessorElement && |
| 315 element.isGetter && | 316 element.isGetter && |
| 316 element.returnType.isSubtypeOf(type)) { | 317 element.returnType.isSubtypeOf(type)) { |
| 317 callback(element); | 318 callback(element); |
| 318 } | 319 } |
| 319 } | 320 } |
| 320 } | 321 } |
| OLD | NEW |