Go Down

Topic: Build configurations (Read 576 times) previous topic - next topic

flounder

Mar 31, 2017, 09:05 am Last Edit: Mar 31, 2017, 09:10 am by flounder
I would like to create composite configurations for my projects.  The idea that I have to keep re-selecting the board, programmer, etc. is annoying; I have many Atmel-based boards, and many projects.  Some use BlueTooth to download.  Some use an ISP programmer.  Most are built for only one board, in one development configuration; some are built for multiple boards, for example, both AVR and Cortex models, or Arduino R3 for debugging and Gemma for deployment.

I would like to "package" all the parameters into named configurations, e.g., MyProject-Test, MyProject-Deployment, MyProject-Deployment-Cortex, which set ALL the relevant parameters.  Each project would have a projectname.cnf to accompany the projectname.ino file.  If this file, which should be in XML format, exists, it embodies all the possible ways I might configure my build, based on my construction of various configurations.

In addition, I would like to be able to place arbitrary -D options on the command line, e.g., -DDEBUG or -DDEBUGSOMETHING so I can write

#ifdef DEBUG
or
#ifdef DEBUGSOMETHING

to selectively enable or disable various debugging options, instead of having to hand-edit the source to comment or uncomment #define statements.

If anyone is interested in working with me on this, I can deal with the design, reading, etc. of the XML, editing configurations, etc., but integrating this into the existing IDE is more than I can do.  Please contact me if interested.

Also, it would be nice if "download" did a "build", that is, recompiled only if the source files have changed since the last build.  It is silly to do a "Verify", have it pass, and then have the whole thing recompile again when I "Download".  This is particularly annoying for those boards which require a Reset, because some builds take longer than 10 seconds for a full build, and I should not be burdened with trying to guess when to hit the reset button.  If a rebuild was not required, then the download would start immediately, that is, absolutely within ten seconds.
    Joe

pert

The idea that I have to keep re-selecting the board, programmer, etc. is annoying;
The Arduino Web Editor already allows you to associate a board with a sketch, but not programmer because it doesn't currently support programmers or the associated actions. There have been quite a few requests for this feature in the standard IDE over the years. It hasn't been specifically denied by the developers and some of those feature requests are still open in the issue tracker but it certainly hasn't been made a priority. I don't really have strong opinions on the subject but I do think that, within reason, any feature available in the Web Editor should also be added to the standard IDE. I believe the web editor stores this information as a JSON file which is included when you download a sketch created on that IDE. I think this would be worthwhile submitting a pull request for inclusion in the Arduino IDE but it might be a good idea to discuss this on the Arduino Developers Mailing List or the relevant issue report first to make sure they are receptive to considering the contribution and that you are on the same page with the developers as to implementation.

I would like to be able to place arbitrary -D options on the command line, e.g., -DDEBUG or -DDEBUGSOMETHING
It has been requested quite a few times over the years to allow users to set global macros or build options from the sketch in some way. The Arduino developers have specifically stated they have a policy against this feature as they feel it will cause library authors to create a less user friendly API. I somewhat understand this point of view but there are some things that you just need the preprocessor for and forcing users to constantly edit library source code is certainly not user friendly. You can set build options from the command line --pref build.extra_flags=-DDEBUG.

Also, it would be nice if "download" did a "build", that is, recompiled only if the source files have changed since the last build.  It is silly to do a "Verify", have it pass, and then have the whole thing recompile again when I "Download".
The correct term is "Upload", not "Download". I know this has been requested before. I don't remember if there was a good reason for not doing it or that they thought it would be nice but hadn't gotten around to it. Compilation used to be pretty fast, especially since the only boards were AVR. With the addition of boards with more memory (ESP8266 is very slow compilation for me) and the change to arduino-builder in 1.6.6 compilation time is a more significant consideration. The Arduino developers have been doing a lot of work on caching certain files to speed up repeat compilations but haven't gone so far as to skip it altogether if nothing changed.

Go Up