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

Detecting libraries and examples implementation #3

Open
tngyn opened this issue Nov 30, 2015 · 0 comments
Open

Detecting libraries and examples implementation #3

tngyn opened this issue Nov 30, 2015 · 0 comments

Comments

@tngyn
Copy link
Contributor

tngyn commented Nov 30, 2015

We suspect that the Arduino IDE finds all the libraries and examples within a sketchbook using Base.java:rebuildExamplesMenu(). Using this code directly leads to dependency issues when trying to isolate the code.

The detection of the examples starts in Base.java’s rebuildExamplesMenu(JMenu menu) method, which calls the Base.java getIDELibs method which has a dependency on the LibrariesIndexer file. The LibrariesIndexer has a lot of dependencies on other Arduino files itself. More specifically, we need the entire class and its instance variables to use a couple of methods to set things up. The LIbrariesIndexer needs to return the installedLibraries variable to Base.java’s getIDELibs() method. To do that, LibrariesIndexer needs to call these functions which have dependencies to files listed between square brackets [].

From within LibrariesIndexer.java setLibrariesFolders -> rescanLibraries -> scanInstalledLibraries [BaseNoGui call, OnlyDirs] -> scanLibrary [FileUtils, LegacyUserLibrary, UserLibrary, ContributedLibrary]

Furthermore, there are a lot of things going on in BaseNoGui.java that are needed to detect the correct libraries and examples.

As a result, our current implementation tries to find and parse the "libraries" and "examples" folders by looking for a top level "libraries" folder and then finding all the correct sketches using getSketches(), which is the original function we used to detect sketches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant