Libraries depending on other libraries

Thanks to @mdma you’ll now be able to have libraries that depend on other libraries! No more copy-pasting of libraries into other libraries! :fireworks:

In order to do this, open a terminal in your library directory and make sure your library is migrated
particle library migrate

You should see Library migrated to v2 format or Library already in v2 format

If you get an error, check that you have the CLI version 2.0 (get the prerelease version here).
particle --version

Search for the library you want to include as a dependency and note the version number:
particle library search sd

Add a line at the end of library.properties with the name and version of the dependency:
dependencies.SdFat=0.0.4

Update the version number in library.properties and publish a new version of your library:
particle library publish

Change to the directory of your project and add the library to your project. If you already had it in your project, you can add it again to make sure the project is using the latest version:
particle library add my_lib

4 Likes