diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 359c74f86..2491bb96a 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -32,7 +32,6 @@ import cc.arduino.contributions.libraries.ContributedLibraryRelease; import cc.arduino.contributions.libraries.LibrariesIndexer; import cc.arduino.contributions.libraries.LibraryInstaller; import cc.arduino.contributions.libraries.LibraryOfSameTypeComparator; -import cc.arduino.contributions.libraries.LibraryTypeComparator; import cc.arduino.contributions.libraries.ui.LibraryManagerUI; import cc.arduino.contributions.packages.ContributedPlatform; import cc.arduino.contributions.packages.ContributionInstaller; @@ -364,7 +363,6 @@ public class Base { LibrariesIndexer indexer = new LibrariesIndexer(BaseNoGui.getArduinoCoreService()); indexer.regenerateIndex(); - indexer.setLibrariesFolders(BaseNoGui.getLibrariesFolders()); indexer.rescanLibraries(); for (String libraryArg : parser.getLibraryToInstall().split(",")) { diff --git a/arduino-core/src/cc/arduino/contributions/libraries/LibrariesIndexer.java b/arduino-core/src/cc/arduino/contributions/libraries/LibrariesIndexer.java index c9e2f90a1..a4eff60e0 100644 --- a/arduino-core/src/cc/arduino/contributions/libraries/LibrariesIndexer.java +++ b/arduino-core/src/cc/arduino/contributions/libraries/LibrariesIndexer.java @@ -49,7 +49,6 @@ import processing.app.debug.TargetPlatform; import processing.app.helpers.FileUtils; import processing.app.packages.LibraryList; import processing.app.packages.UserLibrary; -import processing.app.packages.UserLibraryFolder; import processing.app.packages.UserLibraryFolder.Location; import processing.app.packages.UserLibraryPriorityComparator; @@ -57,7 +56,6 @@ public class LibrariesIndexer { private LibrariesIndex index; private final LibraryList installedLibraries = new LibraryList(); - private List librariesFolders; private ArduinoCoreInstance core; @@ -103,19 +101,6 @@ public class LibrariesIndexer { rescanLibraries(); } - public void setLibrariesFolders(List folders) { - this.librariesFolders = folders; - } - - public void setLibrariesFoldersAndRescan(List folders) { - setLibrariesFolders(folders); - rescanLibraries(); - } - - public List getLibrariesFolders() { - return librariesFolders; - } - private Comparator priorityComparator = new UserLibraryPriorityComparator( null); diff --git a/arduino-core/src/processing/app/BaseNoGui.java b/arduino-core/src/processing/app/BaseNoGui.java index 8692fd3b9..babc64601 100644 --- a/arduino-core/src/processing/app/BaseNoGui.java +++ b/arduino-core/src/processing/app/BaseNoGui.java @@ -88,9 +88,6 @@ public class BaseNoGui { // maps #included files to their library folder public static Map importToLibraryTable; - // XXX: Remove this field - static private List librariesFolders; - static UserNotifier notifier = new BasicUserNotifier(); static public Map packages; @@ -269,10 +266,6 @@ public class BaseNoGui { return getHardwareFolder().getAbsolutePath(); } - static public List getLibrariesFolders() { - return librariesFolders; - } - static public Platform getPlatform() { return platform; } @@ -663,37 +656,11 @@ public class BaseNoGui { static public void onBoardOrPortChange() { examplesFolder = getContentFile("examples"); toolsFolder = getContentFile("tools"); - librariesFolders = new ArrayList<>(); - - // Add IDE libraries folder - librariesFolders.add(new UserLibraryFolder(getContentFile("libraries"), Location.IDE_BUILTIN)); - Optional targetPlatform = getTargetPlatform(); - if (targetPlatform.isPresent()) { - String core = getBoardPreferences().get("build.core", "arduino"); - if (core.contains(":")) { - String referencedCore = core.split(":")[0]; - Optional referencedPlatform = getTargetPlatform(referencedCore, targetPlatform.get().getId()); - if (referencedPlatform.isPresent()) { - File referencedPlatformFolder = referencedPlatform.get().getFolder(); - // Add libraries folder for the referenced platform - File folder = new File(referencedPlatformFolder, "libraries"); - librariesFolders.add(new UserLibraryFolder(folder, Location.REFERENCED_CORE)); - } - } - File platformFolder = targetPlatform.get().getFolder(); - // Add libraries folder for the selected platform - File folder = new File(platformFolder, "libraries"); - librariesFolders.add(new UserLibraryFolder(folder, Location.CORE)); - } - - // Add libraries folder for the sketchbook - librariesFolders.add(getSketchbookLibrariesFolder()); // Scan for libraries in each library folder. // Libraries located in the latest folders on the list can override // other libraries with the same name. - librariesIndexer.setLibrariesFolders(librariesFolders); if (targetPlatform.isPresent()) { librariesIndexer.setArchitecturePriority(targetPlatform.get().getId()); }