Add macosPrefix to the pubspec schema for plugins (#33287)
Adds a new macosPrefix, which serves the same purpose as iosPrefix but for macOS plugins. It is not yet used by the tooling, but this allows for plugins to start to be written using it in preparation for tooling support for plugins. Part of #32718
This commit is contained in:
@@ -371,7 +371,10 @@ void _validateFlutter(YamlMap yaml, List<String> errors) {
|
||||
errors.add('The "androidPackage" must either be null or a string.');
|
||||
}
|
||||
if (kvp.value['iosPrefix'] != null && kvp.value['iosPrefix'] is! String) {
|
||||
errors.add('The "iosPrefix" must eithe rbe null or a string.');
|
||||
errors.add('The "iosPrefix" must either be null or a string.');
|
||||
}
|
||||
if (kvp.value['macosPrefix'] != null && kvp.value['macosPrefix'] is! String) {
|
||||
errors.add('The "macosPrefix" must either be null or a string.');
|
||||
}
|
||||
if (kvp.value['pluginClass'] != null && kvp.value['pluginClass'] is! String) {
|
||||
errors.add('The "pluginClass" must either be null or a string..');
|
||||
|
||||
@@ -27,16 +27,19 @@ class Plugin {
|
||||
this.path,
|
||||
this.androidPackage,
|
||||
this.iosPrefix,
|
||||
this.macosPrefix,
|
||||
this.pluginClass,
|
||||
});
|
||||
|
||||
factory Plugin.fromYaml(String name, String path, dynamic pluginYaml) {
|
||||
String androidPackage;
|
||||
String iosPrefix;
|
||||
String macosPrefix;
|
||||
String pluginClass;
|
||||
if (pluginYaml != null) {
|
||||
androidPackage = pluginYaml['androidPackage'];
|
||||
iosPrefix = pluginYaml['iosPrefix'] ?? '';
|
||||
macosPrefix = pluginYaml['macosPrefix'] ?? '';
|
||||
pluginClass = pluginYaml['pluginClass'];
|
||||
}
|
||||
return Plugin(
|
||||
@@ -44,6 +47,7 @@ class Plugin {
|
||||
path: path,
|
||||
androidPackage: androidPackage,
|
||||
iosPrefix: iosPrefix,
|
||||
macosPrefix: macosPrefix,
|
||||
pluginClass: pluginClass,
|
||||
);
|
||||
}
|
||||
@@ -52,6 +56,7 @@ class Plugin {
|
||||
final String path;
|
||||
final String androidPackage;
|
||||
final String iosPrefix;
|
||||
final String macosPrefix;
|
||||
final String pluginClass;
|
||||
}
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@
|
||||
"properties": {
|
||||
"androidPackage": { "type": "string" },
|
||||
"iosPrefix": { "type": "string" },
|
||||
"macosPrefix": { "type": "string" },
|
||||
"pluginClass": { "type": "string" }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user