8000 Removed the, now useless, library folder handling · arduino-collections/Arduino-1@3c46af8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3c46af8

Browse files
committed
Removed the, now useless, library folder handling
1 parent 56bd779 commit 3c46af8

File tree

3 files changed

+0
-50
lines changed

3 files changed

+0
-50
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 & 15 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,19 +101,6 @@ public void regenerateIndex() {
103101
rescanLibraries();
104102
}
105103

106-
public void setLibrariesFolders(List<UserLibraryFolder> folders) {
107-
this.librariesFolders = folders;
108-
}
109-
110-
public void setLibrariesFoldersAndRescan(List<UserLibraryFolder> folders) {
111-
setLibrariesFolders(folders);
112-
rescanLibraries();
113-
}
114-
115-
public List<UserLibraryFolder> getLibrariesFolders() {
116-
return librariesFolders;
117-
}
118-
119104
private Comparator<UserLibrary> priorityComparator = new UserLibraryPriorityComparator(
120105
null);
121106

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

Lines changed: 0 additions & 33 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;
@@ -269,10 +266,6 @@ static public String getHardwarePath() {
269266
return getHardwareFolder().getAbsolutePath();
270267
}
271268

272-
static public List<UserLibraryFolder> getLibrariesFolders() {
273-
return librariesFolders;
274-
}
275-
276269
static public Platform getPlatform() {
277270
return platform;
278271
}
@@ -663,37 +656,11 @@ public static boolean isIDEInstalledIntoSettingsFolder() {
663656
static public void onBoardOrPortChange() {
664657
examplesFolder = getContentFile("examples");
665658
toolsFolder = getContentFile("tools");
666-
librariesFolders = new ArrayList<>();
667-
668-
// Add IDE libraries folder
669-
librariesFolders.add(new UserLibraryFolder(getContentFile("libraries"), Location.IDE_BUILTIN));
670-
671659
Optional<TargetPlatform> targetPlatform = getTargetPlatform();
672-
if (targetPlatform.isPresent()) {
673-
String core = getBoardPreferences().get("build.core", "arduino");
674-
if (core.contains(":")) {
675-
String referencedCore = core.split(":")[0];
676-
Optional<TargetPlatform> referencedPlatform = getTargetPlatform(referencedCore, targetPlatform.get().getId());
677-
if (referencedPlatform.isPresent()) {
678-
File referencedPlatformFolder = referencedPlatform.get().getFolder();
679-
// Add libraries folder for the referenced platform
680-
File folder = new File(referencedPlatformFolder, "libraries");
681-
librariesFolders.add(new UserLibraryFolder(folder, Location.REFERENCED_CORE));
682-
}
683-
}
684-
File platformFolder = targetPlatform.get().getFolder();
685-
// Add libraries folder for the selected platform
686-
File folder = new File(platformFolder, "libraries");
687-
librariesFolders.add(new UserLibraryFolder(folder, Location.CORE));
688-
}
689-
690-
// Add libraries folder for the sketchbook
691-
librariesFolders.add(getSketchbookLibrariesFolder());
692660

693661
// Scan for libraries in each library folder.
694662
// Libraries located in the latest folders on the list can override
695663
// other libraries with the same name.
696-
librariesIndexer.setLibrariesFolders(librariesFolders);
697664
if (targetPlatform.isPresent()) {
698665
librariesIndexer.setArchitecturePriority(targetPlatform.get().getId());
699666
}

0 commit comments

Comments
 (0)
0