mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:39:49 +00:00
Rename the plugin location key and directory name
R=mfairhurst@google.com Review-Url: https://codereview.chromium.org/2952583003 .
This commit is contained in:
parent
d0f8a47f33
commit
5582824e3c
|
@ -13,13 +13,13 @@ class PluginLocator {
|
|||
* The key used in the `pubspec.yaml` file to specify the location of the
|
||||
* analysis plugin.
|
||||
*/
|
||||
static const String analysisPluginKey = 'analysis_plugin';
|
||||
static const String analyzerPluginKey = 'analyzer_plugin';
|
||||
|
||||
/**
|
||||
* The name of the default plugin directory, located within the `tools`
|
||||
* directory.
|
||||
*/
|
||||
static const String defaultPluginFolderName = 'analysis_plugin';
|
||||
static const String defaultPluginFolderName = 'analyzer_plugin';
|
||||
|
||||
/**
|
||||
* The name of the `pubspec.yaml` file.
|
||||
|
@ -79,7 +79,7 @@ class PluginLocator {
|
|||
sourceUrl: pubspecFile.toUri());
|
||||
YamlNode contents = document.contents;
|
||||
if (contents is YamlMap) {
|
||||
String pluginPath = contents[analysisPluginKey];
|
||||
String pluginPath = contents[analyzerPluginKey];
|
||||
if (pluginPath != null) {
|
||||
Folder pluginFolder =
|
||||
packageFolder.getChildAssumingFolder(pluginPath);
|
||||
|
|
|
@ -76,7 +76,7 @@ class PluginLocatorTest {
|
|||
resourceProvider.pathContext.join(packageRoot, 'pluginDir');
|
||||
_createPubspec('''
|
||||
name: test_project
|
||||
${PluginLocator.analysisPluginKey}: $nonDefaultPath
|
||||
${PluginLocator.analyzerPluginKey}: $nonDefaultPath
|
||||
''');
|
||||
resourceProvider.newFolder(nonDefaultPath);
|
||||
return nonDefaultPath;
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
import 'dart:async';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:analysis_server/src/plugin/plugin_locator.dart';
|
||||
import 'package:analysis_server/src/plugin/plugin_manager.dart';
|
||||
import 'package:analysis_server/src/plugin/plugin_watcher.dart';
|
||||
import 'package:analyzer/context/context_root.dart';
|
||||
|
@ -63,8 +64,8 @@ class PluginWatcherTest {
|
|||
resourceProvider.newFile(
|
||||
resourceProvider.convertPath('/pkg2/pubspec.yaml'), 'name: pkg2');
|
||||
resourceProvider.newFile(
|
||||
resourceProvider
|
||||
.convertPath('/pkg2/tools/analysis_plugin/bin/plugin.dart'),
|
||||
resourceProvider.convertPath(
|
||||
'/pkg2/${PluginLocator.toolsFolderName}/${PluginLocator.defaultPluginFolderName}/bin/plugin.dart'),
|
||||
'');
|
||||
await driver.computeResult('package:pkg2/pk2.dart');
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue