use of io.sloeber.core.api.Json.ArduinoLibrary in project arduino-eclipse-plugin by Sloeber.
the class LibraryManager method InstallDefaultLibraries.
public static void InstallDefaultLibraries(IProgressMonitor monitor) {
for (ArduinoLibraryIndex libindex : libraryIndices) {
for (String libraryName : Defaults.DEFAULT_INSTALLED_LIBRARIES) {
ArduinoLibrary toInstalLib = libindex.getLibrary(libraryName);
if (toInstalLib != null) {
ArduinoLibraryVersion toInstalLibVersion = toInstalLib.getNewestVersion();
ArduinoLibraryVersion instaledLibVersion = toInstalLib.getInstalledVersion();
if (toInstalLibVersion != null) {
if (toInstalLibVersion != instaledLibVersion) {
if (instaledLibVersion != null) {
unInstall(instaledLibVersion, monitor);
}
install(toInstalLibVersion, monitor);
}
}
}
}
}
}
use of io.sloeber.core.api.Json.ArduinoLibrary in project arduino-eclipse-plugin by Sloeber.
the class LibraryManager method installAllLatestLibraries.
/**
* Install the latest version of all the libraries belonging to this category If
* a earlier version is installed this version will be removed before
* installation of the newer version
*
* @param category
*/
public static void installAllLatestLibraries() {
List<ArduinoLibraryIndex> libraryIndices1 = getLibraryIndices();
for (ArduinoLibraryIndex libraryIndex : libraryIndices1) {
for (ArduinoLibrary curLib : libraryIndex.getLibraries()) {
String curLibName = curLib.getName();
// $NON-NLS-1$ //$NON-NLS-2$
String[] skipArray = { "Base64", "Add others if needed" };
List<String> skipList = Arrays.asList(skipArray);
if (!skipList.contains(curLibName)) {
ArduinoLibraryVersion latestLibVersion = curLib.getNewestVersion();
if (!latestLibVersion.isInstalled()) {
ArduinoLibraryVersion installedLibVersion = curLib.getInstalledVersion();
if (installedLibVersion != null) {
unInstall(installedLibVersion, null);
}
install(latestLibVersion, null);
}
}
}
}
}
Aggregations