mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-14 08:54:26 +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.LibrariesIndexer;
|
||||||
import cc.arduino.contributions.libraries.LibraryInstaller;
|
import cc.arduino.contributions.libraries.LibraryInstaller;
|
||||||
import cc.arduino.contributions.libraries.LibraryOfSameTypeComparator;
|
import cc.arduino.contributions.libraries.LibraryOfSameTypeComparator;
|
||||||
import cc.arduino.contributions.libraries.LibraryTypeComparator;
|
|
||||||
import cc.arduino.contributions.libraries.ui.LibraryManagerUI;
|
import cc.arduino.contributions.libraries.ui.LibraryManagerUI;
|
||||||
import cc.arduino.contributions.packages.ContributedPlatform;
|
import cc.arduino.contributions.packages.ContributedPlatform;
|
||||||
import cc.arduino.contributions.packages.ContributionInstaller;
|
import cc.arduino.contributions.packages.ContributionInstaller;
|
||||||
@ -364,7 +363,6 @@ public class Base {
|
|||||||
|
|
||||||
LibrariesIndexer indexer = new LibrariesIndexer(BaseNoGui.getArduinoCoreService());
|
LibrariesIndexer indexer = new LibrariesIndexer(BaseNoGui.getArduinoCoreService());
|
||||||
indexer.regenerateIndex();
|
indexer.regenerateIndex();
|
||||||
indexer.setLibrariesFolders(BaseNoGui.getLibrariesFolders());
|
|
||||||
indexer.rescanLibraries();
|
indexer.rescanLibraries();
|
||||||
|
|
||||||
for (String libraryArg : parser.getLibraryToInstall().split(",")) {
|
for (String libraryArg : parser.getLibraryToInstall().split(",")) {
|
||||||
|
@ -49,7 +49,6 @@ import processing.app.debug.TargetPlatform;
|
|||||||
import processing.app.helpers.FileUtils;
|
import processing.app.helpers.FileUtils;
|
||||||
import processing.app.packages.LibraryList;
|
import processing.app.packages.LibraryList;
|
||||||
import processing.app.packages.UserLibrary;
|
import processing.app.packages.UserLibrary;
|
||||||
import processing.app.packages.UserLibraryFolder;
|
|
||||||
import processing.app.packages.UserLibraryFolder.Location;
|
import processing.app.packages.UserLibraryFolder.Location;
|
||||||
import processing.app.packages.UserLibraryPriorityComparator;
|
import processing.app.packages.UserLibraryPriorityComparator;
|
||||||
|
|
||||||
@ -57,7 +56,6 @@ public class LibrariesIndexer {
|
|||||||
|
|
||||||
private LibrariesIndex index;
|
private LibrariesIndex index;
|
||||||
private final LibraryList installedLibraries = new LibraryList();
|
private final LibraryList installedLibraries = new LibraryList();
|
||||||
private List<UserLibraryFolder> librariesFolders;
|
|
||||||
|
|
||||||
private ArduinoCoreInstance core;
|
private ArduinoCoreInstance core;
|
||||||
|
|
||||||
@ -103,19 +101,6 @@ public class LibrariesIndexer {
|
|||||||
rescanLibraries();
|
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(
|
private Comparator<UserLibrary> priorityComparator = new UserLibraryPriorityComparator(
|
||||||
null);
|
null);
|
||||||
|
|
||||||
|
@ -88,9 +88,6 @@ public class BaseNoGui {
|
|||||||
// maps #included files to their library folder
|
// maps #included files to their library folder
|
||||||
public static Map<String, LibraryList> importToLibraryTable;
|
public static Map<String, LibraryList> importToLibraryTable;
|
||||||
|
|
||||||
// XXX: Remove this field
|
|
||||||
static private List<UserLibraryFolder> librariesFolders;
|
|
||||||
|
|
||||||
static UserNotifier notifier = new BasicUserNotifier();
|
static UserNotifier notifier = new BasicUserNotifier();
|
||||||
|
|
||||||
static public Map<String, TargetPackage> packages;
|
static public Map<String, TargetPackage> packages;
|
||||||
@ -269,10 +266,6 @@ public class BaseNoGui {
|
|||||||
return getHardwareFolder().getAbsolutePath();
|
return getHardwareFolder().getAbsolutePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
static public List<UserLibraryFolder> getLibrariesFolders() {
|
|
||||||
return librariesFolders;
|
|
||||||
}
|
|
||||||
|
|
||||||
static public Platform getPlatform() {
|
static public Platform getPlatform() {
|
||||||
return platform;
|
return platform;
|
||||||
}
|
}
|
||||||
@ -663,37 +656,11 @@ public class BaseNoGui {
|
|||||||
static public void onBoardOrPortChange() {
|
static public void onBoardOrPortChange() {
|
||||||
examplesFolder = getContentFile("examples");
|
examplesFolder = getContentFile("examples");
|
||||||
toolsFolder = getContentFile("tools");
|
toolsFolder = getContentFile("tools");
|
||||||
librariesFolders = new ArrayList<>();
|
|
||||||
|
|
||||||
// Add IDE libraries folder
|
|
||||||
librariesFolders.add(new UserLibraryFolder(getContentFile("libraries"), Location.IDE_BUILTIN));
|
|
||||||
|
|
||||||
Optional<TargetPlatform> targetPlatform = getTargetPlatform();
|
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.
|
// Scan for libraries in each library folder.
|
||||||
// Libraries located in the latest folders on the list can override
|
// Libraries located in the latest folders on the list can override
|
||||||
// other libraries with the same name.
|
// other libraries with the same name.
|
||||||
librariesIndexer.setLibrariesFolders(librariesFolders);
|
|
||||||
if (targetPlatform.isPresent()) {
|
if (targetPlatform.isPresent()) {
|
||||||
librariesIndexer.setArchitecturePriority(targetPlatform.get().getId());
|
librariesIndexer.setArchitecturePriority(targetPlatform.get().getId());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user