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

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

Issue 2212813003: Clean up use of resource provider in cli (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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_cli/lib/src/build_mode.dart ('k') | pkg/analyzer_cli/test/build_mode_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 fe69d9db98378ace6e4cc6f3299fb15a9aed115d..9cddf0de7c6b696c316817458162fcc117141c79 100644
--- a/pkg/analyzer_cli/lib/src/driver.dart
+++ b/pkg/analyzer_cli/lib/src/driver.dart
@@ -252,9 +252,11 @@ class Driver implements CommandLineStarter {
ErrorSeverity _buildModeAnalyze(CommandLineOptions options) {
return _analyzeAllTag.makeCurrentWhile(() {
if (options.buildModePersistentWorker) {
- new AnalyzerWorkerLoop.std(dartSdkPath: options.dartSdkPath).run();
+ new AnalyzerWorkerLoop.std(resourceProvider,
+ dartSdkPath: options.dartSdkPath)
+ .run();
} else {
- return new BuildMode(options, stats).analyze();
+ return new BuildMode(resourceProvider, options, stats).analyze();
}
});
}
@@ -479,7 +481,7 @@ class Driver implements CommandLineStarter {
AnalyzeFunctionBodiesPredicate dietParsingPolicy =
_chooseDietParsingPolicy(options);
- setAnalysisContextOptions(_context, options,
+ setAnalysisContextOptions(resourceProvider, _context, options,
(AnalysisOptionsImpl contextOptions) {
contextOptions.analyzeFunctionBodiesPredicate = dietParsingPolicy;
});
@@ -655,6 +657,7 @@ class Driver implements CommandLineStarter {
}
static void setAnalysisContextOptions(
+ file_system.ResourceProvider resourceProvider,
AnalysisContext context,
CommandLineOptions options,
void configureContextOptions(AnalysisOptionsImpl contextOptions)) {
@@ -679,7 +682,7 @@ class Driver implements CommandLineStarter {
context.analysisOptions = contextOptions;
// Process analysis options file (and notify all interested parties).
- _processAnalysisOptions(context, options);
+ _processAnalysisOptions(resourceProvider, context, options);
}
/// Perform a deep comparison of two string maps.
@@ -695,21 +698,23 @@ class Driver implements CommandLineStarter {
return true;
}
- static file_system.File _getOptionsFile(CommandLineOptions options) {
+ static file_system.File _getOptionsFile(
+ file_system.ResourceProvider resourceProvider,
+ CommandLineOptions options) {
file_system.File file;
String filePath = options.analysisOptionsFile;
if (filePath != null) {
- file = PhysicalResourceProvider.INSTANCE.getFile(filePath);
+ file = resourceProvider.getFile(filePath);
if (!file.exists) {
printAndFail('Options file not found: $filePath',
exitCode: ErrorSeverity.ERROR.ordinal);
}
} else {
filePath = AnalysisEngine.ANALYSIS_OPTIONS_FILE;
- file = PhysicalResourceProvider.INSTANCE.getFile(filePath);
+ file = resourceProvider.getFile(filePath);
if (!file.exists) {
filePath = AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE;
- file = PhysicalResourceProvider.INSTANCE.getFile(filePath);
+ file = resourceProvider.getFile(filePath);
}
}
return file;
@@ -720,8 +725,10 @@ class Driver implements CommandLineStarter {
path.normalize(new File(sourcePath).absolute.path);
static void _processAnalysisOptions(
- AnalysisContext context, CommandLineOptions options) {
- file_system.File file = _getOptionsFile(options);
+ file_system.ResourceProvider resourceProvider,
+ AnalysisContext context,
+ CommandLineOptions options) {
+ file_system.File file = _getOptionsFile(resourceProvider, options);
List<OptionsProcessor> optionsProcessors =
AnalysisEngine.instance.optionsPlugin.optionsProcessors;
try {
« no previous file with comments | « pkg/analyzer_cli/lib/src/build_mode.dart ('k') | pkg/analyzer_cli/test/build_mode_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698