Skip to content

Commit aa6f1da

Browse files
committed
Add implicit dependencies from the target
Currently if one defines implicit dependencies in the target these only getting added to the launch but not the project, this makes these quite hard to use. The best would be to make this feature more flexible to let the user choose if it is a runtime requirement or a compile dependency. Unless we have this, it seems the best way is to add it in both cases as indicated in the help: > The Implicit Dependencies section is used to manage the implicit > dependencies of the target. Any plug-in marked as an implicit > dependency will always be added as a required plug-in when PDE > determines requirements.
1 parent 5c59d79 commit aa6f1da

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
import org.eclipse.pde.core.build.IBuildEntry;
5959
import org.eclipse.pde.core.plugin.IPluginModelBase;
6060
import org.eclipse.pde.core.plugin.PluginRegistry;
61+
import org.eclipse.pde.core.target.NameVersionDescriptor;
6162
import org.eclipse.pde.internal.build.BundleHelper;
6263
import org.eclipse.pde.internal.build.IBuildPropertiesConstants;
6364
import org.eclipse.pde.internal.core.bnd.BndProjectManager;
@@ -275,6 +276,7 @@ private List<IClasspathEntry> computePluginEntriesByModel() {
275276
}
276277

277278
addJunit5RuntimeDependencies(added, entries);
279+
addImplicitDependencies(desc, added, entries);
278280

279281
} catch (CoreException e) {
280282
}
@@ -641,6 +643,16 @@ private void addSecondaryDependencies(BundleDescription desc, Set<BundleDescript
641643
}
642644
}
643645

646+
private void addImplicitDependencies(BundleDescription desc, Set<BundleDescription> added,
647+
List<IClasspathEntry> entries) throws CoreException {
648+
for (NameVersionDescriptor entry : DependencyManager.getImplicitDependencies()) {
649+
String id = entry.getId();
650+
if (id != null) {
651+
addExtraModel(desc, added, entries, id);
652+
}
653+
}
654+
}
655+
644656
private void addExtraModel(BundleDescription desc, Set<BundleDescription> added, List<IClasspathEntry> entries,
645657
String pluginId) throws CoreException {
646658
IPluginModelBase model = PluginRegistry.findModel(pluginId);

0 commit comments

Comments
 (0)