Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add the ability to find libraries in sketch folder.#11110

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Steve132 wants to merge1 commit intoarduino:master
base:master
Choose a base branch
Loading
fromSteve132:sketch_libraries

Conversation

@Steve132
Copy link

@Steve132Steve132 commentedDec 28, 2020
edited by matthijskooijman
Loading

Feature Explaination:

This is a patch to allow the user to search sketches by default in the /libraries folder if it exists. This feature is referenced and/or requested here:

arduino/arduino-builder#223
#4936
#4936 (comment)
#9507
https://github.com/arduino/Arduino/issues/7755
#11106

This adds this feature to the Arduino IDE provided that the user has enabled it in their preferences. This preference is disabled by default in order to avoid breaking past behavior by default (in the exceedingly unlikely case that the user had a libraries directory in their sketch that they did NOT wish to be compiled).

This feature is not needed to be implemented in arduino-cli, because the user of arduino-cli could always manually add "--librariespwd" or similar very easily in their command line build. However, it may be a good idea to add by default as a potential future feature.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other openPull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests?
  2. Have you lint your code locally prior to submission?

waza-ari, marsfan, Epyon01P, jwktje, pierow2k, elmanav, r41d, limaomerces, and pidge reacted with thumbs up emojiwaza-ari, matthijskooijman, xtrasimplicity, ottobonn, Stefanhg, and r41d reacted with heart emoji
Copy link
Collaborator

@matthijskooijmanmatthijskooijman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'd be very happy if this was finally supported. I hadn't realized that this would be so easy to implement.

This preference is disabled by default in order to avoid breaking past behavior by default (in the exceedingly unlikely case that the user had a libraries directory in their sketch that they did NOT wish to be compiled).

I wonder if this shouldn't just be enabled by default. If this is enabled by default, it really makes it easier to distribute self-contained sketches, without having to instruct recipients to explicitly enable this extra preference.

As you say, it seems rather unlikely that sketches have an existing libraries directory (if they have it, I'd think it would contain libraries intended to be used, originally by copying into the sketchbook libraries dir, which would now just be easier. Some sketches might have modified libraries intended to be included with relative includes rather than through the Arduino-generated include paths, but those would typically be insrc/libraries and even if not, such direct includes would still work and not trigger library detection for these libraries).

Going even further, I wonder if we need a visible preference for this at all? If this is just enabled by default, having a preference inpreferences.txt (but not shown in the GUI) to disable it just in case could be fine.

This feature is not needed to be implemented in arduino-cli, because the user of arduino-cli could always manually add "--libraries pwd" or similar very easily in their command line build. However, it may be a good idea to add by default as a potential future feature.

I would really want to see this in arduino-cli as well (also enabled by default IMHO), since then a single sketch will end up behaving the same between -cli and the IDE. I suspect that this is similarly easy to implement in arduino-cli, though.

Did you check what the priority of this extra libraries directory will be? IIRC arduino-builder has some code to apply different priorities to different library folders (In particular the platform-specific libraries are treated specially, probably using the order specified on the commandline for other libraries?).

I haven't tested this yet, will do that soon as well.

per1234 reacted with thumbs up emoji

PreferencesData.setBoolean("ide.accessible",accessibleIDEBox.isSelected());

PreferencesData.setBoolean("build.load_sketch_libraries",loadSketchLibrariesBox.isSelected());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Should this beuse_sketch_libraries instead? These libraries are not loaded by default, they are made available and used when required. "Use" is also the term used in the checkbox text?

@Steve132
Copy link
Author

Going even further, I wonder if we need a visible preference for this at all? If this is just enabled by default, having a preference in preferences.txt (but not shown in the GUI) to disable it just in case could be fine.

I honestly tend to agree, but since this is my first contribution to Arduino I thought it might be better to avoid any breaking changes and to make sure I dotted my i's and crossed my t's with regards to possibly making breaking changes.

I would really want to see this in arduino-cli as well (also enabled by default IMHO), since then a single sketch will end up behaving the same between -cli and the IDE. I suspect that this is similarly easy to implement in arduino-cli, though.

This is true. I didn't do this yet, but I can if this patch gets merged. I don't want to make the change to arduino-cli until then.

Did you check what the priority of this extra libraries directory will be? IIRC arduino-builder has some code to apply different priorities to different library folders (In particular the platform-specific libraries are treated specially, probably using the order specified on the commandline for other libraries?).

I saw that, but the only way I mitigated it is to make sure this comes first.

@CLAassistant
Copy link

CLAassistant commentedApr 9, 2021
edited
Loading

CLA assistant check
All committers have signed the CLA.

@jwktje
Copy link

I really would love this feature to be added.

@Stefanhg
Copy link

Why is this still not added??!?
It is such a basic function of wanting to modify a library because it is missing a function or because you are working in a team and want to ensure your sketch shares the same library.

r41d, MSakamaki, andrewwakeling, and underwoodblog reacted with thumbs up emoji

@per1234per1234 added feature requestA request to make an enhancement (not a bug fix) Component: CompilationRelated to compilation of Arduino sketches labelsMay 15, 2022
@Levi-Lesches
Copy link

Hi, what's the status of this PR?

@stg
Copy link

stg commentedDec 6, 2023

This is a simple, basic and completely obvious feature, that I for one think should be enabled by default. It needs to be implemented yesterday. Not having this has been a huge problem for so long I can't even remember when I first ran into it and wondered how it had been missed. The src/ workaround does not work when libraries reference other libraries.

@arduinoarduino locked astoo heatedand limited conversation to collaboratorsDec 7, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@matthijskooijmanmatthijskooijmanmatthijskooijman left review comments

Assignees

No one assigned

Labels

Component: CompilationRelated to compilation of Arduino sketchesfeature requestA request to make an enhancement (not a bug fix)

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

8 participants

@Steve132@CLAassistant@jwktje@Stefanhg@Levi-Lesches@stg@matthijskooijman@per1234

[8]ページ先頭

©2009-2025 Movatter.jp