Class AppliedPluginCollector
Agent-Docs-aware Gradle plugins applied via the plugins {} block.
Unlike regular dependencies, plugins applied this way aren't resolved onto a project
Configuration — there's no Maven GAV to read off a resolved
component. Instead, each applied Plugin's own class reveals the jar it was loaded from
(via its classloader's code source), which is exactly where publish-side tooling would have
stamped the Agent-Docs manifest attribute (per specification/java-conventions.md)
when embedding docs — the only distribution mode supported for Gradle plugin projects.
The plugin id itself is recovered from the same jar's META-INF/gradle-plugins/*.properties
descriptors (the standard mechanism java-gradle-plugin generates and Gradle itself uses
to resolve id '...' to an implementation class), matched back to the applied class.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordDiscoveredAgent-Docs-aware Gradle plugin, analogous to a declared dependency. -
Method Summary
Modifier and TypeMethodDescriptioncollect(org.gradle.api.plugins.PluginContainer plugins, org.gradle.api.logging.Logger logger) Collects every applied plugin whose own jar carries anAgent-Docsmanifest declaration, resolving each one's plugin id along the way.
-
Method Details
-
collect
public static List<AppliedPluginCollector.DeclaredPlugin> collect(org.gradle.api.plugins.PluginContainer plugins, org.gradle.api.logging.Logger logger) Collects every applied plugin whose own jar carries anAgent-Docsmanifest declaration, resolving each one's plugin id along the way.Plugins without the attribute (essentially every core Gradle plugin, and any third-party plugin that hasn't adopted the convention) are skipped entirely — no different from a regular dependency without the attribute. A non-
classpathscheme (there is no consumer-side resolution path for amavensidecar here, since plugin jars aren't resolved as project dependencies) is skipped with a warning. A jar carrying the attribute whose plugin id can't be determined from its descriptors is skipped with an info-level log, since it's not actionable by the consumer.- Parameters:
plugins- the project's applied pluginslogger- logger for diagnostics- Returns:
- discovered plugins with a usable
classpathdeclaration
-