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 167198a1fcf427a761ca532d9a7816059a4d0ecd..235c2b9d032b7bee4592cab847b620d9135478b9 100644 |
--- a/pkg/analyzer/tool/task_dependency_graph/generate.dart |
+++ b/pkg/analyzer/tool/task_dependency_graph/generate.dart |
@@ -138,7 +138,13 @@ class Driver { |
resourceProvider = PhysicalResourceProvider.INSTANCE; |
DartSdk sdk = DirectoryBasedDartSdk.defaultSdk; |
context = AnalysisEngine.instance.createAnalysisContext(); |
- JavaFile packagesDir = new JavaFile(path.join(rootDir, 'packages')); |
+ String packageRootPath; |
+ if (Platform.packageRoot.isNotEmpty) { |
+ packageRootPath = Platform.packageRoot; |
+ } else { |
+ packageRootPath = path.join(rootDir, 'packages'); |
+ } |
+ JavaFile packagesDir = new JavaFile(packageRootPath); |
List<UriResolver> uriResolvers = [ |
new DartUriResolver(sdk), |
new PackageUriResolver(<JavaFile>[packagesDir]), |