Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate that Use Custom Build is enabled when Plugins are selected #39097

Merged
merged 1 commit into from
May 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions platform/android/export/export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1823,6 +1823,15 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
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;
}
Expand Down
7 changes: 1 addition & 6 deletions platform/android/java/app/config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 2 additions & 0 deletions platform/android/java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}