-
-
Notifications
You must be signed in to change notification settings - Fork 388
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
Support bundling libraries with a sketch #1255
Comments
I believe there are open issues about this already, did you look for them? In any case, I'd really like to see the IDE support a |
I looked for other open issues and found a couple related things, though none that would make this a duplicate:
The addition of recursive compilation of the The problem with bundling libraries in the |
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as off-topic.
This comment was marked as off-topic.
I want to add a +1 here too. I'm working on a series of sketches all utilizing the same set of core private headers, and having to make duplicate copies of them in every project because the compiler doesn't understand relative paths is a real pain in the neck. I have maybe half a dozen projects that need to |
Huh? But how would the feature requested by this issue help here? This issue requests that a copy of a library inside the sketch folder can be used just like a normal shared library. For your usecase, it sounds like you just need to make your "core private headers" into a library, install it into your sketchook "libraries" directory along with the other libraries, and then you can just include these from all sketches that need them? |
You're right, the issue as it stands wouldn't be helpful. I was referring to per1234's message a few up where he mentions e.g. My personal goal is to get away from using the Arduino IDE and to VS Code for a variety of reasons, so adding to some IDE specific library manager doesn't seem like a good path forward. The forums have indicated to me that including with relative paths simply doesn't work in the Arduino IDE because the files are copied somewhere else prior to compilation, and it seems like the VS Code arduino plugin seems to do the same thing (I guess?) before calling avr-gcc, or however it enters the ecosystem's toolchain. |
I should clarify that when I mentioned I'll provide a more detailed explanation: Let's say you have a sketch with a structure like this:
With a normal library installation to the
Here's the forum thread @alandsidel mentioned: https://forum.arduino.cc/index.php?topic=699636 |
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
I implemented this feature and made a pull-request arduino/Arduino#11110 |
Describe the request
🙂 It will be easier for sketch developers to share a sketch as a package that includes library dependencies, avoiding the need for each user to install the library dependencies.
🙂 Library dependencies of the sketch can be controlled, allowing them to be pinned to the specific versions the sketch was intended to be used with, independent from the version of any globally installations of the library. As an example there are major changes to the API of the very popular "ArduinoJson" library in version 6 and sketches only work with one or the other major version series of that dependency.
Describe the current behavior
The common approach to bundling libraries with a sketch is to dump the library code files into the sketch root folder.
Arduino CLI version
a58d5ad
Operating system
All
Operating system version
All
Additional context
directories.user
) can be set to the sketch folder. But this has to be done manually and changed every time another program is handled. So there could be some option for this to be set in the.ino
file.build.options.json
is generated automatically.There are some options where additional library folders could possibly be added?
E.g.:
Additional Requests
Issue checklist
The text was updated successfully, but these errors were encountered: