| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 String generateGraphData() { | 147 String generateGraphData() { |
| 148 if (!hasInitializedPlugins) { | 148 if (!hasInitializedPlugins) { |
| 149 AnalysisEngine.instance.processRequiredPlugins(); | 149 AnalysisEngine.instance.processRequiredPlugins(); |
| 150 hasInitializedPlugins = true; | 150 hasInitializedPlugins = true; |
| 151 } | 151 } |
| 152 List<String> lines = <String>[]; | 152 List<String> lines = <String>[]; |
| 153 resourceProvider = PhysicalResourceProvider.INSTANCE; | 153 resourceProvider = PhysicalResourceProvider.INSTANCE; |
| 154 DartSdk sdk = new FolderBasedDartSdk(resourceProvider, | 154 DartSdk sdk = new FolderBasedDartSdk(resourceProvider, |
| 155 FolderBasedDartSdk.defaultSdkDirectory(resourceProvider)); | 155 FolderBasedDartSdk.defaultSdkDirectory(resourceProvider)); |
| 156 context = AnalysisEngine.instance.createAnalysisContext(); | 156 context = AnalysisEngine.instance.createAnalysisContext(); |
| 157 ContextBuilder builder = new ContextBuilder(resourceProvider, null, null); | 157 ContextBuilderOptions builderOptions = new ContextBuilderOptions(); |
| 158 if (Platform.packageRoot != null) { | 158 if (Platform.packageRoot != null) { |
| 159 builder.defaultPackagesDirectoryPath = | 159 builderOptions.defaultPackagesDirectoryPath = |
| 160 Uri.parse(Platform.packageRoot).toFilePath(); | 160 Uri.parse(Platform.packageRoot).toFilePath(); |
| 161 } else if (Platform.packageConfig != null) { | 161 } else if (Platform.packageConfig != null) { |
| 162 builder.defaultPackageFilePath = | 162 builderOptions.defaultPackageFilePath = |
| 163 Uri.parse(Platform.packageConfig).toFilePath(); | 163 Uri.parse(Platform.packageConfig).toFilePath(); |
| 164 } else { | 164 } else { |
| 165 // Let the context builder use the default algorithm for package | 165 // Let the context builder use the default algorithm for package |
| 166 // resolution. | 166 // resolution. |
| 167 } | 167 } |
| 168 ContextBuilder builder = new ContextBuilder(resourceProvider, null, null, |
| 169 options: builderOptions); |
| 168 List<UriResolver> uriResolvers = [ | 170 List<UriResolver> uriResolvers = [ |
| 169 new DartUriResolver(sdk), | 171 new DartUriResolver(sdk), |
| 170 new PackageMapUriResolver(resourceProvider, | 172 new PackageMapUriResolver(resourceProvider, |
| 171 builder.convertPackagesToMap(builder.createPackageMap(''))), | 173 builder.convertPackagesToMap(builder.createPackageMap(''))), |
| 172 new ResourceUriResolver(PhysicalResourceProvider.INSTANCE) | 174 new ResourceUriResolver(PhysicalResourceProvider.INSTANCE) |
| 173 ]; | 175 ]; |
| 174 context.sourceFactory = new SourceFactory(uriResolvers); | 176 context.sourceFactory = new SourceFactory(uriResolvers); |
| 175 Source dartDartSource = | 177 Source dartDartSource = |
| 176 setupSource(path.join('lib', 'src', 'task', 'dart.dart')); | 178 setupSource(path.join('lib', 'src', 'task', 'dart.dart')); |
| 177 Source taskSource = setupSource(path.join('lib', 'plugin', 'task.dart')); | 179 Source taskSource = setupSource(path.join('lib', 'plugin', 'task.dart')); |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 @override | 358 @override |
| 357 visitIdentifier(Identifier node) { | 359 visitIdentifier(Identifier node) { |
| 358 Element element = node.staticElement; | 360 Element element = node.staticElement; |
| 359 if (element is PropertyAccessorElement && | 361 if (element is PropertyAccessorElement && |
| 360 element.isGetter && | 362 element.isGetter && |
| 361 element.returnType.isSubtypeOf(type)) { | 363 element.returnType.isSubtypeOf(type)) { |
| 362 callback(element); | 364 callback(element); |
| 363 } | 365 } |
| 364 } | 366 } |
| 365 } | 367 } |
| OLD | NEW |