I am developing a project that has dependencies with multiple libraries. This project has different branches and versions, so sometimes I need to change or create new functions in my own libraries or even include new external ones.
My question is, is there a way I can attach my libraries to a sketch? Just like is done in Python with venv? I don't want to have all my libraries at Arduino/libraries, I would like to have them in a folder with the .ino file.
I think this is somehow achieved with PlatformIO, I am not sure about it, but in the project folder I can see a /include and /lib folders where the libraries are found.
Anyway, I normally use VSCode for programming and Arduino to load code to the microcontroller.
Unfortunately, there are libraries that depend on specific versions of other libraries or they won't work properly. This is about the only way to work around that problem.
Also, when shipping source code for someone else to build, having different library versions is a common source of trouble. Much easier to zip up everything together and do it that way.
Yes. You can need to go as far as zipping up the entire tool chain. Legacy projects can be a real pain.
You might even maintain a machine that has it all RTG. No OS updates allowed, no updates to anything.
If, however, I were to zip up my project files, and cared enough to be sure to also provide the libraries they used, I would add the libraries and expect of any user that they install, and use, those libraries as libraries.
TBH, I actually considered this for a project a year ago where it worked perfectly on my desk but the client in another country couldn't get it to work.
Just a week ago after a number of units of a project I shipped needed a minor fix and I was thinking about that again. Happily I figured out a way to write a batch script to automatically program them from a precompiled binary so that particular disaster was averted.
For example, there are some projects (not exactly talking about arduino) where you can find a requirements.txt where the version of each library is found. That's exactly the problem I am facing, the fact that I have different project versions that use different libraries versions.