Custom Build Script

I have a custom library which requires executing a python script to create/update its necessary .h files.

How can I add a hook to my library to register files of this extension so that they are compiled correctly?

I am not aware of any hook that let you insert steps within the compilation process. There is no makefile to modify either, it’s kinda decided on the fly by the IDE after massaging a bit the project files

you can use Visual Micro with Visual Studio, VS has many tools to handle/automate your project

I think we would be best able to assist you if you provided details about exactly what these updates consist of and why you are doing them.

FYI, even though libraries do not (and I haven't seen any evidence of a need for such a thing) the Arduino boards platform system does provide hooks:

https://arduino.github.io/arduino-cli/latest/platform-specification/#pre-and-post-build-hooks-since-arduino-ide-165

I'm using emboss for packet definitions. Basically you have a .emb file that emboscc (a python script) uses to create the appropriate c++ source files.

I could run it manually, but it'd be nice to have it part of the library specification.

How often do you need to modify these packet definitions? Are they something that will be different for each user, or universal?

My expectation is that library code will change only after I update to a new version. I don't really want it changing on the fly. So I would more expect the process to be:

  1. Library maintainer updates the generated code.
  2. Library maintainer releases a new version
  3. User updates to the new version (e.g., via Library Manager)

For that procedure, the code generation would be better done via a dedicated script (could even be automated as part of the release or continuous integration system).

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.