handle buildweb condition when its part of a pio chain

This commit is contained in:
proddy
2025-10-24 15:33:50 +02:00
parent 16930fe8ca
commit 2f5b879652
2 changed files with 26 additions and 6 deletions

View File

@@ -98,9 +98,7 @@ build_flags =
build_unflags =
${common.unbuild_flags}
extra_scripts =
; pre:scripts/build_interface.py ; builds the WebUI
scripts/rename_fw.py ; renames the firmware .bin file
; scripts/upload.py ; optionally upload the firmware via OTA (if upload_protocol = custom)
monitor_speed = 115200
monitor_filters = direct
build_type = release
@@ -274,8 +272,24 @@ lib_deps = Unity
test_testing_command =
${platformio.build_dir}/${this.__env__}/program
; Modbus
; Creating the modbus registers is a multi-step process. Before it was in a shell script called generate_csv_and_headers.sh
; but now moved to pio so everything is in python and cross-platform. The logic is as follows:
; 1. create a dummy modbus_entity_parameters.hpp file so the first pass compiles
; 2. compile the EMS-ESPcode with the EMSESP_MODBUS flag set
; 3. run the entity_dump test command and generate the dump_entities.csv file
; 4. use the dump_entities.csv file with update_modbus_registers.py script to generate the modbus_entity_parameters.hpp file
; 5. clean up everything and start again with the EMSESP_STANDALONE flag set
; 6. run the entity_dump test command again to create the real dump_entities.csv file
; 7. create the Modbus-Entity-Registers.md file
; 8. create the dump_telegrams.csv file
;
; To run this in pio use the steps
; pio run -e build_modbus
; pio run -e build_standalone -t clean -t build
# builds the modbus_entity_parameters.hpp header file
# pio run -e build_modbus -t build
# pio run -e build_modbus
[env:build_modbus]
extends = env:native
targets = build
@@ -287,8 +301,7 @@ custom_test_command = entity_dump
custom_output_file = dump_entities.csv
custom_post_script = scripts/build_modbus_entity_parameters_post.py
; builds the real dump_entities.csv and dump_telegrams.csv files
; and the Modbus-Entity-Registers.md file
; builds the real dump_entities.csv and dump_telegrams.csv files, and also the Modbus-Entity-Registers.md file
; to be run after build_modbus with: pio run -e build_standalone -t clean -t build
[env:build_standalone]
extends = env:native

View File

@@ -110,7 +110,7 @@ def build_webUI(*args, **kwargs):
env.Exit(1)
env.Exit(0)
# Create custom target that only runs the script
# Create custom target that only runs the script and then exits, without continuing with the pio workflow
env.AddCustomTarget(
name="build",
dependencies=None,
@@ -118,3 +118,10 @@ env.AddCustomTarget(
title="build web interface",
description="installs pnpm packages, updates libraries and builds web UI"
)
# this is if its called with the target=build, so it will continue with the pio workflow
if not (env.IsCleanTarget()):
success = buildWeb()
if not success:
print("Web interface build failed!")