How to install libraries from a Github repo's subfolders

Hi guys!
I have set up a GitHub repository with various libraries in subfolders from where I am trying to install them in different projects. I have seen this example but cannot emulate it. I only get that the **pio lib install** ... command to work when each library is in a separate repository. What would be the correct command to install them in the global storage if the libraries are located in subfolders but share the repository? Thank you!
P.S. I already implemented a solution with a pre-script similar to this one that works, but that is not what Iā€™m looking for.

I think the magic is in the library.json fileā€¦ if you look at this one for instance, the git url at line 9 is for the repostiry, but itā€™s the include line directive that maks it so only that particular libraries directory isā€¦ wellā€¦ included? :smiley:

Even then, Iā€™m not entirely sure how youā€™d then install itā€¦ :open_mouth:

Iā€™ll fork that repo into my account so that the only difference is the username to check if it works. Itā€™s interesting that this case is mentioned at the bottom of the ā€œCreating Libraryā€ guide as ā€œMultiple libraries in the one repositoryā€.

Within that same guide, there is this phrase:
ā€œYou can hold a lot of libraries (split into separated folders) inside one of the repository/archive. In this case, you need to specify include option of export field to relative path to your libraryā€™s source codeā€.

I think that It has to work somehow unless It was fixed by hand in the PlatformIO Library Registry.

1 Like

So far, no way! I donā€™t understand how that example works :confused:
Any help is very much appreciated ā€¦

Hmā€¦ it seems like the magic sauce is the PlatformIO library crawlerā€¦ when you read what the include parameter does, this all seems to be geared towards telling the crawler about the library format, and it will work it out, and then youā€™d access the library via the platformio library registry, rather than directly from the github.

Itā€™s looking like the extra_script I did before may be the only way to do it stand-aloneā€¦ unless you ā€˜misuseā€™ branches to have a branch for each library! :laughing:

Thank you for helping me reasoning this out! You read my mind, yesterday I was thinking of creating a git branch for each library, but I discarded it soon, Itā€™d be a maintenance nightmare.

Iā€™m afraid Iā€™ll give up and think about a naming convention for a (future) long list of libraries on my account, each on its repository. I wanted to have just one ā€œlibrary repoā€ with a folder naming convention, instead but ā€¦ thatā€™s the way life is ĀÆ_(惄)_/ĀÆ