Skip to content

Commit

Permalink
List OSGI plugins in the export list: Edits
Browse files Browse the repository at this point in the history
  • Loading branch information
alshamams committed Oct 26, 2023
1 parent 218b72b commit 148c9e6
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.eclipse.pde.internal.core.ICoreConstants;
import org.eclipse.pde.internal.core.PDECore;
import org.eclipse.pde.internal.core.WorkspaceModelManager;
import org.eclipse.pde.internal.core.bnd.BndProjectManager;
import org.eclipse.pde.internal.ui.IHelpContextIds;
import org.eclipse.pde.internal.ui.PDEUIMessages;
import org.eclipse.pde.internal.ui.util.PersistablePluginObject;
Expand Down Expand Up @@ -54,7 +55,7 @@ public Object[] getListElements() {
if (!WorkspaceModelManager.isBinaryProject(projects[i]) && WorkspaceModelManager.isPluginProject(projects[i])) {
IModel model = PluginRegistry.findModel(projects[i]);
if (model != null && isValidModel(model) && (hasBuildProperties((IPluginModelBase) model)
|| hasPdeBndDescriptor((IPluginModelBase) model))) {
|| hasPdeBndDescriptor(projects[i]))) {
result.add(model);
}
}
Expand All @@ -72,13 +73,12 @@ private boolean hasBuildProperties(IPluginModelBase model) {
return file.exists();
}

private boolean hasPdeBndDescriptor(IPluginModelBase model) {
File bin = new File(model.getInstallLocation());
if (bin.exists()) {
File file = new File(bin.getParent(), ICoreConstants.BND_FILENAME_DESCRIPTOR);
return file.exists();
private boolean hasPdeBndDescriptor(IProject project) {
try {
return !BndProjectManager.getBndProject(project).isEmpty();
} catch (Exception e) {
return false;
}
return false;

}

Expand Down

0 comments on commit 148c9e6

Please sign in to comment.