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

Side by Side Diff: pkg/analyzer/lib/src/plugin/plugin_configuration.dart

Issue 1366663002: Plugin config cleanup. (Closed) Base URL: git@github.com:dart-lang/sdk.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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/src/plugin/plugin_config_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.src.plugin.plugin_configuration; 5 library analyzer.src.plugin.plugin_configuration;
6 6
7 import 'package:analyzer/plugin/options.dart'; 7 import 'package:analyzer/plugin/options.dart';
8 import 'package:yaml/yaml.dart'; 8 import 'package:yaml/yaml.dart';
9 9
10 const _analyzerOptionScope = 'analyzer'; 10 const _analyzerOptionScope = 'analyzer';
(...skipping 12 matching lines...) Expand all
23 className: details['class_name'], 23 className: details['class_name'],
24 libraryUri: details['library_uri'], 24 libraryUri: details['library_uri'],
25 packageName: details['package_name'], 25 packageName: details['package_name'],
26 path: details['path']); 26 path: details['path']);
27 } 27 }
28 } 28 }
29 29
30 return null; 30 return null;
31 } 31 }
32 32
33 PluginInfo _processPluginNode(dynamic node) {
34 if (node is YamlMap) {
35 if (node.length == 1) {
36 return new PluginInfo(name: node.keys.first, version: node.values.first);
37 }
38 }
39 return null;
40 }
41
42 typedef ErrorHandler(Exception); 33 typedef ErrorHandler(Exception);
43 34
44 /// Describes plugin configuration information as extracted from an 35 /// Describes plugin configuration information as extracted from an
45 /// analysis options map. 36 /// analysis options map.
46 class PluginConfig { 37 class PluginConfig {
47 final Iterable<PluginInfo> plugins; 38 final Iterable<PluginInfo> plugins;
48 PluginConfig(this.plugins); 39 PluginConfig(this.plugins);
49 40
50 /// Create a plugin configuration from an options map. 41 /// Create a plugin configuration from an options map.
51 factory PluginConfig.fromOptions(Map<String, YamlNode> options) { 42 factory PluginConfig.fromOptions(Map<String, YamlNode> options) {
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 final String packageName; 110 final String packageName;
120 final String path; 111 final String path;
121 PluginInfo( 112 PluginInfo(
122 {this.name, 113 {this.name,
123 this.version, 114 this.version,
124 this.className, 115 this.className,
125 this.libraryUri, 116 this.libraryUri,
126 this.packageName, 117 this.packageName,
127 this.path}); 118 this.path});
128 } 119 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/plugin/plugin_config_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698