PlatformIO Community

Batchcopy in-use libraries to private in VScode


#1

Hy, i am looking for a way to copy all used libraries to ./lib/ so i can copy the whole project to another machine without missing any dependencies.

Is there a way to automate this?


#2

Have you modified any underlying libraries? Then why not just copy the project without them, if they are in lib_deps they will get re-downloaded automatically, alongside with any missing compiler you might need. Is your use case a completely off-line machine?

If they’re not installed in the global library storage (via pio lib install ..) they should all be in the project folder in the hidden folder .pioenvs/. Moving them to lib/ should mostly do what you want. That also has the disadvantage that you’re now stuck with using that library version locally in the project, without receiving automatic updates via the internet.


#3

yes the machine is offline so redownloading them on location unfortunately isn’t an option. The librarbys i need are installed with pio library manager on the original system i only need to copy those, any other library i use i have added as private library from the start.

I just took a look at .pioenvs\nanoatmega328
the used librarys are there but only as compiled filename.cpp.o files so i am not sure if that would work. Even if it did i really would prefer source files.

No automatic library updates would actually be an improvement for this project :slight_smile:


#4

Sorry that was the wrong folder name. .piolibdeps are where the libraries are at. pioenvs are the compiled object files and the final firmware binary.


#5

hmm… my project has no .piolibdeps folder for some reason.


#6

Then you’ve either installed them globally via pio lib install or something’s wrong. You have the lib_deps = .. lines in your platformio.ini?


#7

That might have done the trick. I didn’t have the lib_deps line so i added that and platformio created .piolibdeps folder and copied all libraries to it.

Thank you <3