Skip to content

Commit

Permalink
Updated Jacoco config
Browse files Browse the repository at this point in the history
  • Loading branch information
martingrossmann committed Dec 2, 2024
1 parent e7ac741 commit 04c54bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 44 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,13 @@ Every module contains tests that can be run like
gradle test
```

The following optional properties can be set.
Additional test properties are listed in the module's README.

| Property | Description |
|--------------|---------------------------------------|
| `withJacoco` | Enables Jacoco code coverage analysis |
Activate Jacoco code coverage analysis by
```shell
gradle testCodeCoverageReport
```
instead of ``gradle test``

### License report

Expand Down
41 changes: 1 addition & 40 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ plugins {
import com.github.jk1.license.filter.*
import com.github.jk1.license.render.*

def jacocoVersion = "0.8.6"

apply plugin: 'io.codearte.nexus-staging'

ext {
Expand Down Expand Up @@ -50,7 +48,7 @@ subprojects {
archivesBaseName = "testerra"

apply plugin: 'maven-publish' // tasks publish and publishToMavenLocal
apply plugin: 'jacoco'
apply plugin: 'jacoco-report-aggregation'
apply plugin: 'signing'

apply plugin: 'com.github.jk1.dependency-license-report'
Expand All @@ -63,10 +61,6 @@ subprojects {
mavenCentral()
}

jacoco {
toolVersion = jacocoVersion
}

test {

ignoreFailures = true
Expand All @@ -79,12 +73,6 @@ subprojects {
systemProperties(System.getProperties())
}

jacoco {
enabled = System.properties.containsKey("withJacoco")
//excludes = ['jdk.internal.*']
}
}

task cleanDist {
doLast {
delete "out"
Expand Down Expand Up @@ -122,30 +110,3 @@ subprojects {

// Do not move this integration because `group` and `version` is needed for publishing
apply from: rootProject.file('publish.gradle')

task jacocoAggregateReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) {

additionalSourceDirs(files(subprojects.sourceSets.main.allSource.srcDirs))

def srcdirs = files(subprojects.sourceSets.main.allSource.srcDirs)
def classdirs = files(subprojects.sourceSets.main.output)
sourceDirectories.setFrom(srcdirs)
classDirectories.setFrom(classdirs)

executionData(project.fileTree(dir: '.', include: '**/build/jacoco/test.exec'))

reports {
html.enabled = true
xml.enabled = true
csv.enabled = false
}
onlyIf = {
true
}

doFirst {
executionData(files(executionData.findAll {
it.exists()
}))
}
}

0 comments on commit 04c54bf

Please sign in to comment.