Skip to content

Commit 13b94b7

Browse files
committed
better detect BND workspace
1 parent 9d2fc45 commit 13b94b7

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

ui/org.eclipse.pde.bnd.ui/src/org/eclipse/pde/bnd/ui/RepositoryUtils.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838

3939
import aQute.bnd.build.Project;
4040
import aQute.bnd.build.Workspace;
41+
import aQute.bnd.build.WorkspaceLayout;
4142
import aQute.bnd.memoize.Memoize;
4243
import aQute.bnd.service.RegistryPlugin;
4344
import aQute.bnd.service.RepositoryPlugin;
@@ -56,6 +57,7 @@ public class RepositoryUtils {
5657
return tracker.orElse(null);
5758
}, Objects::nonNull);
5859
}
60+
5961

6062
public static List<RepositoryPlugin> listRepositories(final Workspace localWorkspace, final boolean hideCache) {
6163
if (localWorkspace == null) {
@@ -74,11 +76,10 @@ public static List<RepositoryPlugin> listRepositories(final Workspace localWorks
7476
// if ((bndWorkspace == localWorkspace) && !bndWorkspace.isDefaultWorkspace())
7577
// repos.add(Central.getWorkspaceRepository());
7678

77-
// if there is a cnf project (which is the marker for a bnd workspace)
78-
// then we now show the WorkspaceRepository which contains all projects
7979
// TODO this is not perfect, because it is only working
80-
// if you are selecting a bnd project
81-
if (Central.hasWorkspaceDirectory() && !localWorkspace.isDefaultWorkspace() && !localWorkspace.getAllProjects().isEmpty()) {
80+
// if you are selecting a bnd project. Would be better if bnd WorkspaceRepository is added always
81+
// e.g. if there is at least one bnd project
82+
if (WorkspaceLayout.BND == localWorkspace.getLayout() && !localWorkspace.isDefaultWorkspace()) {
8283
repos.add(localWorkspace.getWorkspaceRepository());
8384
}
8485

0 commit comments

Comments
 (0)