File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed
app/test/cc/arduino/contributions
cc/arduino/contributions/libraries Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ public void testUpdatableLibrary() throws Exception {
4747
4848 folders .add (new UserLibraryFolder (SD121 , Location .SKETCHBOOK ));
4949 indexer .setLibrariesFolders (folders );
50+ indexer .rescanLibraries ();
5051
5152 sdLib = indexer .getIndex ().getInstalled ("SD" ).get ();
5253 assertTrue ("SD lib is installed" , sdLib .isLibraryInstalled ());
@@ -74,6 +75,7 @@ public void testUpdatableLibraryWithBundled() throws Exception {
7475
7576 folders .add (new UserLibraryFolder (Bridge170 , Location .SKETCHBOOK ));
7677 indexer .setLibrariesFolders (folders );
78+ indexer .rescanLibraries ();
7779
7880 l = indexer .getIndex ().getInstalled ("Bridge" ).get ();
7981 assertTrue ("Bridge lib is installed" , l .isLibraryInstalled ());
Original file line number Diff line number Diff line change @@ -114,9 +114,13 @@ private void parseIndex(File file) throws IOException {
114114 }
115115
116116 public void setLibrariesFolders (List <UserLibraryFolder > folders ) {
117- librariesFolders = folders ;
118- rescanLibraries ();
117+ setLibrariesFolders (folders , false );
119118 }
119+
120+ public void setLibrariesFolders (List <UserLibraryFolder > folders , boolean rescan ) {
121+ librariesFolders = folders ;
122+ if (rescan ) rescanLibraries ();
123+ }
120124
121125 public List <UserLibraryFolder > getLibrariesFolders () {
122126 return librariesFolders ;
Original file line number Diff line number Diff line change @@ -674,10 +674,11 @@ static public void onBoardOrPortChange() {
674674 // Scan for libraries in each library folder.
675675 // Libraries located in the latest folders on the list can override
676676 // other libraries with the same name.
677- librariesIndexer .setLibrariesFolders (librariesFolders );
677+ librariesIndexer .setLibrariesFolders (librariesFolders , false );
678678 if (getTargetPlatform () != null ) {
679679 librariesIndexer .setArchitecturePriority (getTargetPlatform ().getId ());
680680 }
681+
681682 librariesIndexer .rescanLibraries ();
682683
683684 populateImportToLibraryTable ();
You can’t perform that action at this time.
0 commit comments