Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List OSGI plugins in the export list #799

Merged
merged 1 commit into from
Nov 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 All @@ -53,7 +54,8 @@ public Object[] getListElements() {
for (int i = 0; i < projects.length; i++) {
if (!WorkspaceModelManager.isBinaryProject(projects[i]) && WorkspaceModelManager.isPluginProject(projects[i])) {
IModel model = PluginRegistry.findModel(projects[i]);
if (model != null && isValidModel(model) && hasBuildProperties((IPluginModelBase) model)) {
if (model != null && isValidModel(model) && (hasBuildProperties((IPluginModelBase) model)
|| hasPdeBndDescriptor(projects[i]))) {
result.add(model);
}
}
Expand All @@ -71,6 +73,15 @@ private boolean hasBuildProperties(IPluginModelBase model) {
return file.exists();
}

private boolean hasPdeBndDescriptor(IProject project) {
try {
return BndProjectManager.getBndProject(project).isPresent();
} catch (Exception e) {
return false;
}

}

@Override
protected boolean isValidModel(IModel model) {
return model != null && model instanceof IPluginModelBase;
Expand Down
Loading