summaryrefslogtreecommitdiff
path: root/platform/macos/export
diff options
context:
space:
mode:
authorFredia Huya-Kouadio <fhuya@fb.com>2022-07-17 15:26:03 -0400
committerFredia Huya-Kouadio <fhuyakou@gmail.com>2022-08-14 09:12:04 -0700
commit45c73775561808ccb2eb4a59927d9c59965e3d20 (patch)
tree52ebf81a51700c95c46853b6788705cadea8eb38 /platform/macos/export
parent5aacac5853591eafe4409fd654d91b7f7cbb9e2a (diff)
Refactor the export checking logic to improve separation of concerns
Diffstat (limited to 'platform/macos/export')
-rw-r--r--platform/macos/export/export_plugin.cpp13
-rw-r--r--platform/macos/export/export_plugin.h3
2 files changed, 14 insertions, 2 deletions
diff --git a/platform/macos/export/export_plugin.cpp b/platform/macos/export/export_plugin.cpp
index bcc2636c07..edce9c0380 100644
--- a/platform/macos/export/export_plugin.cpp
+++ b/platform/macos/export/export_plugin.cpp
@@ -1550,7 +1550,7 @@ void EditorExportPlatformMacOS::_zip_folder_recursive(zipFile &p_zip, const Stri
da->list_dir_end();
}
-bool EditorExportPlatformMacOS::can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const {
+bool EditorExportPlatformMacOS::has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const {
String err;
bool valid = false;
@@ -1580,6 +1580,17 @@ bool EditorExportPlatformMacOS::can_export(const Ref<EditorExportPreset> &p_pres
valid = dvalid || rvalid;
r_missing_templates = !valid;
+ if (!err.is_empty()) {
+ r_error = err;
+ }
+
+ return valid;
+}
+
+bool EditorExportPlatformMacOS::has_valid_project_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error) const {
+ String err;
+ bool valid = true;
+
String identifier = p_preset->get("application/bundle_identifier");
String pn_err;
if (!is_package_name_valid(identifier, &pn_err)) {
diff --git a/platform/macos/export/export_plugin.h b/platform/macos/export/export_plugin.h
index 21bc380d55..4603c61a28 100644
--- a/platform/macos/export/export_plugin.h
+++ b/platform/macos/export/export_plugin.h
@@ -119,7 +119,8 @@ public:
}
virtual Error export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags = 0) override;
- virtual bool can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const override;
+ virtual bool has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const override;
+ virtual bool has_valid_project_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error) const override;
virtual void get_platform_features(List<String> *r_features) const override {
r_features->push_back("pc");