I'm working on adding my Arduino to continuous integration and I came across two different possible ways of doing this, Arduino command line, and arduino-builder. Can someone explain why the arduino-builder tool exists separately from calling Arduino from the command line? And what are the advantages of using one over the other?
2 Answers
The Arduino IDE command line predates arduino-builder and was made available when the source pre-processing and compiling was implemented by a Java class (deeply) embedded in the IDE.
The current IDE uses arduino-builder behind the scenes to process and compile the code so if you use arduino-builder you avoid having to load the whole Java IDE. Try it out it does some pretty cool stuff
I've written a new option for Arduino CI/unit testing and put together a decent size writeup about it as an answer to this related question.
I ended up using the Arduino command line instead of arduino-builder, because it worked better cross-platform for me. It assumes a graphical display though, even if you just use the CLI features. In the case of Travis CI, I needed to spin up a fake X display to handle the initial splash screen and other graphical error messages. (Fortunately, you can tell based on how long a command takes to complete whether it's waiting for you to acknowledge a graphical error message.)
Some examples of how to enable CI on your own project:
- The DoSomething example library shown above, used to test arduino_ci itself
- A practical example, testing a Queue implementation
- A complex example, simulating a library that controls an interactive device over a SoftwareSerial connection as part of the Adafruit FONA library