Skip to content

Commit

Permalink
Update the Android export validation logic to account for the custom …
Browse files Browse the repository at this point in the history
…gradle android source template

Follow-up to godotengine#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
  • Loading branch information
m4gr3d committed Mar 5, 2024
1 parent a07dd0d commit 90b4364
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion platform/android/export/export_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2408,9 +2408,22 @@ bool EditorExportPlatformAndroid::has_valid_export_configuration(const Ref<Edito
err += template_err;
}
} else {
// Validate the custom gradle android source template.
bool android_source_template_valid = false;
const String android_source_template = p_preset->get("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;
Expand Down

0 comments on commit 90b4364

Please sign in to comment.