You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Preserve the output from the gradle build command
Updates `EditorNode#execute_and_show_output(...)` to return the output of the executed command.
(cherry picked from commit 136b7f9c52)
This commit is contained in:
committed by
Yuri Sizov
parent
a3432848b2
commit
f6a9129219
@@ -2939,10 +2939,13 @@ Error EditorExportPlatformAndroid::export_project_helper(const Ref<EditorExportP
|
||||
}
|
||||
}
|
||||
|
||||
int result = EditorNode::get_singleton()->execute_and_show_output(TTR("Building Android Project (gradle)"), build_command, cmdline);
|
||||
String build_project_output;
|
||||
int result = EditorNode::get_singleton()->execute_and_show_output(TTR("Building Android Project (gradle)"), build_command, cmdline, true, false, &build_project_output);
|
||||
if (result != 0) {
|
||||
add_message(EXPORT_MESSAGE_ERROR, TTR("Export"), TTR("Building of Android project failed, check output for the error. Alternatively visit docs.godotengine.org for Android build documentation."));
|
||||
add_message(EXPORT_MESSAGE_ERROR, TTR("Export"), TTR("Building of Android project failed, check output for the error:") + "\n\n" + build_project_output);
|
||||
return ERR_CANT_CREATE;
|
||||
} else {
|
||||
print_verbose(build_project_output);
|
||||
}
|
||||
|
||||
List<String> copy_args;
|
||||
@@ -2969,10 +2972,13 @@ Error EditorExportPlatformAndroid::export_project_helper(const Ref<EditorExportP
|
||||
copy_args.push_back("-Pexport_filename=" + export_filename);
|
||||
|
||||
print_verbose("Copying Android binary using gradle command: " + String("\n") + build_command + " " + join_list(copy_args, String(" ")));
|
||||
int copy_result = EditorNode::get_singleton()->execute_and_show_output(TTR("Moving output"), build_command, copy_args);
|
||||
String copy_binary_output;
|
||||
int copy_result = EditorNode::get_singleton()->execute_and_show_output(TTR("Moving output"), build_command, copy_args, true, false, ©_binary_output);
|
||||
if (copy_result != 0) {
|
||||
add_message(EXPORT_MESSAGE_ERROR, TTR("Export"), TTR("Unable to copy and rename export file, check gradle project directory for outputs."));
|
||||
add_message(EXPORT_MESSAGE_ERROR, TTR("Export"), TTR("Unable to copy and rename export file:") + "\n\n" + copy_binary_output);
|
||||
return ERR_CANT_CREATE;
|
||||
} else {
|
||||
print_verbose(copy_binary_output);
|
||||
}
|
||||
|
||||
print_verbose("Successfully completed Android gradle build.");
|
||||
|
||||
Reference in New Issue
Block a user