File tree 4 files changed +10
-3
lines changed
test/cc/arduino/contributions
cc/arduino/contributions/libraries
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 {
339
339
LibrariesIndexer indexer = new LibrariesIndexer (BaseNoGui .getSettingsFolder ());
340
340
indexer .parseIndex ();
341
341
indexer .setLibrariesFolders (BaseNoGui .getLibrariesFolders ());
342
+ indexer .rescanLibraries ();
342
343
343
344
for (String library : parser .getLibraryToInstall ().split ("," )) {
344
345
String [] libraryToInstallParts = library .split (":" );
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ public void testUpdatableLibrary() throws Exception {
37
37
BaseNoGui .librariesIndexer = indexer ;
38
38
indexer .parseIndex ();
39
39
indexer .setLibrariesFolders (folders );
40
+ indexer .rescanLibraries ();
40
41
41
42
ContributedLibrary sdLib = indexer .getIndex ().getInstalled ("SD" ).get ();
42
43
assertTrue ("SD lib is installed" , sdLib .isLibraryInstalled ());
@@ -63,6 +64,7 @@ public void testUpdatableLibraryWithBundled() throws Exception {
63
64
BaseNoGui .librariesIndexer = indexer ;
64
65
indexer .parseIndex ();
65
66
indexer .setLibrariesFolders (folders );
67
+ indexer .rescanLibraries ();
66
68
67
69
ContributedLibrary l = indexer .getIndex ().getInstalled ("Bridge" ).get ();
68
70
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() {
113
113
return librariesFolders ;
114
114
}
115
115
116
- private UserLibraryPriorityComparator priorityComparator ;
116
+ private UserLibraryPriorityComparator priorityComparator = new UserLibraryPriorityComparator ( null ) ;
117
117
118
118
public void addToInstalledLibraries (UserLibrary lib ) {
119
119
UserLibrary toReplace = installedLibraries .getByName (lib .getName ());
@@ -129,9 +129,11 @@ public void addToInstalledLibraries(UserLibrary lib) {
129
129
installedLibraries .add (lib );
130
130
}
131
131
132
- public void rescanLibraries () {
133
- priorityComparator = new UserLibraryPriorityComparator (BaseNoGui .getTargetPlatform ().getId ());
132
+ public void setArchitecturePriority (String arch ) {
133
+ priorityComparator = new UserLibraryPriorityComparator (arch );
134
+ }
134
135
136
+ public void rescanLibraries () {
135
137
// Clear all installed flags
136
138
installedLibraries .clear ();
137
139
Original file line number Diff line number Diff line change @@ -675,6 +675,8 @@ static public void onBoardOrPortChange() {
675
675
// Libraries located in the latest folders on the list can override
676
676
// other libraries with the same name.
677
677
librariesIndexer .setLibrariesFolders (librariesFolders );
678
+ librariesIndexer .setArchitecturePriority (getTargetPlatform ().getId ());
679
+ librariesIndexer .rescanLibraries ();
678
680
679
681
populateImportToLibraryTable ();
680
682
}
You can’t perform that action at this time.
0 commit comments