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

Unified Diff: lib/src/bootloader.dart

Issue 1373903004: Bootloader initialization cleanup. (Closed) Base URL: https://github.com/dart-lang/analyzer_cli.git@master
Patch Set: Created 5 years, 3 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 | « no previous file | lib/src/driver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/bootloader.dart
diff --git a/lib/src/bootloader.dart b/lib/src/bootloader.dart
index bac97b390c8d2ef5c74d1b038c54ab3dedf95810..4cc6053a24aeb5546724b7c76b8435e2501164cd 100644
--- a/lib/src/bootloader.dart
+++ b/lib/src/bootloader.dart
@@ -8,15 +8,10 @@ import 'dart:io';
import 'dart:isolate';
import 'package:analyzer/file_system/physical_file_system.dart';
-import 'package:analyzer/plugin/options.dart';
import 'package:analyzer/source/analysis_options_provider.dart';
-import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/plugin/plugin_configuration.dart';
import 'package:analyzer_cli/src/driver.dart';
import 'package:analyzer_cli/src/options.dart';
-import 'package:analyzer_cli/src/plugin/plugin_config_processor_plugin.dart';
-import 'package:plugin/manager.dart';
-import 'package:plugin/plugin.dart';
import 'package:source_span/source_span.dart';
import 'package:yaml/src/yaml_node.dart';
@@ -86,14 +81,12 @@ class BootLoader {
};
/// Reads plugin config info from `.analysis_options`.
- PluginConfigProcessorPlugin _pluginConfigProcessorPlugin =
- new PluginConfigProcessorPlugin(_pluginConfigErrorHandler);
+ PluginConfigOptionsProcessor _pluginOptionsProcessor =
+ new PluginConfigOptionsProcessor(_pluginConfigErrorHandler);
/// Create a loadable analyzer image configured with plugins derived from
/// the given analyzer command-line `args`.
Image createImage(List<String> args) {
- _processPlugins();
-
// Parse commandline options.
CommandLineOptions options = CommandLineOptions.parse(args);
@@ -101,7 +94,7 @@ class BootLoader {
_processAnalysisOptions(options);
// TODO(pquitslund): Pass in .packages info
- return new Image(_pluginConfigProcessorPlugin.pluginConfig,
+ return new Image(_pluginOptionsProcessor.config,
args: args, packageRootPath: options.packageRootPath);
}
@@ -110,28 +103,17 @@ class BootLoader {
var filePath = options.analysisOptionsFile != null
? options.analysisOptionsFile
: AnalysisOptionsProvider.ANALYSIS_OPTIONS_NAME;
- List<OptionsProcessor> optionsProcessors =
- AnalysisEngine.instance.optionsPlugin.optionsProcessors;
try {
var file = PhysicalResourceProvider.INSTANCE.getFile(filePath);
AnalysisOptionsProvider analysisOptionsProvider =
new AnalysisOptionsProvider();
Map<String, YamlNode> options =
analysisOptionsProvider.getOptionsFromFile(file);
- optionsProcessors
- .forEach((OptionsProcessor p) => p.optionsProcessed(options));
+ _pluginOptionsProcessor.optionsProcessed(options);
} on Exception catch (e) {
- optionsProcessors.forEach((OptionsProcessor p) => p.onError(e));
+ _pluginOptionsProcessor.onError(e);
}
}
-
- void _processPlugins() {
- List<Plugin> plugins = <Plugin>[];
- plugins.add(_pluginConfigProcessorPlugin);
- plugins.addAll(AnalysisEngine.instance.supportedPlugins);
- ExtensionManager manager = new ExtensionManager();
- manager.processPlugins(plugins);
- }
}
/// A loadable "image" of a a configured analyzer instance.
« no previous file with comments | « no previous file | lib/src/driver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698