Skip to content

Commit 86b18e7

Browse files
committed
Support extra classpath with no inner jar specification
Currently one can only reference an inner jar with extra-classpath but not the bundle itself. As this is actually something useful and this is even used in platform builds (even though it seem not effective due to this bug), PDE should support it as well.
1 parent a3feb92 commit 86b18e7

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/RequiredPluginsClasspathContainer.java

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -522,18 +522,26 @@ protected void addExtraClasspathEntries(List<IClasspathEntry> entries, String[]
522522
addExtraLibrary(path, null, entries);
523523
} else {
524524
int count = path.getDevice() == null ? 4 : 3;
525-
if (path.segmentCount() >= count) {
525+
int segments = path.segmentCount();
526+
if (segments >= count - 1) {
526527
String pluginID = path.segment(count - 2);
527528
IPluginModelBase model = PluginRegistry.findModel(pluginID);
528529
if (model != null && model.isEnabled()) {
529530
path = path.setDevice(null);
530531
path = path.removeFirstSegments(count - 1);
531532
IResource underlyingResource = model.getUnderlyingResource();
532533
if (underlyingResource == null) {
533-
IPath result = PDECore.getDefault().getModelManager().getExternalModelManager()
534-
.getNestedLibrary(model, path.toString());
535-
if (result != null) {
536-
addExtraLibrary(result, model, entries);
534+
if (path.segmentCount() == 0) {
535+
String installLocation = model.getInstallLocation();
536+
if (installLocation != null) {
537+
addExtraLibrary(IPath.fromOSString(installLocation), model, entries);
538+
}
539+
} else {
540+
IPath result = PDECore.getDefault().getModelManager().getExternalModelManager()
541+
.getNestedLibrary(model, path.toString());
542+
if (result != null) {
543+
addExtraLibrary(result, model, entries);
544+
}
537545
}
538546
} else {
539547
IFile file = underlyingResource.getProject().getFile(path);

0 commit comments

Comments
 (0)