From ac6d3c1afffd81d429498b9d00bc2c92f849cbfe Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Tue, 2 Jan 2018 16:34:31 +0100 Subject: [PATCH] Core and ref-Core libraries are not handled by the library manager. --- .../ui/ContributedLibraryTableCellEditor.java | 5 +---- .../contributions/libraries/LibrariesIndexer.java | 15 +++++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/src/cc/arduino/contributions/libraries/ui/ContributedLibraryTableCellEditor.java b/app/src/cc/arduino/contributions/libraries/ui/ContributedLibraryTableCellEditor.java index 1720a4336..4b86df9d6 100644 --- a/app/src/cc/arduino/contributions/libraries/ui/ContributedLibraryTableCellEditor.java +++ b/app/src/cc/arduino/contributions/libraries/ui/ContributedLibraryTableCellEditor.java @@ -47,7 +47,6 @@ import cc.arduino.contributions.VersionComparator; import cc.arduino.contributions.filters.BuiltInPredicate; import cc.arduino.contributions.libraries.ContributedLibrary; import cc.arduino.contributions.libraries.ContributedLibraryReleases; -import cc.arduino.contributions.libraries.filters.OnlyUpstreamReleasePredicate; import cc.arduino.contributions.ui.InstallerTableCell; import cc.arduino.utils.ReverseComparator; @@ -88,9 +87,7 @@ public class ContributedLibraryTableCellEditor extends InstallerTableCell { final Optional mayInstalled = editorValue.getInstalled(); - List releases = editorValue.getReleases().stream() - .filter(new OnlyUpstreamReleasePredicate()) - .collect(Collectors.toList()); + List releases = editorValue.getReleases(); List uninstalledReleases = releases.stream() .filter(l -> !l.isLibraryInstalled()).collect(Collectors.toList()); diff --git a/arduino-core/src/cc/arduino/contributions/libraries/LibrariesIndexer.java b/arduino-core/src/cc/arduino/contributions/libraries/LibrariesIndexer.java index ad1aba3b5..021a20700 100644 --- a/arduino-core/src/cc/arduino/contributions/libraries/LibrariesIndexer.java +++ b/arduino-core/src/cc/arduino/contributions/libraries/LibrariesIndexer.java @@ -191,12 +191,15 @@ public class LibrariesIndexer { } installedLibraries.addOrReplaceArchAware(lib); - // Check if we can find the same library in the index - // and mark it as installed - ContributedLibrary foundLib = index.find(lib.getName(), lib.getVersion()); - if (foundLib != null) { - foundLib.setInstalledUserLibrary(lib); - lib.setTypes(foundLib.getTypes()); + Location loc = lib.getLocation(); + if (loc != Location.CORE && loc != Location.REFERENCED_CORE) { + // Check if we can find the same library in the index + // and mark it as installed + ContributedLibrary foundLib = index.find(lib.getName(), lib.getVersion()); + if (foundLib != null) { + foundLib.setInstalledUserLibrary(lib); + lib.setTypes(foundLib.getTypes()); + } } if (lib.getTypes() == null && folderDesc.location == Location.SKETCHBOOK) {