A tool to copy all compiled libraries into a ZIP-Folder

Hello everybody,

The Arduino-IDE has a archive sketch function.
Well this archive-function does only ZIP the files inside the sketch-folder but not included libraries.

The compiler creates a lot of message lines through the compiling process which maybe can be used to find all included files.
The other possability is to search through the *.ino and all dependent *.h / *.cpp-files to find everything that is included

Does anybody know if such a tool exists?

best regards Stefan

Why?

If you archive the sketch and send the zip file to someone else, they would unzip it and open the project in their IDE. If they are missing libraries, then they should install them through the library manager. If you try to provide the libraries, you risk conflicting their existing libraries. If you have a project-specific library, or libraries modified for the project, then they should be in the project folder and would get archived with the sketch ino files.

If you are trying to archive the project for your own future use, then the same problem with possible conflicting libraries exists.

So, why?

(If you really have to, like for a regulatory requirement , then just zip the libraries folder into a second zip file.)

You can use grep to search all skecth source files (ino, cpp, h) for #include directives. Next you can search the 3rd party libraries in the sketchbook directory for the files that are were found with grep.

An alternative way of working is to use a portable install for each project that you do and zip the complete portable install; that way you will always have the used IDE, tool chain and libraries (official and 3rd party).

I think it would be a good idea - good "source code revision control" does require that you archive libraries as well as the program you wrote.

Difficult to write, though. The "archive" tool doesn't really have access to the list of files that the "build" comes up with.

And theoretically, you should archive the "core" as well. (although, Arduino has a good record of maintaining access to all the old IDE versions...)

Problem with that can be that you never know which boards package was used. I run IDE 1.8.5 (yes, I must update, going to 2.0 soon) with an, if not mistaken, updated AVR board package.

Hi,

thank you all for answering. Oha there are a lot of more implications that I thought of.
Indeed either I trust in all the libraries are available in the future and fit to each other by updating them all or I have to save the whole 2-15 GB inside the IDE-folders with everything or just keep a compiled *.bin-file

best regards Stefan

For Achiving projects, I copy any libraries used to the sketch folder, updating the #include lines. I also add a readme.txt file with notes on wiring, IDE version used, microcontroller package used & any other information needed to remake the project.

These are then stored in no less than 3 different locations, both onsite and offsite.

How do you know whether the libraries that you explicitly #include also use other libraries ?

If you use the #include "libraryName.h" form of #include in your sketches from the start then do you need to update the #include lines when archiving ?

I don't understand the statement. Why do you never know?

Unlike the classic Arduino IDE, the Arduino IDE 2.x does not come with a bundled copy of the "Arduino AVR Boards" platform. Instead, it uses the Boards Manager system to install that platform automatically the first time you run the Arduino IDE after a fresh installation.

Just as with the classic Arduino IDE, you are welcome to install any version of any boards platform via Boards Manager, so the Arduino AVR Boards version is really not so tightly coupled to the IDE version so long as you are familiar with the use of Boards Manager.


There is a plan that is somewhat related, which is the creation of a dependencies manifest file:
https://github.com/arduino/tooling-rfcs/blob/main/RFCs/0003-build-profiles.md
This means you can specify the exact dependencies of a sketch build, which can be used by the Arduino development software to reproduce the build.

This would offer an alternative to putting all the dependencies into version control or specifying dependencies in an unstructured manner in the project documentation.

I don't tend to archive personal projects, especially if they are simple ones. If i have commisioned work I ALWAYS backup the code, and combine the libraries. During development, it is easier to use the standard #include <> until the job is signed off.

Sorry, but I don't get that. If you use the #include "libraryName.h" format and the libraries are not in the sketch folder then it behaves exactly the same as the standard format

I did not know that! :astonished:

I am a fan of Cypress (now Infineon) methodology:

  • library code is automatically copied once into the project folder and all #includes reference the local copy. If library and local become out-of-sync, the programmer decides whether to update the local copy - like a galactic shield from the Adafruit constant re-architecture Flux.

  • The IDE builds a project overview (executive summary) with each software build as a nicely formatted PDF.

  • The IDE keeps a roll-back version automatically in Zip format.

With most new PCs coming with 500G to 1T or larger hard disks, it is nice that the IDE enforces automatic backup and sensible roll-back options.

Once you get your head "around" the PSoC concept, it is a joy.
https://www.infineon.com/cms/en/design-support/tools/sdk/psoc-software/

Edit:
Cypress is now Infineon, but the PSoC "Cypress" dev boards are being still sold at one distributor - Digikey

Board packages are independent of the IDE. @westfw comments referred to the IDE, not to the boards package. So if you forget to back that up, you don't have the full setup.

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