Description
Describe the request
Sharing Arduino IDE sketches between users is pretty handicapped right now, because the sketch.yaml
project file isn't yet supported in the IDE, and there is no way to share the settings that are manually configured in the "Tools" menus. This is in spite of the fact that I've already configured the sketchbook location to the root of my GitHub repository's sandbox.
The first MVP behavior wouldn't even need to support multiple build profiles or provide any additional user interface. It could be as simple as:
- If the sketch
.ino
has asketch.yaml
file next to it, and - if the
sketch.yaml
explicitly defines a default profile, then - load & save all platform properties to/from the default profile
- load & save all board properties to/from the default profile's FQBN
- load & save all library installations to/from the default profile
Describe the current behavior
Board Selection
When opening a sketch Arduino IDE does select the board, custom board options, and port according to the selections the user had the last time that sketch was open. However, this data is stored separately from the sketch, which causes two problems:
- There is no way to share that configuration along with the sketch
- If the path of the sketch is changed, the configuration data is disassociated from the sketch (the data is keyed to the sketch path)
Dependencies Management
Library and platforms can only be managed globally. There is no way to control dependencies on a per-sketch basis.
This results in the frustrating situation where a working project can be broken at any time simply by installing a library for use with another project.
The users must resort to inefficient and complex measures to control dependencies. For example, they may vendor library dependencies inside the sketch, which may require modifications to the library source code and makes updates inconvenient.
Per-sketch dependencies management is also the root motivation for the majority of the many users passionately requesting the implementation of a portable mode (#122). For most applications, use of a portable IDE installation for project dependencies management is inferior to the build profiles system, so assuming the effort for this proposal is approximately equal or lesser, the finite development resources would be more effectively investing into adding support for build profiles than to implementing portable mode.
Arduino IDE version
2.3.4-nightly-20241120
Operating system
All
Operating system version
Any
Additional context
Additional requests
- Add advanced mode from Pro IDE #150 (comment)
- library management on a per-project basis, with a "requirements" file and / or a "lib" folder #424
- Add local sketch library support Arduino#11106
- local dependencies and libraries? arduino-cli#2818
- https://arduino.stackexchange.com/questions/8651/loading-local-libraries
- https://forum.arduino.cc/t/ide-parameters/557892/5
- https://forum.arduino.cc/t/missing-old-ide-features/698280
- https://forum.arduino.cc/t/portable-is-not-honored/850853
- https://forum.arduino.cc/t/arduino-ide-2-0-portable/1031833/10
- https://forum.arduino.cc/t/arduino-ide-2-0-portable/1031833/11
- https://forum.arduino.cc/t/arduino-ide-2-00-and-lilygo-t-display-esp-s3-black-screen/1036875/21
- https://forum.arduino.cc/t/how-do-i-include-a-library-in-a-sketch-directory/1079812/4
- https://forum.arduino.cc/t/is-there-a-way-to-automatically-install-all-libraries-used-by-a-project/1165621
- https://forum.arduino.cc/t/how-to-save-relevant-library-for-the-future/1211416
- https://forum.arduino.cc/t/managing-library-versions-over-multiple-projects/1242941
- https://forum.arduino.cc/t/local-libraries/1259854/1
- https://forum.arduino.cc/t/local-libraries/1259854/10
- https://forum.arduino.cc/t/why-cant-the-ino-file-remember-which-libraries-and-linbrary-versions-were-used-by-that-sketch/1303387
- https://forum.arduino.cc/t/board-and-library-update-issues-causing-breaking-changes/1317643
- https://forum.arduino.cc/t/library-folder-names-irremote-in-particular/1326254
- https://forum.arduino.cc/t/project-libraries-and-dependencies-automatically-to-one-package-for-export/1339096
- https://forum.arduino.cc/t/arduino-library-question/1349706
- https://forum.arduino.cc/t/how-to-force-arduino-ide-to-use-particular-library/1351795/1
- https://forum.arduino.cc/t/how-to-force-arduino-ide-to-use-particular-library/1351795/13
- https://forum.arduino.cc/t/release-control-in-ide-2-x-x/1369830
Related
- Add a portable mode #122
- Allow configuring board for IDE to select by default when sketch is opened #2438
- Allow libraries to be loaded from sketch / project folder Arduino#4936
- Support bundling libraries with a sketch arduino-cli#1255
- Allow zipped libraries bundled with sketches to be automatically installed arduino-cli#1256 / Add support for zipped sketch with embedded libraries arduino-builder#223
Issue checklist
- I searched for previous requests in the issue tracker
- I verified the feature was still missing when using the latest nightly build
- My request contains all necessary details