Merge pull request #39097 from m4gr3d/validate_plugins_build_config

Validate that `Use Custom Build` is enabled when `Plugins` are selected
This commit is contained in:
Rémi Verschelde 2020-05-27 22:54:45 +02:00 committed by GitHub
commit 1a53ee66c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 6 deletions

View file

@ -1823,6 +1823,15 @@ public:
err += etc_error;
}
// Ensure that `Use Custom Build` is enabled if a plugin is selected.
String enabled_plugins_names = get_plugins_names(get_enabled_plugins(p_preset));
bool custom_build_enabled = p_preset->get("custom_template/use_custom_build");
if (!enabled_plugins_names.empty() && !custom_build_enabled) {
valid = false;
err += TTR("\"Use Custom Build\" must be enabled to use the plugins.");
err += "\n";
}
r_error = err;
return valid;
}

View file

@ -72,17 +72,12 @@ ext.getGodotPluginsRemoteBinaries = { ->
/**
* Parse the project properties for the 'plugins_local_binaries' property and return
* their binaries for inclusion in the build dependencies.
*
* Returns the prebuilt plugins if the 'plugins_local_binaries' property is unavailable.
*/
ext.getGodotPluginsLocalBinaries = { ->
// Set the prebuilt plugins as default. If custom build is enabled,
// the 'plugins_local_binaries' will be defined so we can use it instead.
Set<String> binDeps = ["libs/plugins/GodotPayment.release.aar"]
Set<String> binDeps = []
// Retrieve the list of local plugins binaries.
if (project.hasProperty("plugins_local_binaries")) {
binDeps.clear()
String pluginsList = project.property("plugins_local_binaries")
if (pluginsList != null && !pluginsList.trim().isEmpty()) {
for (String plugin : pluginsList.split(PLUGIN_VALUE_SEPARATOR_REGEX)) {

View file

@ -193,4 +193,6 @@ task cleanGodotTemplates(type: Delete) {
delete("$binDir/android_source.zip")
delete("$binDir/godot-lib.debug.aar")
delete("$binDir/godot-lib.release.aar")
finalizedBy getTasksByName("clean", true)
}