Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add possibility to embed custom libraries into the sketch #2514

wants to merge 3 commits into
base: master
Choose a base branch


Copy link

@cmaglie cmaglie commented Jan 25, 2024

Please check if the PR fulfills these requirements

See how to contribute

  • 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)
  • has been updated with a migration guide (for breaking changes)
  • configuration.schema.json updated if new parameters are added.

What kind of change does this PR introduce?

Adds the possibility to include libraries in the sketch libraries folder

What is the current behavior?

~/Arduino/Blink$ tree
├── Blink.ino
└── libraries
    └── ExampleLibrary
        └── MyLib.h

3 directories, 2 files
~/Arduino/Blink$ cat Blink.ino 
#include <MyLib.h>

void setup() {

void loop() {
~/Arduino/Blink$ cat libraries/ExampleLibrary/MyLib.h 

void libFunction() {

~/Arduino/Blink$ arduino-cli compile -b arduino:avr:uno 
/home/cmaglie/Arduino/Blink/Blink.ino:1:10: fatal error: MyLib.h: No such file or directory
 #include <MyLib.h>
compilation terminated.

Used platform Version Path
arduino:avr   1.8.6   /home/cmaglie/.arduino15/packages/arduino/hardware/avr/1.8.6
Error during build: exit status 1

What is the new behavior?

~/Arduino/Blink$ arduino-cli compile -b arduino:avr:uno 
Sketch uses 444 bytes (1%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.

Used library   Version Path
ExampleLibrary         /home/cmaglie/Arduino/Blink/libraries/ExampleLibrary

Used platform Version Path
arduino:avr   1.8.6   /home/cmaglie/.arduino15/packages/arduino/hardware/avr/1.8.6

Does this PR introduce a breaking change, and is titled accordingly?

Other information

Resolves #1255

@cmaglie cmaglie self-assigned this Jan 25, 2024
@cmaglie cmaglie added type: enhancement Proposed improvement topic: code Related to content of the project itself topic: CLI Related to the command line interface labels Jan 25, 2024
Copy link

codecov bot commented Jan 25, 2024

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (0dfb27e) 68.92% compared to head (1020934) 68.91%.

Files Patch % Lines
internal/arduino/sketch/sketch.go 71.42% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2514      +/-   ##
- Coverage   68.92%   68.91%   -0.01%     
  Files         204      204              
  Lines       20452    20478      +26     
+ Hits        14096    14113      +17     
- Misses       5207     5213       +6     
- Partials     1149     1152       +3     
Flag Coverage Δ
unit 68.91% <79.31%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Xayton Xayton changed the title Add possibility to embed libraries into the sketch Add possibility to embed custom libraries into the sketch Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
topic: CLI Related to the command line interface topic: code Related to content of the project itself type: enhancement Proposed improvement
None yet

Successfully merging this pull request may close these issues.

Support bundling libraries with a sketch
1 participant