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
Automatically install libraries that a user imports, if not already installed #3155
Conversation
5a6b8db
to
4abb2a9
Compare
@joelmoniz Did you check with @prisonerjohn about adding new fields to library.properties? This modification shouldn't break compatibility with existing libraries. |
Oops. No, I haven't checked with him. @prisonerjohn , could you please
check up on the changes I've made? As far as I can tell, they won't break
existing libraries in any way, but merely provide the functionality to
automatically install the library if imported by the user when the new
field is present.
NB: This field is required only for AvailableContributions, not
LocalContributions, since it is needed only to install the library, and not
once it is installed
|
Looks like we need an update for this one so that I can merge it against the current repo. |
|
||
if (contribution != null) { | ||
contribListing.replaceContribution(ad, contribution); | ||
if (base.getActiveEditor() != null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please always use { and } for all blocks, no single statements, please. Too prone to errors.
Whoops. Sorry about the formatting, lack of enclosing curly braces and the merge conflict. I shall update things and push up another commit right away. |
4abb2a9
to
2f95e05
Compare
@benfry Sorry about that. The brackets and indentation ought to be fixed now, and things should be auto-mergeable. |
Automatically install libraries that a user imports, if not already installed
Thank you; much appreciated! |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This fixes #2566. It basically checks for whether the imported libraries are already installed or not. If one or more of them aren't, and if any/all of them are available, a dialog menu is displayed to the user listing the available, not installed libraries. Selecting
Yes
installs the libraries and runs the sketch, while selectingNo
simply runs the sketch directly (which eventually displays an error due to the missing library).Note: This adds a new field,
imports
, to thelibrary.properties
file, where the most commonly used headers of the library are listed.