arduino-deps-installer

module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2021 License: MIT

README

Logo

Arduino dependencies installer

Release version Build Status Image size License

The reason of creating this project is very simple - I want to have an option for defining dependencies for the arduino sketches and install them using one simple command. "Do we have no official and recommended way for this?" - not at this moment. I assume that after some time there will be such a possibility officially, but until it is not, you can use this project.

The source code of this project extends original code from arduino-cli tool.

Use case

Let's suppose you have a sketch for which you need to install a third-party library to compile. When somebody wants to use your sketch - you should to describe all dependencies in a readme file or leaving comments with notices.

Ecosystems of other programming languages have long used dependency managers, such as python (pip install -r requirements.txt), but not Arduino. And while there is no official support for this - we can do it ourselves :)

Dependencies file formats

Now you can define your sketch dependencies in a plain text file (supported file names requirements.txt, dependencies.txt, libraries.txt, libs.txt, deps.txt):

# https://github.com/arduino-libraries/servo
Servo@1.1.7

# https://github.com/johnrickman/LiquidCrystal_I2C
LiquidCrystal I2C

// https://github.com/arduino-libraries/WiFiNINA
https://github.com/arduino-libraries/WiFiNINA.git

; Or any local *.zip file:
./libs/lib1.zip

Another option - is a sketch manifest (aka metadata; supported file names sketch.json, metadata.json, .sketch.json, .metadata.json):

{
  "depends": {
    "Servo": "1.1.7",
    "LiquidCrystal I2C": "",
    "WiFiNINA": "https://github.com/arduino-libraries/WiFiNINA.git",
    "someLocalLib": "./libs/lib1.zip"
  }
}

And last - properties file (this file makes sense not only for libraries now; supported file names sketch.properties, library.properties, .sketch.properties, .properties):

depends=https://github.com/arduino-libraries/WiFiNINA.git, Servo@1.1.7, LiquidCrystal I2C, ./libs/lib1.zip

How to install sketch dependencies

After you have created the dependencies file (in any supported format), run the following command:

$ arduino-deps-installer install --work-dir /path/to/sketch-dir

All described dependencies will be installed without any interaction with a user. In you need to update the libraries index first - use the flag --update-index.

Installing

Download latest binary file for your os/arch from releases page or use our docker image.

Changes log

Release date Commits since latest release

Changes log can be found here.

Support

Issues Issues

If you will find any package errors, please, make an issue in current repository.

License

This is open-sourced software licensed under the MIT License.

Directories

Path Synopsis
cmd
internal
cli

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL