summaryrefslogtreecommitdiff
path: root/platform/ios
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/ios
parent5aacac5853591eafe4409fd654d91b7f7cbb9e2a (diff)
Refactor the export checking logic to improve separation of concerns
Diffstat (limited to 'platform/ios')
-rw-r--r--platform/ios/export/export_plugin.cpp15
-rw-r--r--platform/ios/export/export_plugin.h3
2 files changed, 15 insertions, 3 deletions
diff --git a/platform/ios/export/export_plugin.cpp b/platform/ios/export/export_plugin.cpp
index 001c9b803d..2771ab8ca2 100644
--- a/platform/ios/export/export_plugin.cpp
+++ b/platform/ios/export/export_plugin.cpp
@@ -1817,7 +1817,7 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p
return OK;
}
-bool EditorExportPlatformIOS::can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const {
+bool EditorExportPlatformIOS::has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const {
String err;
bool valid = false;
@@ -1842,7 +1842,18 @@ bool EditorExportPlatformIOS::can_export(const Ref<EditorExportPreset> &p_preset
valid = dvalid || rvalid;
r_missing_templates = !valid;
- // Validate the rest of the configuration.
+ if (!err.is_empty()) {
+ r_error = err;
+ }
+
+ return valid;
+}
+
+bool EditorExportPlatformIOS::has_valid_project_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error) const {
+ String err;
+ bool valid = true;
+
+ // Validate the project configuration.
String team_id = p_preset->get("application/app_store_team_id");
if (team_id.length() == 0) {
diff --git a/platform/ios/export/export_plugin.h b/platform/ios/export/export_plugin.h
index e32aef82dd..8079eda8f6 100644
--- a/platform/ios/export/export_plugin.h
+++ b/platform/ios/export/export_plugin.h
@@ -198,7 +198,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("mobile");