Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Shared Java annotations and utilities for _Software Engineering Done Right_ proj

|`ExcludeFromJacocoGeneratedCodeCoverage`
|`com.arc_e_tect.sedr.utils.jacoco.marker`
|Marker annotation to exclude constructors, methods, or types from JaCoCo code-coverage measurement.
|Marker annotation to document constructors, methods, or types that should be treated as excluded from JaCoCo code-coverage measurement, with an ArchUnit rule that enforces a justification.
|===

=== Adding the dependency
Expand Down Expand Up @@ -146,6 +146,7 @@ In GitHub Actions, `GITHUB_ACTOR` and `GITHUB_TOKEN` are injected automatically

The library ships a `test-fixtures` artifact that contains the reusable ArchUnit rule `AbstractCoverageExclusionConventionsTest`.
It verifies that every use of `@ExcludeFromJacocoGeneratedCodeCoverage` in your production code carries a non-blank `justification`.
The Gradle builds in this repository use Gradle's native JaCoCo support, with the JaCoCo tool version managed through `refreshVersions` in each build.

==== Add the test-fixtures dependency

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
plugins {
id 'jacoco'
id 'java'
alias(libs.plugins.architecture.validator.iff)
}
Expand All @@ -24,4 +25,11 @@ dependencies {
architectureValidator {
basePackage = 'com.arc_e_tect.example.spring'
ignoreFailures = true
}

tasks.named('jacocoTestReport') {
reports {
xml.required = true
html.required = true
}
}
8 changes: 8 additions & 0 deletions examples/sedr-library/jacoco-marker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* ./gradlew test
*/
plugins {
id 'jacoco'
id 'java'
}

Expand Down Expand Up @@ -37,3 +38,10 @@ dependencies {
test {
useJUnitPlatform()
}

tasks.named('jacocoTestReport') {
reports {
xml.required = true
html.required = true
}
}
11 changes: 11 additions & 0 deletions hexagonal-spring-rules/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* gh CLI), or 1.0.0-PRERELEASE as fallback.
*/
plugins {
id 'jacoco'
id 'java-library'
id 'maven-publish'
alias(libs.plugins.owasp.dependency.check.iff)
Expand Down Expand Up @@ -68,6 +69,9 @@ java {
withSourcesJar()
}

jacoco {
}

repositories {
mavenCentral()
}
Expand Down Expand Up @@ -179,4 +183,11 @@ tasks.withType(Javadoc).configureEach {
options.links('https://docs.oracle.com/javase/21/docs/api/')
options.docTitle = "Architecture Validator Spring Rules API"
options.windowTitle = "Spring Hexagonal Architecture Rules (${project.version})"
}

tasks.named('jacocoTestReport') {
reports {
xml.required = true
html.required = true
}
}
11 changes: 11 additions & 0 deletions sedr-library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Publish: ./gradlew publishToMavenLocal
*/
plugins {
id 'jacoco'
id 'java-library'
id 'java-test-fixtures'
id 'maven-publish'
Expand Down Expand Up @@ -56,6 +57,9 @@ java {
withSourcesJar()
}

jacoco {
}

repositories {
mavenCentral()
}
Expand Down Expand Up @@ -139,3 +143,10 @@ jreleaser {
}
}
}

tasks.named('jacocoTestReport') {
reports {
xml.required = true
html.required = true
}
}
Loading