summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuslan Mustakov <r.mustakov@gmail.com>2017-12-30 16:39:09 +0700
committerRuslan Mustakov <r.mustakov@gmail.com>2017-12-30 16:39:09 +0700
commitab12a5cf8e9fb6b12cfeb4a0a0e13671fca9ede0 (patch)
treea0b4356cfb3147dd56fe11b88d958d5c588830d0
parentc595aff4a30f79cc75a30decfad7243c03824bab (diff)
Perform export after import is fully complete
Previously command line export would go simultaneously with reimport, which caused final package to either miss something or contain outdated assets or perhaps even broken ones.
-rw-r--r--editor/editor_node.cpp72
1 files changed, 36 insertions, 36 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 24a737e4af..6174e528c1 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -391,42 +391,6 @@ void EditorNode::_fs_changed() {
E->get()->invalidate();
}
- if (export_defer.preset != "") {
- Ref<EditorExportPreset> preset;
- for (int i = 0; i < EditorExport::get_singleton()->get_export_preset_count(); ++i) {
- preset = EditorExport::get_singleton()->get_export_preset(i);
- if (preset->get_name() == export_defer.preset) {
- break;
- }
- preset.unref();
- }
- if (preset.is_null()) {
- String err = "Unknown export preset: " + export_defer.preset;
- ERR_PRINT(err.utf8().get_data());
- } else {
- Ref<EditorExportPlatform> platform = preset->get_platform();
- if (platform.is_null()) {
- String err = "Preset \"" + export_defer.preset + "\" doesn't have a platform.";
- ERR_PRINT(err.utf8().get_data());
- } else {
- // ensures export_project does not loop infinitely, because notifications may
- // come during the export
- export_defer.preset = "";
- if (!preset->is_runnable() && (export_defer.path.ends_with(".pck") || export_defer.path.ends_with(".zip"))) {
- if (export_defer.path.ends_with(".zip")) {
- platform->save_zip(preset, export_defer.path);
- } else if (export_defer.path.ends_with(".pck")) {
- platform->save_pack(preset, export_defer.path);
- }
- } else {
- platform->export_project(preset, export_defer.debug, export_defer.path, /*p_flags*/ 0);
- }
- }
- }
-
- get_tree()->quit();
- }
-
{
//reload changed resources
List<Ref<Resource> > changed;
@@ -463,6 +427,42 @@ void EditorNode::_fs_changed() {
}
_mark_unsaved_scenes();
+
+ if (export_defer.preset != "" && !EditorFileSystem::get_singleton()->is_scanning()) {
+ Ref<EditorExportPreset> preset;
+ for (int i = 0; i < EditorExport::get_singleton()->get_export_preset_count(); ++i) {
+ preset = EditorExport::get_singleton()->get_export_preset(i);
+ if (preset->get_name() == export_defer.preset) {
+ break;
+ }
+ preset.unref();
+ }
+ if (preset.is_null()) {
+ String err = "Unknown export preset: " + export_defer.preset;
+ ERR_PRINT(err.utf8().get_data());
+ } else {
+ Ref<EditorExportPlatform> platform = preset->get_platform();
+ if (platform.is_null()) {
+ String err = "Preset \"" + export_defer.preset + "\" doesn't have a platform.";
+ ERR_PRINT(err.utf8().get_data());
+ } else {
+ // ensures export_project does not loop infinitely, because notifications may
+ // come during the export
+ export_defer.preset = "";
+ if (!preset->is_runnable() && (export_defer.path.ends_with(".pck") || export_defer.path.ends_with(".zip"))) {
+ if (export_defer.path.ends_with(".zip")) {
+ platform->save_zip(preset, export_defer.path);
+ } else if (export_defer.path.ends_with(".pck")) {
+ platform->save_pack(preset, export_defer.path);
+ }
+ } else {
+ platform->export_project(preset, export_defer.debug, export_defer.path, /*p_flags*/ 0);
+ }
+ }
+ }
+
+ get_tree()->quit();
+ }
}
void EditorNode::_resources_reimported(const Vector<String> &p_resources) {