Package com.arc_e_tect.gradle.jacoco
Class JacocoExclusionReportExtension
java.lang.Object
com.arc_e_tect.gradle.jacoco.JacocoExclusionReportExtension
DSL extension for the JaCoCo exclusion report plugin.
jacocoExclusionReport {
annotationName = 'ExcludeFromJacocoGeneratedCodeCoverage' // default
sourceDirs.from(sourceSets.main.java.srcDirs) // default
reportDir = layout.buildDirectory.dir('reports/jacoco-exclusions') // default
includeConfiguredExclusions = true // default
includeGeneratedAnnotationExclusions = false // default (opt-in)
}
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFor use by the Gradle-generated concrete subclass. -
Method Summary
Modifier and TypeMethodDescriptionabstract org.gradle.api.provider.Property<String> Simple (unqualified) name of the exclusion annotation.abstract org.gradle.api.provider.Property<Boolean> Whether exclusions configured through JaCoCo task DSL should be reported in a separate report file in addition to annotation-based exclusions.abstract org.gradle.api.provider.Property<Boolean> Whether to additionally scan compiled classes for members that JaCoCo automatically excludes because they carry an annotation whose simple name isGeneratedbut that was not written by hand — e.g.abstract org.gradle.api.file.DirectoryPropertyDirectory where the HTML and XML reports are written.abstract org.gradle.api.file.ConfigurableFileCollectionJava source directories to scan.
-
Field Details
-
NAME
Extension DSL block name, i.e. the name used to register the extension with the project.- See Also:
-
DEFAULT_ANNOTATION
Default simple name of the annotation scanned for exclusions.- See Also:
-
-
Constructor Details
-
JacocoExclusionReportExtension
public JacocoExclusionReportExtension()For use by the Gradle-generated concrete subclass.
-
-
Method Details
-
getAnnotationName
Simple (unqualified) name of the exclusion annotation.- Returns:
- mutable property holding the annotation simple name
-
getSourceDirs
public abstract org.gradle.api.file.ConfigurableFileCollection getSourceDirs()Java source directories to scan.- Returns:
- mutable file collection of source directories
-
getReportDir
public abstract org.gradle.api.file.DirectoryProperty getReportDir()Directory where the HTML and XML reports are written.- Returns:
- mutable directory property for the report output location
-
getIncludeConfiguredExclusions
Whether exclusions configured through JaCoCo task DSL should be reported in a separate report file in addition to annotation-based exclusions.- Returns:
- mutable flag controlling JaCoCo DSL exclusion reporting
-
getIncludeGeneratedAnnotationExclusions
Whether to additionally scan compiled classes for members that JaCoCo automatically excludes because they carry an annotation whose simple name isGeneratedbut that was not written by hand — e.g. Lombok's@lombok.Generated, which Lombok stamps onto every getter, setter, constructor, and other member it synthesises. These members never appear in the.javasource, so they can only be found by inspecting the compiled.classfiles.Disabled by default: it only takes effect when set to
trueexplicitly in thejacocoExclusionReportDSL block.- Returns:
- mutable flag controlling tool-generated
@Generatedexclusion reporting
-