OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |