summaryrefslogtreecommitdiff
path: root/platform/uwp
diff options
context:
space:
mode:
authorFredia Huya-Kouadio <fhuya@fb.com>2022-08-14 19:26:22 -0700
committerGitHub <noreply@github.com>2022-08-14 19:26:22 -0700
commit5a8d786ef9dcfd5b206ec3eeb5e369930e773acc (patch)
tree2274723d72b9dabc2107a6cc87b86b22288c1d13 /platform/uwp
parent128d68796d9f412a5b05cca8714f217341cfa376 (diff)
parent45c73775561808ccb2eb4a59927d9c59965e3d20 (diff)
Merge pull request #63122 from m4gr3d/split_can_export_main
Refactor the export checking logic to improve separation of concerns
Diffstat (limited to 'platform/uwp')
-rw-r--r--platform/uwp/export/export_plugin.cpp23
-rw-r--r--platform/uwp/export/export_plugin.h3
2 files changed, 23 insertions, 3 deletions
diff --git a/platform/uwp/export/export_plugin.cpp b/platform/uwp/export/export_plugin.cpp
index 070c46242f..4e4afb9704 100644
--- a/platform/uwp/export/export_plugin.cpp
+++ b/platform/uwp/export/export_plugin.cpp
@@ -121,7 +121,7 @@ void EditorExportPlatformUWP::get_export_options(List<ExportOption> *r_options)
}
}
-bool EditorExportPlatformUWP::can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const {
+bool EditorExportPlatformUWP::has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const {
#ifndef DEV_ENABLED
// We don't provide export templates for the UWP platform currently as it
// has not been ported for Godot 4.0. This is skipped in DEV_ENABLED so that
@@ -163,7 +163,26 @@ bool EditorExportPlatformUWP::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 EditorExportPlatformUWP::has_valid_project_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error) const {
+#ifndef DEV_ENABLED
+ // We don't provide export templates for the UWP platform currently as it
+ // has not been ported for Godot 4.0. This is skipped in DEV_ENABLED so that
+ // contributors can still test the pipeline if/when we can build it again.
+ r_error = "The UWP platform is currently not supported in Godot 4.0.\n";
+ return false;
+#endif
+
+ String err;
+ bool valid = true;
+
+ // Validate the project configuration.
if (!_valid_resource_name(p_preset->get("package/short_name"))) {
valid = false;
diff --git a/platform/uwp/export/export_plugin.h b/platform/uwp/export/export_plugin.h
index 4a3c5db377..71d0479543 100644
--- a/platform/uwp/export/export_plugin.h
+++ b/platform/uwp/export/export_plugin.h
@@ -429,7 +429,8 @@ public:
virtual void get_export_options(List<ExportOption> *r_options) 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 Error export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags = 0) override;