diff --git a/doc/classes/EditorExportPlatform.xml b/doc/classes/EditorExportPlatform.xml index 07b18cf1bb..668f81c23d 100644 --- a/doc/classes/EditorExportPlatform.xml +++ b/doc/classes/EditorExportPlatform.xml @@ -59,8 +59,9 @@ + - Creates a full project at [param path] for the specified [param preset]. + Creates a full project at [param path] for the specified [param preset]. If [param notify] is [code]true[/code], plugins using [method EditorExportPlugin._export_begin] will be called during the process. diff --git a/editor/export/editor_export_platform.compat.inc b/editor/export/editor_export_platform.compat.inc index a38614c9f4..b8435f0cba 100644 --- a/editor/export/editor_export_platform.compat.inc +++ b/editor/export/editor_export_platform.compat.inc @@ -38,7 +38,12 @@ Vector EditorExportPlatform::_get_forced_export_files_bind_compat_71542( return get_forced_export_files(Ref()); } +Error EditorExportPlatform::_export_project_bind_compat_118787(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags) { + return export_project(p_preset, p_debug, p_path, p_flags, true); +} + void EditorExportPlatform::_bind_compatibility_methods() { + ClassDB::bind_compatibility_method(D_METHOD("export_project", "preset", "debug", "path", "flags"), &EditorExportPlatform::_export_project_bind_compat_118787, DEFVAL(0)); ClassDB::bind_compatibility_static_method("EditorExportPlatform", D_METHOD("get_forced_export_files"), &EditorExportPlatform::_get_forced_export_files_bind_compat_71542); } diff --git a/editor/export/editor_export_platform.cpp b/editor/export/editor_export_platform.cpp index 8bdcd76a8d..406fa8a806 100644 --- a/editor/export/editor_export_platform.cpp +++ b/editor/export/editor_export_platform.cpp @@ -2758,7 +2758,7 @@ void EditorExportPlatform::_bind_methods() { ClassDB::bind_method(D_METHOD("export_project_files", "preset", "debug", "save_cb", "shared_cb"), &EditorExportPlatform::_export_project_files, DEFVAL(Callable())); - ClassDB::bind_method(D_METHOD("export_project", "preset", "debug", "path", "flags"), &EditorExportPlatform::export_project, DEFVAL(0)); + ClassDB::bind_method(D_METHOD("export_project", "preset", "debug", "path", "flags", "notify"), &EditorExportPlatform::export_project, DEFVAL(0), DEFVAL(true)); ClassDB::bind_method(D_METHOD("export_pack", "preset", "debug", "path", "flags"), &EditorExportPlatform::export_pack, DEFVAL(0)); ClassDB::bind_method(D_METHOD("export_zip", "preset", "debug", "path", "flags"), &EditorExportPlatform::export_zip, DEFVAL(0)); ClassDB::bind_method(D_METHOD("export_pack_patch", "preset", "debug", "path", "patches", "flags"), &EditorExportPlatform::export_pack_patch, DEFVAL(PackedStringArray()), DEFVAL(0)); diff --git a/editor/export/editor_export_platform.h b/editor/export/editor_export_platform.h index 4d21da01bb..3bc1e2e4d8 100644 --- a/editor/export/editor_export_platform.h +++ b/editor/export/editor_export_platform.h @@ -222,6 +222,7 @@ protected: Ref _load_icon_or_splash_image(const String &p_path, Error *r_error) const; #ifndef DISABLE_DEPRECATED + Error _export_project_bind_compat_118787(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags = 0); static Vector _get_forced_export_files_bind_compat_71542(); static void _bind_compatibility_methods(); #endif @@ -353,7 +354,7 @@ public: virtual bool has_valid_project_configuration(const Ref &p_preset, String &r_error) const = 0; virtual List get_binary_extensions(const Ref &p_preset) const = 0; - virtual Error export_project(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags = 0) = 0; + virtual Error export_project(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags = 0, bool p_notify = true) = 0; virtual Error export_pack(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags = 0); virtual Error export_zip(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags = 0); virtual Error export_pack_patch(const Ref &p_preset, bool p_debug, const String &p_path, const Vector &p_patches = Vector(), BitField p_flags = 0); diff --git a/editor/export/editor_export_platform_apple_embedded.cpp b/editor/export/editor_export_platform_apple_embedded.cpp index 807962f66b..7c9b413ac5 100644 --- a/editor/export/editor_export_platform_apple_embedded.cpp +++ b/editor/export/editor_export_platform_apple_embedded.cpp @@ -1648,12 +1648,14 @@ Error EditorExportPlatformAppleEmbedded::_export_apple_embedded_plugins(const Re return OK; } -Error EditorExportPlatformAppleEmbedded::export_project(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags) { - return _export_project_helper(p_preset, p_debug, p_path, p_flags, false); +Error EditorExportPlatformAppleEmbedded::export_project(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags, bool p_notify) { + return _export_project_helper(p_preset, p_debug, p_path, p_flags, p_notify, false); } -Error EditorExportPlatformAppleEmbedded::_export_project_helper(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags, bool p_oneclick) { - ExportNotifier notifier(*this, p_preset, p_debug, p_path, p_flags); +Error EditorExportPlatformAppleEmbedded::_export_project_helper(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags, bool p_notify, bool p_oneclick) { + if (p_notify) { + ExportNotifier notifier(*this, p_preset, p_debug, p_path, p_flags); + } const String dest_dir = p_path.get_base_dir() + "/"; const String binary_name = p_path.get_file().get_basename(); @@ -2694,7 +2696,7 @@ Error EditorExportPlatformAppleEmbedded::run(const Ref &p_pr Device dev = devices[p_device]; // Export before sending to device. - Error err = _export_project_helper(p_preset, true, tmp_export_path, p_debug_flags, true); + Error err = _export_project_helper(p_preset, true, tmp_export_path, p_debug_flags, true, true); if (err != OK) { CLEANUP_AND_RETURN(err); diff --git a/editor/export/editor_export_platform_apple_embedded.h b/editor/export/editor_export_platform_apple_embedded.h index 4536ce05d4..f784431a12 100644 --- a/editor/export/editor_export_platform_apple_embedded.h +++ b/editor/export/editor_export_platform_apple_embedded.h @@ -199,7 +199,7 @@ private: Error _export_additional_assets(const Ref &p_preset, const String &p_out_dir, const Vector &p_libraries, Vector &r_exported_assets); Error _export_apple_embedded_plugins(const Ref &p_preset, AppleEmbeddedConfigData &p_config_data, const String &p_dest_dir, const Vector &p_module_libs, Vector &r_exported_assets, bool p_debug); - Error _export_project_helper(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags, bool p_oneclick); + Error _export_project_helper(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags, bool p_notify, bool p_oneclick); bool is_package_name_valid(const String &p_package, String *r_error = nullptr) const; @@ -274,7 +274,7 @@ public: return list; } - virtual Error export_project(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags = 0) override; + virtual Error export_project(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags = 0, bool p_notify = true) override; virtual bool has_valid_export_configuration(const Ref &p_preset, String &r_error, bool &r_missing_templates, bool p_debug = false) const override; virtual bool has_valid_project_configuration(const Ref &p_preset, String &r_error) const override; diff --git a/editor/export/editor_export_platform_extension.cpp b/editor/export/editor_export_platform_extension.cpp index e23b524d28..d56179f222 100644 --- a/editor/export/editor_export_platform_extension.cpp +++ b/editor/export/editor_export_platform_extension.cpp @@ -280,8 +280,10 @@ List EditorExportPlatformExtension::get_binary_extensions(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags) { - ExportNotifier notifier(*this, p_preset, p_debug, p_path, p_flags); +Error EditorExportPlatformExtension::export_project(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags, bool p_notify) { + if (p_notify) { + ExportNotifier notifier(*this, p_preset, p_debug, p_path, p_flags); + } Error ret = FAILED; GDVIRTUAL_CALL(_export_project, p_preset, p_debug, p_path, p_flags, ret); diff --git a/editor/export/editor_export_platform_extension.h b/editor/export/editor_export_platform_extension.h index 88912b048d..846cb913f8 100644 --- a/editor/export/editor_export_platform_extension.h +++ b/editor/export/editor_export_platform_extension.h @@ -134,7 +134,7 @@ public: virtual List get_binary_extensions(const Ref &p_preset) const override; GDVIRTUAL1RC_REQUIRED(Vector, _get_binary_extensions, Ref); - virtual Error export_project(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags = 0) override; + virtual Error export_project(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags = 0, bool p_notify = true) override; GDVIRTUAL4R_REQUIRED(Error, _export_project, Ref, bool, const String &, BitField); virtual Error export_pack(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags = 0) override; diff --git a/editor/export/editor_export_platform_pc.cpp b/editor/export/editor_export_platform_pc.cpp index 6dd5410432..8051780800 100644 --- a/editor/export/editor_export_platform_pc.cpp +++ b/editor/export/editor_export_platform_pc.cpp @@ -138,8 +138,10 @@ bool EditorExportPlatformPC::has_valid_project_configuration(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags) { - ExportNotifier notifier(*this, p_preset, p_debug, p_path, p_flags); +Error EditorExportPlatformPC::export_project(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags, bool p_notify) { + if (p_notify) { + ExportNotifier notifier(*this, p_preset, p_debug, p_path, p_flags); + } Error err = prepare_template(p_preset, p_debug, p_path, p_flags); if (err == OK) { diff --git a/editor/export/editor_export_platform_pc.h b/editor/export/editor_export_platform_pc.h index d3318060d9..61ed976d8f 100644 --- a/editor/export/editor_export_platform_pc.h +++ b/editor/export/editor_export_platform_pc.h @@ -55,7 +55,7 @@ public: virtual bool has_valid_export_configuration(const Ref &p_preset, String &r_error, bool &r_missing_templates, bool p_debug = false) const override; virtual bool has_valid_project_configuration(const Ref &p_preset, String &r_error) const override; - virtual Error export_project(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags = 0) override; + virtual Error export_project(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags = 0, bool p_notify = true) override; virtual Error sign_shared_object(const Ref &p_preset, bool p_debug, const String &p_path); virtual String get_template_file_name(const String &p_target, const String &p_arch) const = 0; diff --git a/misc/extension_api_validation/4.6-stable/GH-118787.txt b/misc/extension_api_validation/4.6-stable/GH-118787.txt new file mode 100644 index 0000000000..01291b1dd9 --- /dev/null +++ b/misc/extension_api_validation/4.6-stable/GH-118787.txt @@ -0,0 +1,5 @@ +GH-118787 +-------------- +Validate extension JSON: Error: Field 'classes/EditorExportPlatform/methods/export_project/arguments': size changed value in new API, from 4 to 5. + +Added "notify" parameter. Compatibility method registered. diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp index 6ebc9fef33..a727fabe76 100644 --- a/platform/android/export/export_plugin.cpp +++ b/platform/android/export/export_plugin.cpp @@ -3603,7 +3603,7 @@ bool EditorExportPlatformAndroid::_is_clean_build_required(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags) { +Error EditorExportPlatformAndroid::export_project(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags, bool p_notify) { int export_format = int(p_preset->get("gradle_build/export_format")); bool should_sign = p_preset->get("package/signed"); return export_project_helper(p_preset, p_debug, p_path, export_format, should_sign, p_flags); diff --git a/platform/android/export/export_plugin.h b/platform/android/export/export_plugin.h index c1a389ba02..4bc7a21d46 100644 --- a/platform/android/export/export_plugin.h +++ b/platform/android/export/export_plugin.h @@ -282,7 +282,7 @@ public: static String join_list(const List &p_parts, const String &p_separator); static String join_abis(const Vector &p_parts, const String &p_separator, bool p_use_arch); - virtual Error export_project(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags = 0) override; + virtual Error export_project(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags = 0, bool p_notify = true) override; Error export_project_helper(const Ref &p_preset, bool p_debug, const String &p_path, int export_format, bool should_sign, BitField p_flags); diff --git a/platform/linuxbsd/export/export_plugin.cpp b/platform/linuxbsd/export/export_plugin.cpp index 1b812eee88..9dbe3983ce 100644 --- a/platform/linuxbsd/export/export_plugin.cpp +++ b/platform/linuxbsd/export/export_plugin.cpp @@ -61,7 +61,7 @@ Error EditorExportPlatformLinuxBSD::_export_debug_script(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags) { +Error EditorExportPlatformLinuxBSD::export_project(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags, bool p_notify) { String custom_debug = p_preset->get("custom_template/debug"); String custom_release = p_preset->get("custom_template/release"); String arch = p_preset->get("binary_format/architecture"); @@ -109,10 +109,12 @@ Error EditorExportPlatformLinuxBSD::export_project(const Ref } tmp_app_dir->make_dir_recursive(tmp_dir_path); path = tmp_dir_path.path_join(p_path.get_file().get_basename()); + + ExportNotifier notifier(*this, p_preset, p_debug, p_path, p_flags); } // Export project. - Error err = EditorExportPlatformPC::export_project(p_preset, p_debug, path, p_flags); + Error err = EditorExportPlatformPC::export_project(p_preset, p_debug, path, p_flags, !export_as_zip); if (err != OK) { // Message is supplied by the subroutine method. return err; diff --git a/platform/linuxbsd/export/export_plugin.h b/platform/linuxbsd/export/export_plugin.h index df6734f5d1..0861c3e979 100644 --- a/platform/linuxbsd/export/export_plugin.h +++ b/platform/linuxbsd/export/export_plugin.h @@ -74,7 +74,7 @@ public: virtual List get_binary_extensions(const Ref &p_preset) const override; virtual bool get_export_option_visibility(const EditorExportPreset *p_preset, const String &p_option) const override; virtual bool has_valid_export_configuration(const Ref &p_preset, String &r_error, bool &r_missing_templates, bool p_debug = false) const override; - virtual Error export_project(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags = 0) override; + virtual Error export_project(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags = 0, bool p_notify = true) override; virtual String get_template_file_name(const String &p_target, const String &p_arch) const override; virtual Error fixup_embedded_pck(const String &p_path, int64_t p_embedded_start, int64_t p_embedded_size) override; virtual bool is_executable(const String &p_path) const override; diff --git a/platform/macos/export/export_plugin.cpp b/platform/macos/export/export_plugin.cpp index 77cf6d5d9a..d23986f340 100644 --- a/platform/macos/export/export_plugin.cpp +++ b/platform/macos/export/export_plugin.cpp @@ -1623,8 +1623,10 @@ Error EditorExportPlatformMacOS::_export_debug_script(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags) { - ExportNotifier notifier(*this, p_preset, p_debug, p_path, p_flags); +Error EditorExportPlatformMacOS::export_project(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags, bool p_notify) { + if (p_notify) { + ExportNotifier notifier(*this, p_preset, p_debug, p_path, p_flags); + } const String base_dir = p_path.get_base_dir(); diff --git a/platform/macos/export/export_plugin.h b/platform/macos/export/export_plugin.h index 34fde9dca6..1733558a0d 100644 --- a/platform/macos/export/export_plugin.h +++ b/platform/macos/export/export_plugin.h @@ -143,7 +143,7 @@ public: virtual bool is_executable(const String &p_path) const override; virtual List get_binary_extensions(const Ref &p_preset) const override; - virtual Error export_project(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags = 0) override; + virtual Error export_project(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags = 0, bool p_notify = true) override; virtual bool has_valid_export_configuration(const Ref &p_preset, String &r_error, bool &r_missing_templates, bool p_debug = false) const override; virtual bool has_valid_project_configuration(const Ref &p_preset, String &r_error) const override; diff --git a/platform/web/export/export_plugin.cpp b/platform/web/export/export_plugin.cpp index f495a821a9..fbcd26c35f 100644 --- a/platform/web/export/export_plugin.cpp +++ b/platform/web/export/export_plugin.cpp @@ -487,8 +487,10 @@ List EditorExportPlatformWeb::get_binary_extensions(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags) { - ExportNotifier notifier(*this, p_preset, p_debug, p_path, p_flags); +Error EditorExportPlatformWeb::export_project(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags, bool p_notify) { + if (p_notify) { + ExportNotifier notifier(*this, p_preset, p_debug, p_path, p_flags); + } const String custom_debug = p_preset->get("custom_template/debug"); const String custom_release = p_preset->get("custom_template/release"); diff --git a/platform/web/export/export_plugin.h b/platform/web/export/export_plugin.h index 5de8ff06dd..b5a1640c8c 100644 --- a/platform/web/export/export_plugin.h +++ b/platform/web/export/export_plugin.h @@ -125,7 +125,7 @@ public: virtual bool has_valid_export_configuration(const Ref &p_preset, String &r_error, bool &r_missing_templates, bool p_debug = false) const override; virtual bool has_valid_project_configuration(const Ref &p_preset, String &r_error) const override; virtual List get_binary_extensions(const Ref &p_preset) const override; - virtual Error export_project(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags = 0) override; + virtual Error export_project(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags = 0, bool p_notify = true) override; virtual bool poll_export() override; virtual int get_options_count() const override; diff --git a/platform/windows/export/export_plugin.cpp b/platform/windows/export/export_plugin.cpp index 115400fbbd..81607019bc 100644 --- a/platform/windows/export/export_plugin.cpp +++ b/platform/windows/export/export_plugin.cpp @@ -203,7 +203,7 @@ Error EditorExportPlatformWindows::modify_template(const Ref return OK; } -Error EditorExportPlatformWindows::export_project(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags) { +Error EditorExportPlatformWindows::export_project(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags, bool p_notify) { String custom_debug = p_preset->get("custom_template/debug"); String custom_release = p_preset->get("custom_template/release"); String arch = p_preset->get("binary_format/architecture"); @@ -306,7 +306,10 @@ Error EditorExportPlatformWindows::export_project(const Ref pck_path = pck_path.get_basename() + ".tmp"; } - Error err = EditorExportPlatformPC::export_project(p_preset, p_debug, pck_path, p_flags); + if (export_as_zip) { + ExportNotifier notifier(*this, p_preset, p_debug, p_path, p_flags); + } + Error err = EditorExportPlatformPC::export_project(p_preset, p_debug, pck_path, p_flags, !export_as_zip); if (err != OK) { // Message is supplied by the subroutine method. return err; diff --git a/platform/windows/export/export_plugin.h b/platform/windows/export/export_plugin.h index 5717a55df3..69b87366b7 100644 --- a/platform/windows/export/export_plugin.h +++ b/platform/windows/export/export_plugin.h @@ -73,7 +73,7 @@ class EditorExportPlatformWindows : public EditorExportPlatformPC { String _get_exe_arch(const String &p_path) const; public: - virtual Error export_project(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags = 0) override; + virtual Error export_project(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags = 0, bool p_notify = true) override; virtual Error modify_template(const Ref &p_preset, bool p_debug, const String &p_path, BitField p_flags) override; virtual Error sign_shared_object(const Ref &p_preset, bool p_debug, const String &p_path) override; virtual List get_binary_extensions(const Ref &p_preset) const override;