Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Unified Diff: pkg/analyzer_cli/lib/src/driver.dart

Issue 2719703005: fix dartanalyzer find options in bazel workspace (Closed)
Patch Set: merge Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/context/builder.dart ('k') | pkg/analyzer_cli/test/analysis_options_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « pkg/analyzer/lib/src/context/builder.dart ('k') | pkg/analyzer_cli/test/analysis_options_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698