Index: pkg/analyzer_cli/lib/src/driver.dart |
diff --git a/pkg/analyzer_cli/lib/src/driver.dart b/pkg/analyzer_cli/lib/src/driver.dart |
index 22dd506684023847b4c3157550d87e689f99dec9..f6d67ecabf202b12d3bd3bc63d0d62cba9d88062 100644 |
--- a/pkg/analyzer_cli/lib/src/driver.dart |
+++ b/pkg/analyzer_cli/lib/src/driver.dart |
@@ -739,12 +739,19 @@ class Driver implements CommandLineStarter { |
} |
} |
+ String contextRoot; |
+ if (options.sourceFiles.isEmpty) { |
+ contextRoot = path.current; |
+ } else { |
+ contextRoot = options.sourceFiles[0]; |
+ if (!path.isAbsolute(contextRoot)) { |
+ contextRoot = path.absolute(contextRoot); |
+ } |
+ } |
AnalysisOptionsImpl contextOptions = new ContextBuilder( |
resourceProvider, null, null, |
options: options.contextBuilderOptions) |
- .getAnalysisOptions(options.sourceFiles.isNotEmpty |
- ? options.sourceFiles[0] |
- : path.current); |
+ .getAnalysisOptions(contextRoot); |
contextOptions.trackCacheDependencies = false; |
contextOptions.disableCacheFlushing = options.disableCacheFlushing; |