Merge pull request #114384 from syntaxerror247/android-export-stuff
Misc Android export fixes
This commit is contained in:
commit
a60390c0ee
4 changed files with 18 additions and 7 deletions
|
|
@ -1425,8 +1425,12 @@ void ProjectExportDialog::_export_project() {
|
|||
export_project->add_filter("*." + extension, vformat(TTR("%s Export"), platform->get_name()));
|
||||
}
|
||||
|
||||
if (!current->get_export_path().is_empty()) {
|
||||
export_project->set_current_path(current->get_export_path());
|
||||
String path = current->get_export_path();
|
||||
if (!path.is_empty()) {
|
||||
if (extension_list.find(path.get_extension()) == nullptr && extension_list.size() >= 1) {
|
||||
path = path.get_basename() + "." + extension_list.front()->get();
|
||||
}
|
||||
export_project->set_current_path(path);
|
||||
} else {
|
||||
if (extension_list.size() >= 1) {
|
||||
export_project->set_current_file(default_filename + "." + extension_list.front()->get());
|
||||
|
|
|
|||
|
|
@ -39,10 +39,11 @@
|
|||
#include "../java_godot_wrapper.h"
|
||||
#include "../os_android.h"
|
||||
|
||||
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) {
|
||||
void AndroidEditorGradleRunner::run_gradle(const String &p_project_path, const String &p_build_path, const String &p_output_path, const String &p_export_format, const List<String> &p_gradle_build_args, const List<String> &p_gradle_copy_args) {
|
||||
project_path = p_project_path;
|
||||
build_path = p_build_path;
|
||||
output_path = p_output_path;
|
||||
export_format = p_export_format;
|
||||
gradle_build_args = p_gradle_build_args;
|
||||
gradle_copy_args = p_gradle_copy_args;
|
||||
|
||||
|
|
@ -155,7 +156,7 @@ void AndroidEditorGradleRunner::_android_gradle_build_clean_project(bool p_was_s
|
|||
output_dialog->hide();
|
||||
|
||||
bool prompt_apk_install = EDITOR_GET("export/android/install_exported_apk");
|
||||
if (prompt_apk_install) {
|
||||
if (prompt_apk_install && export_format == "apk") {
|
||||
OS_Android::get_singleton()->shell_open(output_path);
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ class AndroidEditorGradleRunner : public Object {
|
|||
String project_path;
|
||||
String build_path;
|
||||
String output_path;
|
||||
String export_format;
|
||||
List<String> gradle_build_args;
|
||||
List<String> gradle_copy_args;
|
||||
int64_t job_id;
|
||||
|
|
@ -71,7 +72,7 @@ class AndroidEditorGradleRunner : public Object {
|
|||
void _android_gradle_build_cancel();
|
||||
|
||||
public:
|
||||
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);
|
||||
void run_gradle(const String &p_project_path, const String &p_build_path, const String &p_output_path, const String &p_export_format, const List<String> &p_gradle_build_args, const List<String> &p_gradle_copy_args);
|
||||
};
|
||||
|
||||
#endif // ANDROID_ENABLED
|
||||
|
|
|
|||
|
|
@ -3116,8 +3116,12 @@ bool EditorExportPlatformAndroid::has_valid_project_configuration(const Ref<Edit
|
|||
|
||||
List<String> EditorExportPlatformAndroid::get_binary_extensions(const Ref<EditorExportPreset> &p_preset) const {
|
||||
List<String> list;
|
||||
list.push_back("apk");
|
||||
list.push_back("aab");
|
||||
int export_format = int(p_preset->get("gradle_build/export_format"));
|
||||
if (export_format == EXPORT_FORMAT_AAB) {
|
||||
list.push_back("aab");
|
||||
} else {
|
||||
list.push_back("apk");
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
|
@ -3958,6 +3962,7 @@ Error EditorExportPlatformAndroid::export_project_helper(const Ref<EditorExportP
|
|||
project_path,
|
||||
build_path.substr(project_path.length()),
|
||||
export_path.path_join(export_filename),
|
||||
export_format_arg,
|
||||
cmdline,
|
||||
copy_args);
|
||||
#else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue