diff --git a/CMakeLists.txt b/CMakeLists.txt index fdb3dd9..6b03193 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.12) -project (lv_emscripten) +project (lvgl-template-web) set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -O2 -s USE_SDL=2") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s INITIAL_MEMORY=83886080 -sLLD_REPORT_UNDEFINED") @@ -111,8 +111,6 @@ set_source_files_properties(main.c PROPERTIES COMPILE_FLAGS -DCHOSEN_DEMO=${LVGL set(CMAKE_EXECUTABLE_SUFFIX ".html") target_link_libraries(index lvgl - lvgl_examples - lvgl_demos lv_drivers ) set_target_properties(index PROPERTIES LINK_FLAGS "--shell-file ${PROJECT_SOURCE_DIR}/lvgl_shell.html -s SINGLE_FILE=1") diff --git a/ui.eez-project b/lvgl-template-web.eez-project similarity index 100% rename from ui.eez-project rename to lvgl-template-web.eez-project diff --git a/template/image.png b/template/image.png new file mode 100644 index 0000000..26e5a48 Binary files /dev/null and b/template/image.png differ diff --git a/template/manifest.json b/template/manifest.json new file mode 100644 index 0000000..62c4476 --- /dev/null +++ b/template/manifest.json @@ -0,0 +1,4 @@ +{ + "eez-framework-location": "eez", + "eez-project-path": "lvgl-template-web.eez-project" +} \ No newline at end of file diff --git a/template/post.js b/template/post.js new file mode 100644 index 0000000..659bde5 --- /dev/null +++ b/template/post.js @@ -0,0 +1,36 @@ +/** + * @callback RenameFile + * @param {string} fileSrcRelativePath + * @param {string} fileDstRelativePath + * @returns {Promise} + */ + +/** + * @callback ReplaceInFile + * @param {string} fileRelativePath + * @param {string} searchValue + * @param {string} newValue + * @returns {Promise} + */ + +/** + * @typedef {Object} WizardContext + * @property {string} projectDirPath + * @property {string} projectName + * @property {RenameFile} renameFile + * @property {ReplaceInFile} replaceInFile + */ + +/** + * @param {WizardContext} context + */ +async function postProcessing(context) { + await context.replaceInFile("CMakeLists.txt", "lvgl-template-web", context.projectName); + + await context.replaceInFile("README.md", "{{projectDirPath}}", context.projectDirPath); + await context.replaceInFile("README.md", "{{projectName}}", context.projectName); + + await context.renameFile("lvgl-template-web.eez-project", context.projectName + ".eez-project"); +} + +module.exports = postProcessing; \ No newline at end of file