Browse Source

added template folder

master
Martin Vladic 2 years ago
parent
commit
21c3b245de
  1. 4
      CMakeLists.txt
  2. 0
      lvgl-template-web.eez-project
  3. BIN
      template/image.png
  4. 4
      template/manifest.json
  5. 36
      template/post.js

4
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")

0
ui.eez-project → lvgl-template-web.eez-project

BIN
template/image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

4
template/manifest.json

@ -0,0 +1,4 @@
{
"eez-framework-location": "eez",
"eez-project-path": "lvgl-template-web.eez-project"
}

36
template/post.js

@ -0,0 +1,36 @@
/**
* @callback RenameFile
* @param {string} fileSrcRelativePath
* @param {string} fileDstRelativePath
* @returns {Promise<void>}
*/
/**
* @callback ReplaceInFile
* @param {string} fileRelativePath
* @param {string} searchValue
* @param {string} newValue
* @returns {Promise<void>}
*/
/**
* @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;
Loading…
Cancel
Save