File tree Expand file tree Collapse file tree 4 files changed +10
-3
lines changed
test/cc/arduino/contributions
cc/arduino/contributions/libraries Expand file tree Collapse file tree 4 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -339,6 +339,7 @@ public Base(String[] args) throws Exception {
339339 LibrariesIndexer indexer = new LibrariesIndexer (BaseNoGui .getSettingsFolder ());
340340 indexer .parseIndex ();
341341 indexer .setLibrariesFolders (BaseNoGui .getLibrariesFolders ());
342+ indexer .rescanLibraries ();
342343
343344 for (String library : parser .getLibraryToInstall ().split ("," )) {
344345 String [] libraryToInstallParts = library .split (":" );
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ public void testUpdatableLibrary() throws Exception {
3737 BaseNoGui .librariesIndexer = indexer ;
3838 indexer .parseIndex ();
3939 indexer .setLibrariesFolders (folders );
40+ indexer .rescanLibraries ();
4041
4142 ContributedLibrary sdLib = indexer .getIndex ().getInstalled ("SD" ).get ();
4243 assertTrue ("SD lib is installed" , sdLib .isLibraryInstalled ());
@@ -63,6 +64,7 @@ public void testUpdatableLibraryWithBundled() throws Exception {
6364 BaseNoGui .librariesIndexer = indexer ;
6465 indexer .parseIndex ();
6566 indexer .setLibrariesFolders (folders );
67+ indexer .rescanLibraries ();
6668
6769 ContributedLibrary l = indexer .getIndex ().getInstalled ("Bridge" ).get ();
6870 assertTrue ("Bridge lib is installed" , l .isLibraryInstalled ());
Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ public List<UserLibraryFolder> getLibrariesFolders() {
113113 return librariesFolders ;
114114 }
115115
116- private UserLibraryPriorityComparator priorityComparator ;
116+ private UserLibraryPriorityComparator priorityComparator = new UserLibraryPriorityComparator ( null ) ;
117117
118118 public void addToInstalledLibraries (UserLibrary lib ) {
119119 UserLibrary toReplace = installedLibraries .getByName (lib .getName ());
@@ -129,9 +129,11 @@ public void addToInstalledLibraries(UserLibrary lib) {
129129 installedLibraries .add (lib );
130130 }
131131
132- public void rescanLibraries () {
133- priorityComparator = new UserLibraryPriorityComparator (BaseNoGui .getTargetPlatform ().getId ());
132+ public void setArchitecturePriority (String arch ) {
133+ priorityComparator = new UserLibraryPriorityComparator (arch );
134+ }
134135
136+ public void rescanLibraries () {
135137 // Clear all installed flags
136138 installedLibraries .clear ();
137139
Original file line number Diff line number Diff line change @@ -675,6 +675,8 @@ static public void onBoardOrPortChange() {
675675 // Libraries located in the latest folders on the list can override
676676 // other libraries with the same name.
677677 librariesIndexer .setLibrariesFolders (librariesFolders );
678+ librariesIndexer .setArchitecturePriority (getTargetPlatform ().getId ());
679+ librariesIndexer .rescanLibraries ();
678680
679681 populateImportToLibraryTable ();
680682 }
You can’t perform that action at this time.
0 commit comments