Skip to content

Commit 7a74c7f

Browse files
author
jantje
committed
No longer looping over categories
There is still a problem with libraries located in multiple json files
1 parent b98c9f6 commit 7a74c7f

File tree

3 files changed

+10
-17
lines changed

3 files changed

+10
-17
lines changed

io.sloeber.core/src/io/sloeber/core/api/LibraryManager.java

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -220,24 +220,12 @@ public static String getPrivateLibraryPathsString() {
220220
}
221221

222222
/**
223-
* Wrapper method for Manager. installAllLatestLibraries(String category)
224-
*
223+
* Wrapper method for Manager. installAllLatestLibraries()
224+
*
225225
* @param category
226226
*/
227-
public static void installAllLatestLibraries(String category) {
228-
Manager.installAllLatestLibraries(category);
229-
}
230-
231-
/**
232-
* Convenience method for installAllLatestLibraries(String category) calling
233-
* it for all categories
234-
*/
235227
public static void installAllLatestLibraries() {
236-
Set<String> allcategories = getAllCategories();
237-
for (String categorieName : allcategories) {
238-
Manager.installAllLatestLibraries(categorieName);
239-
}
240-
228+
Manager.installAllLatestLibraries();
241229
}
242230

243231
/**

io.sloeber.core/src/io/sloeber/core/managers/LibraryIndex.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ public Collection<Library> getLatestLibraries(String category) {
8989
return libs;
9090
}
9191

92+
public Collection<Library> getLatestLibraries() {
93+
94+
return this.latestLibs.values();
95+
}
96+
9297
public Collection<Library> getLibraries(String category) {
9398
Set<String> categoryLibs = this.categories.get(category);
9499
if (categoryLibs == null) {

io.sloeber.core/src/io/sloeber/core/managers/Manager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -866,10 +866,10 @@ public static void onlyKeepLatestPlatforms() {
866866
*
867867
* @param category
868868
*/
869-
public static void installAllLatestLibraries(String category) {
869+
public static void installAllLatestLibraries() {
870870
List<LibraryIndex> libraryIndices1 = getLibraryIndices();
871871
for (LibraryIndex libraryIndex : libraryIndices1) {
872-
Collection<Library> libraries = libraryIndex.getLatestLibraries(category);
872+
Collection<Library> libraries = libraryIndex.getLatestLibraries();
873873
for (Library library : libraries) {
874874
Library previousVersion = libraryIndex.getInstalledLibrary(library.getName());
875875
if ((previousVersion != null) && (previousVersion != library)) {

0 commit comments

Comments
 (0)