From 86c2c4f8f86d1336ddd5b2474498805b2cba96e1 Mon Sep 17 00:00:00 2001 From: LightJockey Date: Mon, 22 Jan 2024 19:24:18 +0100 Subject: [PATCH] Fix platformio build, add pre-build hook to build the web app --- platformio.ini | 17 +++++++++++++---- src/build_web_app.py | 6 ++++++ 2 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 src/build_web_app.py diff --git a/platformio.ini b/platformio.ini index 1205714..ae6387d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -8,7 +8,16 @@ ; Please visit documentation for the other options and examples ; https://docs.platformio.org/page/projectconf.html -[env:EspDmxNode] +[platformio] +default_envs = esp8266-nodemcuv2 + +[common] +lib_deps = + me-no-dev/ESP Async WebServer@^1.2.3 + bblanchon/ArduinoJson@^6.18.5 + marvinroger/AsyncMqttClient@^0.9.0 + +[env:esp8266-nodemcuv2] platform = espressif8266@2.3.1 framework = arduino board = nodemcuv2 @@ -17,7 +26,7 @@ build_flags = -D PIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48_SECHEAP_SHARED monitor_speed = 115200 upload_speed = 115200 lib_deps = + ${common.lib_deps} me-no-dev/ESPAsyncTCP@^1.2.2 - me-no-dev/ESP Async WebServer@^1.2.3 - bblanchon/ArduinoJson@^6.18.5 - marvinroger/AsyncMqttClient@^0.9.0 + Makuna/NeoPixelBus@2.6.4 ; ^2.6.5 breaks compatibility +extra_scripts = pre:src/build_web_app.py diff --git a/src/build_web_app.py b/src/build_web_app.py new file mode 100644 index 0000000..4a47c7d --- /dev/null +++ b/src/build_web_app.py @@ -0,0 +1,6 @@ +Import("env") + +def build_web_app(source, target, env): + env.Execute("cd src/web_app && npm run build") + +env.AddPreAction("${BUILD_DIR}/src/EspDmxNode.cpp.o", build_web_app) \ No newline at end of file