Package io.pjacoco.gradle
Class PjacocoPlugin
java.lang.Object
io.pjacoco.gradle.PjacocoPlugin
- All Implemented Interfaces:
org.gradle.api.Plugin<org.gradle.api.Project>
Gradle plugin
io.github.beltian.pjacoco. Resolves the pjacoco agent and wires -javaagent
for per-test coverage (convention + escape hatch — see the design spec §5.5):
- creates the
pjacocoextension (PjacocoGradleExtension); - creates a resolvable
pjacocoAgentconfiguration and depends onio.github.beltian.pjacoco:pjacoco-agent:<agentVersion>(the shaded jar); - populates
pjacoco.agentJvmArg/pjacoco.controlUrlArgfor manual wiring; - for each task named in
attachTo, lazily injects the agent AND-Dpjacoco.control-urlinto that JVM (so the testkit activates).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault agent version whenagentVersionis not set. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
DEFAULT_AGENT_VERSION
Default agent version whenagentVersionis not set. Single-sourced from the plugin's OWN version (generated resourceio/pjacoco/gradle/version.properties), so the agent it resolves always matches the plugin release — no hardcoded constant to forget on a version bump (P1-1).
-
-
Constructor Details
-
PjacocoPlugin
public PjacocoPlugin()
-
-
Method Details
-
apply
public void apply(org.gradle.api.Project project) - Specified by:
applyin interfaceorg.gradle.api.Plugin<org.gradle.api.Project>
-