Remove usages of ExtensionManager and package:plugin in general.
R=brianwilkerson@google.com
Change-Id: I489e72464474b3d40d7678f44562f65934f93288
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96863
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
diff --git a/pkg/analysis_server/lib/src/server/driver.dart b/pkg/analysis_server/lib/src/server/driver.dart
index 1d493ed..70f98dc 100644
--- a/pkg/analysis_server/lib/src/server/driver.dart
+++ b/pkg/analysis_server/lib/src/server/driver.dart
@@ -30,7 +30,6 @@
import 'package:analyzer/src/plugin/resolver_provider.dart';
import 'package:args/args.dart';
import 'package:linter/src/rules.dart' as linter;
-import 'package:plugin/manager.dart';
import 'package:telemetry/crash_reporting.dart';
import 'package:telemetry/telemetry.dart' as telemetry;
@@ -440,10 +439,8 @@
final serve_http = diagnosticServerPort != null;
//
- // Process all of the plugins so that extensions are registered.
+ // Register lint rules.
//
- ExtensionManager manager = new ExtensionManager();
- manager.processPlugins(AnalysisEngine.instance.requiredPlugins);
linter.registerLintRules();
_DiagnosticServerImpl diagnosticServer = new _DiagnosticServerImpl();
@@ -701,6 +698,15 @@
return sdk;
}
+ /**
+ * Constructs a uuid combining the current date and a random integer.
+ */
+ String _generateUuidString() {
+ int millisecondsSinceEpoch = new DateTime.now().millisecondsSinceEpoch;
+ int random = new Random().nextInt(0x3fffffff);
+ return '$millisecondsSinceEpoch$random';
+ }
+
String _getSdkPath(ArgResults args) {
if (args[SDK_OPTION] != null) {
return args[SDK_OPTION];
@@ -768,15 +774,6 @@
}
/**
- * Constructs a uuid combining the current date and a random integer.
- */
- String _generateUuidString() {
- int millisecondsSinceEpoch = new DateTime.now().millisecondsSinceEpoch;
- int random = new Random().nextInt(0x3fffffff);
- return '$millisecondsSinceEpoch$random';
- }
-
- /**
* Perform log files rolling.
*
* Rename existing files with names `[path].(x)` to `[path].(x+1)`.
diff --git a/pkg/analysis_server/test/analysis_abstract.dart b/pkg/analysis_server/test/analysis_abstract.dart
index 6135864..f4593b4 100644
--- a/pkg/analysis_server/test/analysis_abstract.dart
+++ b/pkg/analysis_server/test/analysis_abstract.dart
@@ -23,7 +23,6 @@
import 'package:analyzer_plugin/protocol/protocol.dart' as plugin;
import 'package:analyzer_plugin/protocol/protocol_generated.dart' as plugin;
import 'package:analyzer_plugin/src/protocol/protocol_internal.dart' as plugin;
-import 'package:plugin/manager.dart';
import 'package:test/test.dart';
import 'package:watcher/watcher.dart';
@@ -108,11 +107,6 @@
AnalysisServer createAnalysisServer() {
//
- // Process plugins
- //
- ExtensionManager manager = new ExtensionManager();
- manager.processPlugins(AnalysisEngine.instance.requiredPlugins);
- //
// Create an SDK in the mock file system.
//
new MockSdk(
diff --git a/pkg/analysis_server/test/context_manager_test.dart b/pkg/analysis_server/test/context_manager_test.dart
index 14cac2e..88938f1 100644
--- a/pkg/analysis_server/test/context_manager_test.dart
+++ b/pkg/analysis_server/test/context_manager_test.dart
@@ -31,7 +31,6 @@
import 'package:linter/src/rules.dart';
import 'package:linter/src/rules/avoid_as.dart';
import 'package:path/path.dart' as path;
-import 'package:plugin/manager.dart';
import 'package:test/test.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:watcher/watcher.dart';
@@ -1723,9 +1722,6 @@
.firstWhere((ErrorProcessor p) => p.appliesTo(error), orElse: () => null);
void processRequiredPlugins() {
- ExtensionManager manager = new ExtensionManager();
- manager.processPlugins(AnalysisEngine.instance.requiredPlugins);
-
registerLintRules();
}
diff --git a/pkg/analyzer/lib/src/context/context.dart b/pkg/analyzer/lib/src/context/context.dart
index 571fac0..10a548d 100644
--- a/pkg/analyzer/lib/src/context/context.dart
+++ b/pkg/analyzer/lib/src/context/context.dart
@@ -116,7 +116,7 @@
/**
* Initialize a newly created analysis context.
*/
- AnalysisContextImpl() {}
+ AnalysisContextImpl();
@override
AnalysisCache get analysisCache {
diff --git a/pkg/analyzer/lib/src/generated/engine.dart b/pkg/analyzer/lib/src/generated/engine.dart
index 808478c..55671cc 100644
--- a/pkg/analyzer/lib/src/generated/engine.dart
+++ b/pkg/analyzer/lib/src/generated/engine.dart
@@ -25,7 +25,6 @@
import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/generated/timestamped_data.dart';
import 'package:analyzer/src/generated/utilities_general.dart';
-import 'package:analyzer/src/plugin/engine_plugin.dart';
import 'package:analyzer/src/plugin/resolver_provider.dart';
import 'package:analyzer/src/services/lint.dart';
import 'package:analyzer/src/summary/api_signature.dart';
@@ -34,8 +33,6 @@
import 'package:analyzer/src/task/manager.dart';
import 'package:front_end/src/fasta/scanner/token.dart';
import 'package:path/path.dart' as pathos;
-import 'package:plugin/manager.dart';
-import 'package:plugin/plugin.dart';
import 'package:pub_semver/pub_semver.dart';
export 'package:analyzer/error/listener.dart' show RecordingErrorListener;
@@ -747,12 +744,6 @@
Logger _logger = Logger.NULL;
/**
- * The plugin that defines the extension points and extensions that are
- * inherently defined by the analysis engine.
- */
- final EnginePlugin enginePlugin = new EnginePlugin();
-
- /**
* The instrumentation service that is to be used by this analysis engine.
*/
InstrumentationService _instrumentationService =
@@ -803,13 +794,6 @@
}
/**
- * Return the list of plugins that clients are required to process, either by
- * creating an [ExtensionManager] or by using the method
- * [processRequiredPlugins].
- */
- List<Plugin> get requiredPlugins => <Plugin>[enginePlugin];
-
- /**
* Return the task manager used to manage the tasks used to analyze code.
*/
TaskManager get taskManager {
@@ -841,12 +825,8 @@
* plugins. This method can only be used by clients that do not need to
* process any other plugins.
*/
- void processRequiredPlugins() {
- if (enginePlugin.workManagerFactoryExtensionPoint == null) {
- ExtensionManager manager = new ExtensionManager();
- manager.processPlugins(requiredPlugins);
- }
- }
+ @deprecated
+ void processRequiredPlugins() {}
/**
* Return `true` if the given [fileName] is an analysis options file.
diff --git a/pkg/analyzer/lib/src/lint/analysis.dart b/pkg/analyzer/lib/src/lint/analysis.dart
index c9abd60..d62aaa0 100644
--- a/pkg/analyzer/lib/src/lint/analysis.dart
+++ b/pkg/analyzer/lib/src/lint/analysis.dart
@@ -34,8 +34,6 @@
import 'package:package_config/packages_file.dart' as pkgfile show parse;
import 'package:package_config/src/packages_impl.dart' show MapPackages;
import 'package:path/path.dart' as p;
-import 'package:plugin/manager.dart';
-import 'package:plugin/plugin.dart';
import 'package:yaml/yaml.dart';
AnalysisOptionsProvider _optionsProvider = new AnalysisOptionsProvider();
@@ -125,9 +123,7 @@
final LinterOptions options;
- LintDriver(this.options) {
- _processPlugins();
- }
+ LintDriver(this.options);
/// Return the number of sources that have been analyzed so far.
int get numSourcesAnalyzed => _sourcesAnalyzed.length;
@@ -252,13 +248,6 @@
}
return null;
}
-
- void _processPlugins() {
- List<Plugin> plugins = <Plugin>[];
- plugins.addAll(AnalysisEngine.instance.requiredPlugins);
- ExtensionManager manager = new ExtensionManager();
- manager.processPlugins(plugins);
- }
}
/// Prints logging information comments to the [outSink] and error messages to
diff --git a/pkg/analyzer/lib/src/plugin/engine_plugin.dart b/pkg/analyzer/lib/src/plugin/engine_plugin.dart
deleted file mode 100644
index 6301049..0000000
--- a/pkg/analyzer/lib/src/plugin/engine_plugin.dart
+++ /dev/null
@@ -1,163 +0,0 @@
-// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:analyzer/error/error.dart' show AnalysisError;
-import 'package:analyzer/src/generated/engine.dart'
- show InternalAnalysisContext;
-import 'package:analyzer/src/plugin/task.dart';
-import 'package:analyzer/src/task/api/model.dart';
-import 'package:analyzer/src/task/dart_work_manager.dart';
-import 'package:analyzer/src/task/options_work_manager.dart';
-import 'package:plugin/plugin.dart';
-
-/**
- * A plugin that defines the extension points and extensions that are inherently
- * defined by the analysis engine.
- */
-class EnginePlugin implements Plugin {
- /**
- * The simple identifier of the extension point that allows plugins to
- * register new analysis error results to compute for a Dart source.
- */
- static const String DART_ERRORS_FOR_SOURCE_EXTENSION_POINT =
- 'dartErrorsForSource';
-
- /**
- * The simple identifier of the extension point that allows plugins to
- * register new analysis error results to compute for a Dart library
- * specific unit.
- */
- static const String DART_ERRORS_FOR_UNIT_EXTENSION_POINT =
- 'dartErrorsForUnit';
-
- /**
- * The simple identifier of the extension point that allows plugins to
- * register new analysis error results to compute for an HTML source.
- */
- static const String HTML_ERRORS_EXTENSION_POINT = 'htmlErrors';
-
- /**
- * The simple identifier of the extension point that allows plugins to
- * register new work manager factories with the analysis engine.
- */
- static const String WORK_MANAGER_FACTORY_EXTENSION_POINT =
- 'workManagerFactory';
-
- /**
- * The unique identifier of this plugin.
- */
- static const String UNIQUE_IDENTIFIER = 'analysis_engine.core';
-
- /**
- * The extension point that allows plugins to register new analysis error
- * results for a Dart source.
- */
- ExtensionPoint<ListResultDescriptor<AnalysisError>>
- dartErrorsForSourceExtensionPoint;
-
- /**
- * The extension point that allows plugins to register new analysis error
- * results for a Dart library specific unit.
- */
- ExtensionPoint<ListResultDescriptor<AnalysisError>>
- dartErrorsForUnitExtensionPoint;
-
- /**
- * The extension point that allows plugins to register new analysis error
- * results for an HTML source.
- */
- ExtensionPoint<ListResultDescriptor<AnalysisError>> htmlErrorsExtensionPoint;
-
- /**
- * The extension point that allows plugins to register new work manager
- * factories with the analysis engine.
- */
- ExtensionPoint<WorkManagerFactory> workManagerFactoryExtensionPoint;
-
- /**
- * Initialize a newly created plugin.
- */
- EnginePlugin();
-
- /**
- * Return a list containing all of the contributed analysis error result
- * descriptors for Dart sources.
- */
- @ExtensionPointId('DART_ERRORS_FOR_SOURCE_EXTENSION_POINT_ID')
- List<ListResultDescriptor<AnalysisError>> get dartErrorsForSource =>
- dartErrorsForSourceExtensionPoint.extensions;
-
- /**
- * Return a list containing all of the contributed analysis error result
- * descriptors for Dart library specific units.
- */
- @ExtensionPointId('DART_ERRORS_FOR_UNIT_EXTENSION_POINT_ID')
- List<ListResultDescriptor<AnalysisError>> get dartErrorsForUnit =>
- dartErrorsForUnitExtensionPoint.extensions;
-
- /**
- * Return a list containing all of the contributed analysis error result
- * descriptors for HTML sources.
- */
- @ExtensionPointId('HTML_ERRORS_EXTENSION_POINT_ID')
- List<ListResultDescriptor<AnalysisError>> get htmlErrors =>
- htmlErrorsExtensionPoint.extensions;
-
- @override
- String get uniqueIdentifier => UNIQUE_IDENTIFIER;
-
- /**
- * Return a list containing all of the work manager factories that were
- * contributed.
- */
- List<WorkManagerFactory> get workManagerFactories =>
- workManagerFactoryExtensionPoint.extensions;
-
- @override
- void registerExtensionPoints(RegisterExtensionPoint registerExtensionPoint) {
- dartErrorsForSourceExtensionPoint =
- new ExtensionPoint<ListResultDescriptor<AnalysisError>>(
- this, DART_ERRORS_FOR_SOURCE_EXTENSION_POINT, null);
- registerExtensionPoint(dartErrorsForSourceExtensionPoint);
- dartErrorsForUnitExtensionPoint =
- new ExtensionPoint<ListResultDescriptor<AnalysisError>>(
- this, DART_ERRORS_FOR_UNIT_EXTENSION_POINT, null);
- registerExtensionPoint(dartErrorsForUnitExtensionPoint);
- htmlErrorsExtensionPoint =
- new ExtensionPoint<ListResultDescriptor<AnalysisError>>(
- this, HTML_ERRORS_EXTENSION_POINT, null);
- registerExtensionPoint(htmlErrorsExtensionPoint);
- workManagerFactoryExtensionPoint = new ExtensionPoint<WorkManagerFactory>(
- this, WORK_MANAGER_FACTORY_EXTENSION_POINT, null);
- registerExtensionPoint(workManagerFactoryExtensionPoint);
- }
-
- @override
- void registerExtensions(RegisterExtension registerExtension) {
- _registerWorkManagerFactoryExtensions(registerExtension);
- }
-
- void _registerWorkManagerFactoryExtensions(
- RegisterExtension registerExtension) {
- String taskId = WORK_MANAGER_EXTENSION_POINT_ID;
- registerExtension(taskId,
- (InternalAnalysisContext context) => new DartWorkManager(context));
- registerExtension(taskId,
- (InternalAnalysisContext context) => new OptionsWorkManager(context));
- }
-}
-
-/**
- * Annotation describing the relationship between a getter in [EnginePlugin]
- * and the associated identifier (in 'task.dart') which can be passed to the
- * extension manager to populate it.
- *
- * This annotation is not used at runtime; it is used to aid in static analysis
- * of the task model during development.
- */
-class ExtensionPointId {
- final String extensionPointId;
-
- const ExtensionPointId(this.extensionPointId);
-}
diff --git a/pkg/analyzer/lib/src/plugin/task.dart b/pkg/analyzer/lib/src/plugin/task.dart
index 8292485..fec6844 100644
--- a/pkg/analyzer/lib/src/plugin/task.dart
+++ b/pkg/analyzer/lib/src/plugin/task.dart
@@ -7,44 +7,7 @@
* analysis tasks.
*/
import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/plugin/engine_plugin.dart';
import 'package:analyzer/src/task/api/model.dart';
-import 'package:plugin/plugin.dart';
-
-/**
- * The identifier of the extension point that allows plugins to register new
- * analysis error results to compute for a Dart source. The object used as an
- * extension must be a [ResultDescriptor].
- */
-final String DART_ERRORS_FOR_SOURCE_EXTENSION_POINT_ID = Plugin.join(
- EnginePlugin.UNIQUE_IDENTIFIER,
- EnginePlugin.DART_ERRORS_FOR_SOURCE_EXTENSION_POINT);
-
-/**
- * The identifier of the extension point that allows plugins to register new
- * analysis error results to compute for a Dart library specific unit. The
- * object used as an extension must be a [ResultDescriptor].
- */
-final String DART_ERRORS_FOR_UNIT_EXTENSION_POINT_ID = Plugin.join(
- EnginePlugin.UNIQUE_IDENTIFIER,
- EnginePlugin.DART_ERRORS_FOR_UNIT_EXTENSION_POINT);
-
-/**
- * The identifier of the extension point that allows plugins to register new
- * analysis error results to compute for an HTML source. The object used as an
- * extension must be a [ResultDescriptor].
- */
-final String HTML_ERRORS_EXTENSION_POINT_ID = Plugin.join(
- EnginePlugin.UNIQUE_IDENTIFIER, EnginePlugin.HTML_ERRORS_EXTENSION_POINT);
-
-/**
- * The identifier of the extension point that allows plugins to register new
- * work managers with the analysis engine. The object used as an extension must
- * be a [WorkManagerFactory].
- */
-final String WORK_MANAGER_EXTENSION_POINT_ID = Plugin.join(
- EnginePlugin.UNIQUE_IDENTIFIER,
- EnginePlugin.WORK_MANAGER_FACTORY_EXTENSION_POINT);
/**
* A function that will create a new [WorkManager] for the given [context].
diff --git a/pkg/analyzer/lib/src/task/dart.dart b/pkg/analyzer/lib/src/task/dart.dart
index fecfa7a..36dd7f6 100644
--- a/pkg/analyzer/lib/src/task/dart.dart
+++ b/pkg/analyzer/lib/src/task/dart.dart
@@ -46,7 +46,6 @@
import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/generated/utilities_dart.dart';
import 'package:analyzer/src/ignore_comments/ignore_info.dart';
-import 'package:analyzer/src/plugin/engine_plugin.dart';
import 'package:analyzer/src/services/lint.dart';
import 'package:analyzer/src/task/api/dart.dart';
import 'package:analyzer/src/task/api/general.dart';
@@ -2461,27 +2460,6 @@
@override
void internalPerform() {
List<List<AnalysisError>> errorLists = <List<AnalysisError>>[];
- //
- // Prepare inputs.
- //
- EnginePlugin enginePlugin = AnalysisEngine.instance.enginePlugin;
- List<ResultDescriptor> errorsForSource = enginePlugin.dartErrorsForSource;
- int sourceLength = errorsForSource.length;
- for (int i = 0; i < sourceLength; i++) {
- ResultDescriptor result = errorsForSource[i];
- String inputName = result.name + '_input';
- errorLists.add(getRequiredInput(inputName));
- }
- List<ResultDescriptor> errorsForUnit = enginePlugin.dartErrorsForUnit;
- int unitLength = errorsForUnit.length;
- for (int i = 0; i < unitLength; i++) {
- ResultDescriptor result = errorsForUnit[i];
- String inputName = result.name + '_input';
- Map<Source, List<AnalysisError>> errorMap = getRequiredInput(inputName);
- for (List<AnalysisError> errors in errorMap.values) {
- errorLists.add(errors);
- }
- }
//
// Filter ignored errors.
@@ -2520,29 +2498,6 @@
Map<String, TaskInput> inputs = <String, TaskInput>{};
inputs[LINE_INFO_INPUT] = LINE_INFO.of(source);
inputs[IGNORE_INFO_INPUT] = IGNORE_INFO.of(source);
- EnginePlugin enginePlugin = AnalysisEngine.instance.enginePlugin;
- // for Source
- List<ListResultDescriptor<AnalysisError>> errorsForSource =
- enginePlugin.dartErrorsForSource;
- int sourceLength = errorsForSource.length;
- for (int i = 0; i < sourceLength; i++) {
- ListResultDescriptor<AnalysisError> result = errorsForSource[i];
- String inputName = result.name + '_input';
- inputs[inputName] = result.of(source);
- }
- // for LibrarySpecificUnit
- List<ListResultDescriptor<AnalysisError>> errorsForUnit =
- enginePlugin.dartErrorsForUnit;
- int unitLength = errorsForUnit.length;
- for (int i = 0; i < unitLength; i++) {
- ListResultDescriptor<AnalysisError> result = errorsForUnit[i];
- String inputName = result.name + '_input';
- inputs[inputName] =
- CONTAINING_LIBRARIES.of(source).toMap((Source library) {
- LibrarySpecificUnit unit = new LibrarySpecificUnit(library, source);
- return result.of(unit);
- });
- }
return inputs;
}
diff --git a/pkg/analyzer/pubspec.yaml b/pkg/analyzer/pubspec.yaml
index 1906862..07ef370 100644
--- a/pkg/analyzer/pubspec.yaml
+++ b/pkg/analyzer/pubspec.yaml
@@ -17,7 +17,6 @@
meta: ^1.0.2
package_config: '>=0.1.5 <2.0.0'
path: '>=0.9.0 <2.0.0'
- plugin: ^0.2.0
pub_semver: ^1.4.2
source_span: ^1.2.0
watcher: '>=0.9.6 <0.10.0'
diff --git a/pkg/analyzer/test/generated/test_support.dart b/pkg/analyzer/test/generated/test_support.dart
index 528bd33..b6ba562 100644
--- a/pkg/analyzer/test/generated/test_support.dart
+++ b/pkg/analyzer/test/generated/test_support.dart
@@ -14,8 +14,6 @@
import 'package:analyzer/src/generated/java_engine.dart';
import 'package:analyzer/src/generated/parser.dart';
import 'package:analyzer/src/generated/source.dart';
-import 'package:plugin/manager.dart';
-import 'package:plugin/plugin.dart';
import 'package:test/test.dart';
import 'analysis_context_factory.dart';
@@ -98,11 +96,7 @@
fail("Could not find method named $methodName in ${type.displayName}");
}
- void setUp() {
- List<Plugin> plugins = <Plugin>[];
- plugins.addAll(AnalysisEngine.instance.requiredPlugins);
- new ExtensionManager().processPlugins(plugins);
- }
+ void setUp() {}
void tearDown() {}
diff --git a/pkg/analyzer/test/source/error_processor_test.dart b/pkg/analyzer/test/source/error_processor_test.dart
index d55cd52..cfa3620 100644
--- a/pkg/analyzer/test/source/error_processor_test.dart
+++ b/pkg/analyzer/test/source/error_processor_test.dart
@@ -9,8 +9,6 @@
import 'package:analyzer/src/error/codes.dart';
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/task/options.dart';
-import 'package:plugin/manager.dart';
-import 'package:plugin/plugin.dart';
import 'package:test/test.dart';
import 'package:yaml/yaml.dart';
@@ -44,8 +42,6 @@
AnalysisError annotate_overrides = new AnalysisError(
new TestSource(), 0, 1, new LintCode('annotate_overrides', ''));
- oneTimeSetup();
-
setUp(() {
context = new TestContext();
});
@@ -162,11 +158,4 @@
ErrorProcessor getProcessor(AnalysisError error) =>
ErrorProcessor.getProcessor(context.analysisOptions, error);
-void oneTimeSetup() {
- List<Plugin> plugins = <Plugin>[];
- plugins.addAll(AnalysisEngine.instance.requiredPlugins);
- ExtensionManager manager = new ExtensionManager();
- manager.processPlugins(plugins);
-}
-
class TestContext extends AnalysisContextImpl {}
diff --git a/pkg/analyzer/test/src/task/strong/strong_test_helper.dart b/pkg/analyzer/test/src/task/strong/strong_test_helper.dart
index 38d5a42..fadd403 100644
--- a/pkg/analyzer/test/src/task/strong/strong_test_helper.dart
+++ b/pkg/analyzer/test/src/task/strong/strong_test_helper.dart
@@ -243,10 +243,10 @@
AnalysisContext _context = null;
AnalysisDriver _driver = null;
- bool get enableNewAnalysisDriver => false;
-
List<String> get enabledExperiments => [];
+ bool get enableNewAnalysisDriver => false;
+
/// Adds a file to check. The file should contain:
///
/// * all expected failures are listed in the source code using comments
@@ -382,9 +382,7 @@
);
}
- void setUp() {
- AnalysisEngine.instance.processRequiredPlugins();
- }
+ void setUp() {}
void tearDown() {
// This is a sanity check, in case only addFile is called.
diff --git a/pkg/analyzer_cli/lib/src/driver.dart b/pkg/analyzer_cli/lib/src/driver.dart
index 8b2b808..dea039b 100644
--- a/pkg/analyzer_cli/lib/src/driver.dart
+++ b/pkg/analyzer_cli/lib/src/driver.dart
@@ -52,8 +52,6 @@
import 'package:package_config/packages_file.dart' as pkgfile show parse;
import 'package:package_config/src/packages_impl.dart' show MapPackages;
import 'package:path/path.dart' as path;
-import 'package:plugin/manager.dart';
-import 'package:plugin/plugin.dart';
import 'package:telemetry/crash_reporting.dart';
import 'package:telemetry/telemetry.dart' as telemetry;
import 'package:yaml/yaml.dart';
@@ -100,9 +98,6 @@
ContextCache contextCache;
- /// The plugins that are defined outside the `analyzer_cli` package.
- List<Plugin> _userDefinedPlugins = <Plugin>[];
-
/// The driver that was most recently created by a call to [_analyzeAll], or
/// `null` if [_analyzeAll] hasn't been called yet.
@visibleForTesting
@@ -149,11 +144,6 @@
CrashReportSender get crashReportSender => (_crashReportSender ??=
new CrashReportSender('Dart_analyzer_cli', analytics));
- @override
- void set userDefinedPlugins(List<Plugin> plugins) {
- _userDefinedPlugins = plugins ?? <Plugin>[];
- }
-
/**
* Converts the given [filePath] into absolute and normalized.
*/
@@ -173,7 +163,7 @@
StringUtilities.INTERNER = new MappedInterner();
- _processPlugins();
+ linter.registerLintRules();
// Parse commandline options.
CommandLineOptions options = CommandLineOptions.parse(args);
@@ -735,17 +725,6 @@
bool _isInHiddenDir(String relative) =>
path.split(relative).any((part) => part.startsWith("."));
- void _processPlugins() {
- List<Plugin> plugins = <Plugin>[];
- plugins.addAll(AnalysisEngine.instance.requiredPlugins);
- plugins.addAll(_userDefinedPlugins);
-
- ExtensionManager manager = new ExtensionManager();
- manager.processPlugins(plugins);
-
- linter.registerLintRules();
- }
-
/// Analyze a single source.
Future<ErrorSeverity> _runAnalyzer(
FileState file, CommandLineOptions options, ErrorFormatter formatter) {
diff --git a/pkg/analyzer_cli/lib/starter.dart b/pkg/analyzer_cli/lib/starter.dart
index 09db5bf..88a232c 100644
--- a/pkg/analyzer_cli/lib/starter.dart
+++ b/pkg/analyzer_cli/lib/starter.dart
@@ -7,7 +7,6 @@
import 'package:analyzer/src/plugin/resolver_provider.dart';
import 'package:analyzer_cli/src/driver.dart';
-import 'package:plugin/plugin.dart';
/**
* An object that can be used to start a command-line analysis. This class
@@ -30,11 +29,6 @@
void set packageResolverProvider(ResolverProvider provider);
/**
- * Set the [plugins] that are defined outside the analyzer_cli package.
- */
- void set userDefinedPlugins(List<Plugin> plugins);
-
- /**
* Use the given command-line [arguments] to start this analyzer.
*
* If [sendPort] is provided it is used for bazel worker communication
diff --git a/pkg/analyzer_cli/pubspec.yaml b/pkg/analyzer_cli/pubspec.yaml
index bfa2b84..cac47aa 100644
--- a/pkg/analyzer_cli/pubspec.yaml
+++ b/pkg/analyzer_cli/pubspec.yaml
@@ -8,7 +8,6 @@
collection: ^1.14.1
linter: ^0.1.16
package_config: '>=0.1.5 <2.0.0'
- plugin: '>=0.1.0 <0.3.0'
protobuf: ^0.9.0
telemetry: ^0.0.1
yaml: ^2.1.2
diff --git a/pkg/dev_compiler/lib/src/analyzer/driver.dart b/pkg/dev_compiler/lib/src/analyzer/driver.dart
index 8755825..4728fb1 100644
--- a/pkg/dev_compiler/lib/src/analyzer/driver.dart
+++ b/pkg/dev_compiler/lib/src/analyzer/driver.dart
@@ -77,8 +77,6 @@
{SummaryDataStore summaryData,
List<String> summaryPaths = const [],
Map<String, bool> experiments = const {}}) {
- AnalysisEngine.instance.processRequiredPlugins();
-
var resourceProvider = options.resourceProvider;
var contextBuilder = options.createContextBuilder();