I’m having trouble organizing projects with my local libraries. I keep my libraries in one directory and then like to refer to them from my various projects. It seems that’s not currently possible unless I’m missing a trick (quite likely).
I do not want a copy of each library in each project because that creates a maintenance nightmare. I also do not want to publish my private libraries to the particle library system, it’s not appropriate.
What I’d like to have is all libraries in one
libraries directory and then symlinks from each project to the libraries it uses. Here is an example of how this would look like:
root/ +- libraries/ | +- Library1/ | | +- lib1.cpp | | \- lib1.h | +- Library2/ | | \- src/ | | +- lib2.cpp | | \- lib2.h | \- ... +- project1/ | +- project.properties | +- src/ | | +- proj1.ino | +- lib/ | | +- Library1 -> ../../libraries/Library1 | | +- Library2 -> ../../libraries/Library2 +- project2/ | +- project.properties | +- src/ | | +- proj2.ino | +- lib/ | | +- Library1 -> ../../libraries/Library1
I dug around in the code and the reason this is not possible (specifically if the library has a
src directory as shown for library2) is that the node.js
glob used by
utilities.js does not recurse into symlinked directories (
globList is called by
_processDirIncludes). It’s actually very confusing because it does pick up source files in the top-level of the library directory but not ones further down, so library1 in my example works but library2 doesn’t.
Is there some trick to get around this issue, e.g. something I can stick into the project.properties file to point to the libraries?