Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save JulianGro/7fa77d8ab9150846befd44213315b622 to your computer and use it in GitHub Desktop.
Save JulianGro/7fa77d8ab9150846befd44213315b622 to your computer and use it in GitHub Desktop.
From 2cb930508d5d2e0122fe79a3ccc7227e0eb93530 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Julian=20Gro=C3=9F?= <julian.g@posteo.de>
Date: Wed, 12 Jun 2024 20:39:38 +0200
Subject: [PATCH] Move script-editor assets out of the main source repository.
---
.../script-editor-resources/CMakeLists.txt | 17 +++++++++++++++++
interface/CMakeLists.txt | 9 +++++++++
.../system/create/scriptEditor/scriptEditor.js | 4 ++--
3 files changed, 28 insertions(+), 2 deletions(-)
create mode 100644 cmake/externals/script-editor-resources/CMakeLists.txt
diff --git a/cmake/externals/script-editor-resources/CMakeLists.txt b/cmake/externals/script-editor-resources/CMakeLists.txt
new file mode 100644
index 0000000000..7eecfacd54
--- /dev/null
+++ b/cmake/externals/script-editor-resources/CMakeLists.txt
@@ -0,0 +1,17 @@
+include(ExternalProject)
+
+set(EXTERNAL_NAME script-editor-resources)
+
+ExternalProject_Add(
+ ${EXTERNAL_NAME}
+ URL https://build-deps.overte.org/dependencies/script-editor/script-editor_resources_2024-06-12.zip
+ URL_MD5 4e7458c8fdc23864ecf808c946358c26
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+ INSTALL_COMMAND ""
+ LOG_DOWNLOAD 1
+ DOWNLOAD_EXTRACT_TIMESTAMP 1
+)
+
+# Hide this external target (for IDE users)
+set_target_properties(${EXTERNAL_NAME} PROPERTIES FOLDER "hidden/externals")
diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt
index d68f14ca52..9f900f9b2d 100644
--- a/interface/CMakeLists.txt
+++ b/interface/CMakeLists.txt
@@ -484,6 +484,15 @@ if (WIN32)
package_libraries_for_deployment()
endif()
+add_dependency_external_projects(script-editor-resources)
+ExternalProject_Get_Property(script-editor-resources SOURCE_DIR)
+# for dev builds, copy the content to the resources folder
+add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
+ COMMAND "${CMAKE_COMMAND}" -E copy_directory
+ "${SOURCE_DIR}"
+ "${RESOURCES_DEV_DIR}/html/script-editor"
+)
+
add_dependency_external_projects(GifCreator)
find_package(GifCreator REQUIRED)
target_include_directories(${TARGET_NAME} PUBLIC ${GIFCREATOR_INCLUDE_DIRS})
diff --git a/scripts/system/create/scriptEditor/scriptEditor.js b/scripts/system/create/scriptEditor/scriptEditor.js
index 313b6f0874..731c3c50c3 100644
--- a/scripts/system/create/scriptEditor/scriptEditor.js
+++ b/scripts/system/create/scriptEditor/scriptEditor.js
@@ -8,8 +8,8 @@
var global = {};
global.CHANNEL_NAME = 'OVERTE_EDITOR_CHANNEL_{id}';
- global.EDITOR_SOURCE_URL = 'qrc:///html/overte-editor-app/index.html';
- global.EDITOR_SCRIPT_FILE = 'scriptEditor-v0.1.js';
+ global.EDITOR_SOURCE_URL = 'file:///~/html/script-editor/index.html';
+ global.EDITOR_SCRIPT_FILE = 'scriptEditor.js';
global.EDITOR_SCRIPT_BODY = params && params.scriptBody ? params.scriptBody : ' ';
global.EDITOR_WIDTH = 1.92;
global.EDITOR_HEIGHT = 1.08;
--
2.43.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment