Show implied plugin dependencies (#5472)

Co-authored-by: Daniel Beck <1831569+daniel-beck@users.noreply.github.com>
This commit is contained in:
Tobias GruetzmacherandDaniel Beck authored and GitHub committed 2021-05-25 20:57:19 +01:00
1 parent ed5aa55737
commit 4fc0d5a085
4 files changed
+70 -46

No files matched your search

@@ -1070,6 +1070,27 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject {
return false;
}
/**
* Get list of implied dependencies.
* @since TODO
*/
@Restricted(NoExternalUse.class)
public @NonNull Set<String> getImpliedDependents() {
if (!isDetached()) {
return Collections.emptySet();
}
Set<String> implied = new HashSet<>();
for (PluginWrapper p : Jenkins.get().getPluginManager().getPlugins()) {
for (Dependency dependency : DetachedPluginsUtil.getImpliedDependencies(p.shortName, p.getRequiredCoreVersion())) {
if (dependency.shortName.equals(shortName)) {
implied.add(p.shortName);
}
}
}
return implied;
}
/**
* Sort by short name.
*/