Skip to content

Commit 026e0d3

Browse files
committed
Removed the, now useless, library folder handling
1 parent 6474fbf commit 026e0d3

File tree

3 files changed

+0
-47
lines changed

3 files changed

+0
-47
lines changed

app/src/processing/app/Base.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import cc.arduino.contributions.libraries.LibrariesIndexer;
3333
import cc.arduino.contributions.libraries.LibraryInstaller;
3434
import cc.arduino.contributions.libraries.LibraryOfSameTypeComparator;
35-
import cc.arduino.contributions.libraries.LibraryTypeComparator;
3635
import cc.arduino.contributions.libraries.ui.LibraryManagerUI;
3736
import cc.arduino.contributions.packages.ContributedPlatform;
3837
import cc.arduino.contributions.packages.ContributionInstaller;
@@ -364,7 +363,6 @@ public Base(String[] args) throws Exception {
364363

365364
LibrariesIndexer indexer = new LibrariesIndexer(BaseNoGui.getArduinoCoreService());
366365
indexer.regenerateIndex();
367-
indexer.setLibrariesFolders(BaseNoGui.getLibrariesFolders());
368366
indexer.rescanLibraries();
369367

370368
for (String libraryArg : parser.getLibraryToInstall().split(",")) {

arduino-core/src/cc/arduino/contributions/libraries/LibrariesIndexer.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,13 @@
4949
import processing.app.helpers.FileUtils;
5050
import processing.app.packages.LibraryList;
5151
import processing.app.packages.UserLibrary;
52-
import processing.app.packages.UserLibraryFolder;
5352
import processing.app.packages.UserLibraryFolder.Location;
5453
import processing.app.packages.UserLibraryPriorityComparator;
5554

5655
public class LibrariesIndexer {
5756

5857
private LibrariesIndex index;
5958
private final LibraryList installedLibraries = new LibraryList();
60-
private List<UserLibraryFolder> librariesFolders;
6159

6260
private ArduinoCoreInstance core;
6361

@@ -103,15 +101,6 @@ public void regenerateIndex() {
103101
rescanLibraries();
104102
}
105103

106-
public void setLibrariesFolders(List<UserLibraryFolder> folders) {
107-
librariesFolders = folders;
108-
rescanLibraries();
109-
}
110-
111-
public List<UserLibraryFolder> getLibrariesFolders() {
112-
return librariesFolders;
113-
}
114-
115104
private Comparator<UserLibrary> priorityComparator = new UserLibraryPriorityComparator(
116105
null);
117106

arduino-core/src/processing/app/BaseNoGui.java

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,6 @@ public class BaseNoGui {
8888
// maps #included files to their library folder
8989
public static Map<String, LibraryList> importToLibraryTable;
9090

91-
// XXX: Remove this field
92-
static private List<UserLibraryFolder> librariesFolders;
93-
9491
static UserNotifier notifier = new BasicUserNotifier();
9592

9693
static public Map<String, TargetPackage> packages;
@@ -263,10 +260,6 @@ static public String getHardwarePath() {
263260
return getHardwareFolder().getAbsolutePath();
264261
}
265262

266-
static public List<UserLibraryFolder> getLibrariesFolders() {
267-
return librariesFolders;
268-
}
269-
270263
static public Platform getPlatform() {
271264
return platform;
272265
}
@@ -656,37 +649,10 @@ public static boolean isIDEInstalledIntoSettingsFolder() {
656649
static public void onBoardOrPortChange() {
657650
examplesFolder = getContentFile("examples");
658651
toolsFolder = getContentFile("tools");
659-
librariesFolders = new ArrayList<>();
660-
661-
// Add IDE libraries folder
662-
librariesFolders.add(new UserLibraryFolder(getContentFile("libraries"), Location.IDE_BUILTIN));
663-
664-
TargetPlatform targetPlatform = getTargetPlatform();
665-
if (targetPlatform != null) {
666-
String core = getBoardPreferences().get("build.core", "arduino");
667-
if (core.contains(":")) {
668-
String referencedCore = core.split(":")[0];
669-
TargetPlatform referencedPlatform = getTargetPlatform(referencedCore, targetPlatform.getId());
670-
if (referencedPlatform != null) {
671-
File referencedPlatformFolder = referencedPlatform.getFolder();
672-
// Add libraries folder for the referenced platform
673-
File folder = new File(referencedPlatformFolder, "libraries");
674-
librariesFolders.add(new UserLibraryFolder(folder, Location.REFERENCED_CORE));
675-
}
676-
}
677-
File platformFolder = targetPlatform.getFolder();
678-
// Add libraries folder for the selected platform
679-
File folder = new File(platformFolder, "libraries");
680-
librariesFolders.add(new UserLibraryFolder(folder, Location.CORE));
681-
}
682-
683-
// Add libraries folder for the sketchbook
684-
librariesFolders.add(getSketchbookLibrariesFolder());
685652

686653
// Scan for libraries in each library folder.
687654
// Libraries located in the latest folders on the list can override
688655
// other libraries with the same name.
689-
librariesIndexer.setLibrariesFolders(librariesFolders);
690656
if (getTargetPlatform() != null) {
691657
librariesIndexer.setArchitecturePriority(getTargetPlatform().getId());
692658
}

0 commit comments

Comments
 (0)