You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-03 16:55:53 +00:00
Fix apk install after gradle build for the Android editor
This commit is contained in:
@@ -32,15 +32,17 @@
|
|||||||
#include "android_editor_gradle_runner.h"
|
#include "android_editor_gradle_runner.h"
|
||||||
|
|
||||||
#include "editor/editor_interface.h"
|
#include "editor/editor_interface.h"
|
||||||
|
#include "editor/settings/editor_settings.h"
|
||||||
#include "scene/gui/dialogs.h"
|
#include "scene/gui/dialogs.h"
|
||||||
#include "scene/gui/rich_text_label.h"
|
#include "scene/gui/rich_text_label.h"
|
||||||
|
|
||||||
#include "../java_godot_wrapper.h"
|
#include "../java_godot_wrapper.h"
|
||||||
#include "../os_android.h"
|
#include "../os_android.h"
|
||||||
|
|
||||||
void AndroidEditorGradleRunner::run_gradle(const String &p_project_path, const String &p_build_path, const List<String> &p_gradle_build_args, const List<String> &p_gradle_copy_args) {
|
void AndroidEditorGradleRunner::run_gradle(const String &p_project_path, const String &p_build_path, const String &p_output_path, const List<String> &p_gradle_build_args, const List<String> &p_gradle_copy_args) {
|
||||||
project_path = p_project_path;
|
project_path = p_project_path;
|
||||||
build_path = p_build_path;
|
build_path = p_build_path;
|
||||||
|
output_path = p_output_path;
|
||||||
gradle_build_args = p_gradle_build_args;
|
gradle_build_args = p_gradle_build_args;
|
||||||
gradle_copy_args = p_gradle_copy_args;
|
gradle_copy_args = p_gradle_copy_args;
|
||||||
|
|
||||||
@@ -151,6 +153,11 @@ void AndroidEditorGradleRunner::_android_gradle_build_clean_project(bool p_was_s
|
|||||||
|
|
||||||
if (p_was_successful) {
|
if (p_was_successful) {
|
||||||
output_dialog->hide();
|
output_dialog->hide();
|
||||||
|
|
||||||
|
bool prompt_apk_install = EDITOR_GET("export/android/install_exported_apk");
|
||||||
|
if (prompt_apk_install) {
|
||||||
|
OS_Android::get_singleton()->shell_open(output_path);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
output_dialog->get_ok_button()->set_disabled(false);
|
output_dialog->get_ok_button()->set_disabled(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ class AndroidEditorGradleRunner : public Object {
|
|||||||
|
|
||||||
String project_path;
|
String project_path;
|
||||||
String build_path;
|
String build_path;
|
||||||
|
String output_path;
|
||||||
List<String> gradle_build_args;
|
List<String> gradle_build_args;
|
||||||
List<String> gradle_copy_args;
|
List<String> gradle_copy_args;
|
||||||
int64_t job_id;
|
int64_t job_id;
|
||||||
@@ -70,7 +71,7 @@ class AndroidEditorGradleRunner : public Object {
|
|||||||
void _android_gradle_build_cancel();
|
void _android_gradle_build_cancel();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void run_gradle(const String &p_project_path, const String &p_build_path, const List<String> &p_gradle_build_args, const List<String> &p_gradle_copy_args);
|
void run_gradle(const String &p_project_path, const String &p_build_path, const String &p_output_path, const List<String> &p_gradle_build_args, const List<String> &p_gradle_copy_args);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ANDROID_ENABLED
|
#endif // ANDROID_ENABLED
|
||||||
|
|||||||
@@ -3954,6 +3954,7 @@ Error EditorExportPlatformAndroid::export_project_helper(const Ref<EditorExportP
|
|||||||
android_editor_gradle_runner->run_gradle(
|
android_editor_gradle_runner->run_gradle(
|
||||||
project_path,
|
project_path,
|
||||||
build_path.substr(project_path.length()),
|
build_path.substr(project_path.length()),
|
||||||
|
export_path.path_join(export_filename),
|
||||||
cmdline,
|
cmdline,
|
||||||
copy_args);
|
copy_args);
|
||||||
#else
|
#else
|
||||||
|
|||||||
Reference in New Issue
Block a user