The next thrilling installment ...
I mentioned in an earlier Reply that I am also concerned to ensure that I know exactly which version of the IDE and what libraries were used to generate the program - and, at some future date, to be able to use the exact same libraries to recreate the program.
As well as libraries, my wireless application involves separate Master and Slave .ino files which use a shared .h file with some common data, such as the wireless channel and data rate.
My idea for keeping track of the libraries that are used to generate code, and the project specific .h files requires three simple elements.
First, there are the libraries that are included with the IDE when you download it. If I save a copy of the download file that contains the IDE I will always be able to reproduce that version of the IDE and all its libraries. It is a simple matter manually to put a copy of that file in the Archive Directory.
Second, there are the extra libraries (such as TMRh20's RF24 library) that I download separately. For those librarires all I need to do is save a copy of the libraries alongside the code. That is the reason for saving the archive copy of the .ino file in a directory. The Python program makes a note of any of those extra libraries that are referred to in the .ino file.
Third, with the regular Arduino IDE the only way I have found for referring to a shared .h file that is not in the same directory as the .ino file is to use the full path name
and that system works with my Python script
This Python program also has the (for me) very positive side effect that it is no longer necessary to create my file Master.ino in a directory called Master. The Python program will copy the program so that the Arduino requirements are complied with. It also works if Master.ino is inside a directory called Master.
When the upload is successful, Python will copy the .ino file, all the library files and any .h files into the Archive Directory called Master-YYYYMMDD-HHMMSS. That way, if I ever need to recreate the Arduino program I can easily find the exact libraries and .ino file that were used to create the program.
It may help if I illustrate the directory structures that I have in mind.
For writing code ...
For compiling Master.ino
ArduinoTemp.ino (which is a copy of Master.ino)
For archiving Master.ino
arduino-1.5.6-r2-linux32.tgz (the file containing the Arduino IDE with its libraries)
Someone may say that this involves a lot of duplication of files on my hard disk, and that is quite true. But hard disk space is too cheap to be bothered by that.
All comments on either or both Replies will be very welcome.