From 9a8455f5a7d3d76a6a1ba42b9bd0790a141f25a8 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Wed, 5 Feb 2020 22:21:47 +0100 Subject: [PATCH] Remove per-file progress reporting when exporting to Android Calling `step()` on EditorProgress too often will slow down the rest of the editor, so it's best avoided. This is also more consistent with other exporters, as most of them don't report per-file progress either. Exporting a 2D project with ~1,100 files to Android now takes about 10 seconds from a debug editor build instead of 65 seconds. This closes #30850. (cherry picked from commit 2dd3a01d11dc4786c297e95e6c716f1fb8b7cff4) --- platform/android/export/export.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index b9968c08aa4..5c44a16c8f6 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -642,9 +642,6 @@ class EditorExportPlatformAndroid : public EditorExportPlatform { String dst_path = p_path.replace_first("res://", "assets/"); store_in_apk(ed, dst_path, p_data, _should_compress_asset(p_path, p_data) ? Z_DEFLATED : 0); - if (ed->ep->step("File: " + p_path, 3 + p_file * 100 / p_total)) { - return ERR_SKIP; - } return OK; } @@ -1497,7 +1494,7 @@ public: String adb = EditorSettings::get_singleton()->get("export/android/adb"); // Export_temp APK. - if (ep.step("Exporting APK", 0)) { + if (ep.step("Exporting APK...", 0)) { device_lock->unlock(); return ERR_SKIP; } @@ -1547,7 +1544,7 @@ public: } print_line("Installing to device (please wait...): " + devices[p_device].name); - if (ep.step("Installing to device (please wait...)", 2)) { + if (ep.step("Installing to device, please wait...", 2)) { CLEANUP_AND_RETURN(ERR_SKIP); } @@ -1614,7 +1611,7 @@ public: } } - if (ep.step("Running on Device...", 3)) { + if (ep.step("Running on device...", 3)) { CLEANUP_AND_RETURN(ERR_SKIP); } args.clear(); @@ -2119,7 +2116,7 @@ public: FileAccess *src_f = NULL; zlib_filefunc_def io = zipio_create_io_from_file(&src_f); - if (ep.step("Creating APK", 0)) { + if (ep.step("Creating APK...", 0)) { return ERR_SKIP; } @@ -2281,7 +2278,7 @@ public: ret = unzGoToNextFile(pkg); } - if (ep.step("Adding Files...", 1)) { + if (ep.step("Adding files...", 1)) { CLEANUP_AND_RETURN(ERR_SKIP); } Error err = OK;