Library development location

Hi

I’ve been developing a library but am a little unsure about parts of it.

I have it stored in .platformio/lib/ folder. I have the local git repo here and a remote repo on github. I’ve registered the library with Platformio (Lorro_BQ4050). However, when I include this library and try to compile, Platformio can’t find it. If I install the library through the library manager, my program will compile, but in the process of installing the library, it overwrites the original folder that has the git files and replaces them with a clone of the github repo.

What is the recommended location to develop libraries from, if they are registered? And if you register a library yourself is it recommended to install that library through platformio library manager or not?

Thanks

How about to have PlatformIO project which will test your library and use Redirecting... ?

So, you can also add this LIB folder to VSCode workspace too (File > Add Folder to Workspace)

Hi

Thanks for the reply.

If I use lib_extra_dirs, do I still need to install the library as a global library first? If I don’t do this, the library is not found.

When I install the library, it is not updated when I am developing from the original location and save the file. I have to uninstall the library, then install it again.

Thanks

No, you do not need to install it. PlatformIO will automatically scan changes to this library. Just set correct path, it should be a path to directory where this DEV folder of library is located. I mean, not a path to dev-library.

OK thanks.

I added
lib_extra_dirs = C:\Users\myName\.platformio\lib\Dev
and after a restart of Platformio it worked. I’m using Atom btw.

Thanks for the help

1 Like