Custom external tool

I just started to use platformio. What a great tool :slight_smile:

However I have an issue I haven’t figued out how to solve:

In my project, I have a state machine written in scxml. This state machine is translated into a .h file with the scxmlcc tool (GitHub - jp-embedded/scxmlcc: The SCXML state machine to C++ compiler)

So, what I would like to do in the build process is:

  1. fetch scxmlcc from github - similar to the use of lib_deps
  2. comple scxmlcc natively
  3. use the compiled scxmlcc to translate my .scxml file into a .h file
  4. continue with the “normal” platformio build process.

How do I best implement this when using platformio?

Alternatively, would it be possible to somehow integrate scxmlcc into the platformio toolchain?

It seems that you can use Pre extra script Redirecting...

So, you can pregenerate H files into SRC folder before build process will start