Index: pkg/analyzer/tool/task_dependency_graph/generate.dart |
diff --git a/pkg/analyzer/tool/task_dependency_graph/generate.dart b/pkg/analyzer/tool/task_dependency_graph/generate.dart |
index db2cd09ddca72a07fe114162fdbbb7b843a7f7cf..068790f5787d3e45e9c50f3d6ca8ed47e5a4978c 100644 |
--- a/pkg/analyzer/tool/task_dependency_graph/generate.dart |
+++ b/pkg/analyzer/tool/task_dependency_graph/generate.dart |
@@ -154,14 +154,15 @@ ${generateGraphData()} |
DartSdk sdk = new FolderBasedDartSdk(resourceProvider, |
FolderBasedDartSdk.defaultSdkDirectory(resourceProvider)); |
context = AnalysisEngine.instance.createAnalysisContext(); |
- String packageRootPath; |
+ ContextBuilder builder = new ContextBuilder(resourceProvider, null, null); |
if (Platform.packageRoot != null) { |
- packageRootPath = Uri.parse(Platform.packageRoot).toFilePath(); |
+ builder.defaultPackagesDirectoryPath = Uri.parse(Platform.packageRoot).toFilePath(); |
+ } else if (Platform.packageConfig != null) { |
+ builder.defaultPackageFilePath = Platform.packageConfig; |
} else { |
- packageRootPath = path.join(rootDir, 'packages'); |
+ // Let the context builder use the default algorithm for package |
+ // resolution. |
} |
- ContextBuilder builder = new ContextBuilder(resourceProvider, null, null); |
- builder.defaultPackagesDirectoryPath = packageRootPath; |
List<UriResolver> uriResolvers = [ |
new DartUriResolver(sdk), |
new PackageMapUriResolver(resourceProvider, |