1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-11 13:10:58 +00:00

Add option to install android build template for export

This PR adds a new "--install-android-build-template" command-line option which causes the android build template to be installed before exporting the project.
This commit is contained in:
Malcolm Nixon
2023-12-05 23:35:52 -05:00
parent 7233bc6736
commit 988c1bf298
3 changed files with 12 additions and 3 deletions

View File

@@ -974,6 +974,9 @@ void EditorNode::_fs_changed() {
} else { // Normal project export.
String config_error;
bool missing_templates;
if (export_defer.android_build_template) {
export_template_manager->install_android_template();
}
if (!platform->can_export(export_preset, config_error, missing_templates, export_defer.debug)) {
ERR_PRINT(vformat("Cannot export project with preset \"%s\" due to configuration errors:\n%s", preset_name, config_error));
err = missing_templates ? ERR_FILE_NOT_FOUND : ERR_UNCONFIGURED;
@@ -4676,11 +4679,12 @@ void EditorNode::_begin_first_scan() {
requested_first_scan = true;
}
Error EditorNode::export_preset(const String &p_preset, const String &p_path, bool p_debug, bool p_pack_only) {
Error EditorNode::export_preset(const String &p_preset, const String &p_path, bool p_debug, bool p_pack_only, bool p_android_build_template) {
export_defer.preset = p_preset;
export_defer.path = p_path;
export_defer.debug = p_debug;
export_defer.pack_only = p_pack_only;
export_defer.android_build_template = p_android_build_template;
cmdline_export_mode = true;
return OK;
}