Allow locally installed libraries in sketch profiles. by cmaglie · Pull Request #2930 · arduino/arduino-cli (original) (raw)
Please check if the PR fulfills these requirements
- The PR has no duplicates (please search among the Pull Requests
before creating one) - The PR follows
our contributing guidelines - Tests for the changes have been added (for bug fixes / features)
- Docs have been added / updated (for bug fixes / features)
UPGRADING.mdhas been updated with a migration guide (for breaking changes)configuration.schema.jsonupdated if new parameters are added.
What kind of change does this PR introduce?
This change allows us to specify libraries in the sketch profile using a path to a local directory by prefixing the path with the string dir: .
It also provides this information in compile --dump-profile
What is the current behavior?
Only libraries in the Arduino Libraries Index could be specified in a sketch profile. A typical example may be the following:
profiles:
uno:
fqbn: arduino:avr:uno
platforms:
- platform: arduino:avr (1.8.6)
libraries:
- Adafruit SSD1306 (2.5.13)
- Adafruit GFX Library (1.11.11)
- Adafruit BusIO (1.17.0)
What is the new behavior?
A library installed in the filesystem could be specified as well:
profiles:
uno:
fqbn: arduino:avr:uno
platforms:
- platform: arduino:avr (1.8.6)
libraries:
- dir: libraries/MyLib
- dir: /path/to/library/MyLibOutsideTheSketch
- Adafruit SSD1306 (2.5.13)
- Adafruit GFX Library (1.11.11)
- Adafruit BusIO (1.17.0)
In this case the two libraries:
libraries/MyLib/path/to/library/MyLibOutsideTheSketch
will be included during the compilation. In particular, a relative path refers to a path relative to the sketch path, in this caselibraries/MyLibis to be intended asSKETCHPATH/libaries/MyLib.
Does this PR introduce a breaking change, and is titled accordingly?
No