Merge pull request #36874 from m4gr3d/trim_plugins_name_whitespaces

Trim the whitespace around the plugins names
This commit is contained in:
Rémi Verschelde 2020-03-07 09:26:12 +01:00 committed by GitHub
commit e9e0f141f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -42,7 +42,7 @@ ext.getGodotPluginsBinaries = { ->
String pluginsList = project.property("custom_template_plugins") String pluginsList = project.property("custom_template_plugins")
if (pluginsList != null && !pluginsList.trim().isEmpty()) { if (pluginsList != null && !pluginsList.trim().isEmpty()) {
for (String plugin : pluginsList.split(",")) { for (String plugin : pluginsList.split(",")) {
binDeps += plugin + "*.aar" binDeps += plugin.trim() + "*.aar"
} }
} }
} }

View File

@ -139,7 +139,10 @@ public final class GodotPluginRegistry {
return; return;
} }
enabledPluginsSet = new HashSet<>(Arrays.asList(enabledPluginsList)); enabledPluginsSet = new HashSet<>();
for (String enabledPlugin : enabledPluginsList) {
enabledPluginsSet.add(enabledPlugin.trim());
}
} else { } else {
enabledPluginsSet = null; enabledPluginsSet = null;
} }
@ -148,7 +151,7 @@ public final class GodotPluginRegistry {
for (String metaDataName : metaData.keySet()) { for (String metaDataName : metaData.keySet()) {
// Parse the meta-data looking for entry with the Godot plugin name prefix. // Parse the meta-data looking for entry with the Godot plugin name prefix.
if (metaDataName.startsWith(GODOT_PLUGIN_V1_NAME_PREFIX)) { if (metaDataName.startsWith(GODOT_PLUGIN_V1_NAME_PREFIX)) {
String pluginName = metaDataName.substring(godotPluginV1NamePrefixLength); String pluginName = metaDataName.substring(godotPluginV1NamePrefixLength).trim();
if (enabledPluginsSet != null && !enabledPluginsSet.contains(pluginName)) { if (enabledPluginsSet != null && !enabledPluginsSet.contains(pluginName)) {
Log.w(TAG, "Plugin " + pluginName + " is listed in the dependencies but is not enabled."); Log.w(TAG, "Plugin " + pluginName + " is listed in the dependencies but is not enabled.");
continue; continue;