mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-12 06:54:24 +01:00
Removed the, now useless, library folder handling
This commit is contained in:
parent
56bd779288
commit
3c46af8d2c
@ -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(",")) {
|
||||
|
@ -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<UserLibraryFolder> librariesFolders;
|
||||
|
||||
private ArduinoCoreInstance core;
|
||||
|
||||
@ -103,19 +101,6 @@ public class LibrariesIndexer {
|
||||
rescanLibraries();
|
||||
}
|
||||
|
||||
public void setLibrariesFolders(List<UserLibraryFolder> folders) {
|
||||
this.librariesFolders = folders;
|
||||
}
|
||||
|
||||
public void setLibrariesFoldersAndRescan(List<UserLibraryFolder> folders) {
|
||||
setLibrariesFolders(folders);
|
||||
rescanLibraries();
|
||||
}
|
||||
|
||||
public List<UserLibraryFolder> getLibrariesFolders() {
|
||||
return librariesFolders;
|
||||
}
|
||||
|
||||
private Comparator<UserLibrary> priorityComparator = new UserLibraryPriorityComparator(
|
||||
null);
|
||||
|
||||
|
@ -88,9 +88,6 @@ public class BaseNoGui {
|
||||
// maps #included files to their library folder
|
||||
public static Map<String, LibraryList> importToLibraryTable;
|
||||
|
||||
// XXX: Remove this field
|
||||
static private List<UserLibraryFolder> librariesFolders;
|
||||
|
||||
static UserNotifier notifier = new BasicUserNotifier();
|
||||
|
||||
static public Map<String, TargetPackage> packages;
|
||||
@ -269,10 +266,6 @@ public class BaseNoGui {
|
||||
return getHardwareFolder().getAbsolutePath();
|
||||
}
|
||||
|
||||
static public List<UserLibraryFolder> 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> targetPlatform = getTargetPlatform();
|
||||
if (targetPlatform.isPresent()) {
|
||||
String core = getBoardPreferences().get("build.core", "arduino");
|
||||
if (core.contains(":")) {
|
||||
String referencedCore = core.split(":")[0];
|
||||
Optional<TargetPlatform> 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());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user