| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 String packageRootPath; | 155 String packageRootPath; |
| 156 if (Platform.packageRoot != null) { | 156 if (Platform.packageRoot != null) { |
| 157 packageRootPath = Uri.parse(Platform.packageRoot).toFilePath(); | 157 packageRootPath = Uri.parse(Platform.packageRoot).toFilePath(); |
| 158 } else { | 158 } else { |
| 159 packageRootPath = path.join(rootDir, 'packages'); | 159 packageRootPath = path.join(rootDir, 'packages'); |
| 160 } | 160 } |
| 161 JavaFile packagesDir = new JavaFile(packageRootPath); | 161 JavaFile packagesDir = new JavaFile(packageRootPath); |
| 162 List<UriResolver> uriResolvers = [ | 162 List<UriResolver> uriResolvers = [ |
| 163 new DartUriResolver(sdk), | 163 new DartUriResolver(sdk), |
| 164 new PackageUriResolver(<JavaFile>[packagesDir]), | 164 new PackageUriResolver(<JavaFile>[packagesDir]), |
| 165 new FileUriResolver() | 165 new ResourceUriResolver(PhysicalResourceProvider.INSTANCE) |
| 166 ]; | 166 ]; |
| 167 context.sourceFactory = new SourceFactory(uriResolvers); | 167 context.sourceFactory = new SourceFactory(uriResolvers); |
| 168 Source dartDartSource = | 168 Source dartDartSource = |
| 169 setupSource(path.join('lib', 'src', 'task', 'dart.dart')); | 169 setupSource(path.join('lib', 'src', 'task', 'dart.dart')); |
| 170 Source taskSource = setupSource(path.join('lib', 'plugin', 'task.dart')); | 170 Source taskSource = setupSource(path.join('lib', 'plugin', 'task.dart')); |
| 171 Source modelSource = setupSource(path.join('lib', 'task', 'model.dart')); | 171 Source modelSource = setupSource(path.join('lib', 'task', 'model.dart')); |
| 172 Source enginePluginSource = | 172 Source enginePluginSource = |
| 173 setupSource(path.join('lib', 'src', 'plugin', 'engine_plugin.dart')); | 173 setupSource(path.join('lib', 'src', 'plugin', 'engine_plugin.dart')); |
| 174 CompilationUnitElement modelElement = getUnit(modelSource).element; | 174 CompilationUnitElement modelElement = getUnit(modelSource).element; |
| 175 InterfaceType analysisTaskType = modelElement.getType('AnalysisTask').type; | 175 InterfaceType analysisTaskType = modelElement.getType('AnalysisTask').type; |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 @override | 349 @override |
| 350 visitIdentifier(Identifier node) { | 350 visitIdentifier(Identifier node) { |
| 351 Element element = node.staticElement; | 351 Element element = node.staticElement; |
| 352 if (element is PropertyAccessorElement && | 352 if (element is PropertyAccessorElement && |
| 353 element.isGetter && | 353 element.isGetter && |
| 354 element.returnType.isSubtypeOf(type)) { | 354 element.returnType.isSubtypeOf(type)) { |
| 355 callback(element); | 355 callback(element); |
| 356 } | 356 } |
| 357 } | 357 } |
| 358 } | 358 } |
| OLD | NEW |