From 90b43648c4536bddd4efa1ec684f971c9ec43632 Mon Sep 17 00:00:00 2001 From: Fredia Huya-Kouadio Date: Tue, 5 Mar 2024 01:32:14 -0800 Subject: [PATCH] Update the Android export validation logic to account for the custom gradle android source template Follow-up to https://github.com/godotengine/godot/pull/88297 to address the following issues: - Ensure that the custom gradle android source template is valid. Show a warning if it's not - Don't show an error when the official export templates are not installed but a custom android source template is specified --- platform/android/export/export_plugin.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp index db0352db01..74d22bc44f 100644 --- a/platform/android/export/export_plugin.cpp +++ b/platform/android/export/export_plugin.cpp @@ -2408,9 +2408,22 @@ bool EditorExportPlatformAndroid::has_valid_export_configuration(const Refget("gradle_build/android_source_template"); + if (!android_source_template.is_empty()) { + android_source_template_valid = FileAccess::exists(android_source_template); + if (!android_source_template_valid) { + err += TTR("Custom Android source template not found.") + "\n"; + } + } + + // Validate the installed build template. bool installed_android_build_template = FileAccess::exists(ExportTemplateManager::get_android_build_directory(p_preset).path_join("build.gradle")); if (!installed_android_build_template) { - r_missing_templates = !exists_export_template("android_source.zip", &err); + if (!android_source_template_valid) { + r_missing_templates = !exists_export_template("android_source.zip", &err); + } err += TTR("Android build template not installed in the project. Install it from the Project menu.") + "\n"; } else { r_missing_templates = false;