Skip to content

Commit e23a28e

Browse files
Add getAdditionalEntries to IClasspathContributor
Adds a new method to allow classpath contributor to append additional classpath entries at the end of the calculation process.
1 parent 3993065 commit e23a28e

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

ui/org.eclipse.pde.core/src/org/eclipse/pde/core/IClasspathContributor.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,24 @@ public interface IClasspathContributor {
6868
* @return additional classpath entries to add to the project, possibly empty, must not be <code>null</code>
6969
*/
7070
List<IClasspathEntry> getEntriesForDependency(BundleDescription project, BundleDescription addedDependency);
71+
72+
/**
73+
* Get any additional classpath entries to add to a project when its
74+
* classpath is first computed. The provided {@link BundleDescription}
75+
* describes the plug-in project that the classpath is being computed for.
76+
* The entries are added at the end of the calculation process. Additional
77+
* PDE model information can be obtained using
78+
* {@link PluginRegistry#findModel(Resource)}.
79+
*
80+
* @param project
81+
* the bundle descriptor for the plug-in project having its
82+
* classpath computed
83+
* @return additional classpath entries to add to the project at the end of
84+
* the classpath calculation, possibly empty, must not be
85+
* <code>null</code>
86+
* @since 3.21
87+
*/
88+
default List<IClasspathEntry> getAdditionalEntries(BundleDescription project) {
89+
return List.of();
90+
}
7191
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,10 @@ private List<IClasspathEntry> computePluginEntriesByModel() {
276276

277277
addJunit5RuntimeDependencies(added, entries);
278278

279+
// Add any additional library entries contributed via classpath
280+
// contributor
281+
getClasspathContributors().forEach(cc -> entries.addAll(cc.getAdditionalEntries(desc)));
282+
279283
} catch (CoreException e) {
280284
}
281285
return entries;

0 commit comments

Comments
 (0)