arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
21.73k stars 4.72k forks source link

Build system: allow easy solidification of external Berry #21430

Closed Staars closed 1 month ago

Staars commented 1 month ago

Description:

Addition to the build scripts, that makes it fairly easy to solidify external Berry code into the firmware image. 
Provided Berry files must contain only 1 module or 1 class. Otherwise this will lead to undefined behaviour.

Typical use case should be to host specialised code for certain device in a GH repo, but any open or private http server will be fine.

Usage: Add entry custom_berry_solidify to a build environment with one or many Berry files - one per line. Example:

custom_berry_solidify   = https://raw.githubusercontent.com/Staars/berry-examples/main/led/ulanzi_matrix_screen.be
                          https://raw.githubusercontent.com/Staars/berry-examples/main/led/u_anim.be
                          https://raw.githubusercontent.com/Staars/berry-examples/main/blescan.be
                          https://raw.githubusercontent.com/Staars/berry-examples/main/gpio/ulanzi_rtttl.be

Then just build as usual.

These files must be written in compatible way to be solidified, which is non trivial and out of the scope of this explanation.


Besides other things the name of the module or class must be declared with a special meta comment, which is already used in Tasmotas embedded Berry code: 
#@ solidify:class_name or #@ solidify:module_name

It is recommended to run a clean after compilation, as the source code in the lib folder will temporarily be modified - but not much. This is meant mainly in the context of development to avoid unwanted GIT actions.

Currently Windows does not support solidification. @arendst @s-hadinger We can leave this PR open until we are sure how to handle the Windows problem. I can turn it off for Windows to avoid user confusion.

Checklist:

NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass

s-hadinger commented 1 month ago

Thanks. Let's try as is