Skip to content

Commit

Permalink
Add Jacoco coverage plugin in build.gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilianna Papastefanou committed Oct 13, 2020
1 parent 1b43d80 commit 26b5b8a
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id 'java'
id 'jacoco'
}

group 'com.ordestiny'
Expand All @@ -22,6 +23,30 @@ dependencies {
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.17.2'
}

jacoco {
toolVersion = "0.8.5"
reportsDir = file("$buildDir/customJacocoReportDir")
}

jacocoTestCoverageVerification {
violationRules {
rule {
element = 'CLASS'
limit {
counter = 'LINE'
value = 'COVEREDRATIO'
minimum = 0.9
}
excludes = [
'io.reflectoring.coverage.part.PartlyCovered',
'io.reflectoring.coverage.ignored.*',
'io.reflectoring.coverage.part.NotCovered'
]
}
}
}


test {
useJUnitPlatform()
}
}

0 comments on commit 26b5b8a

Please sign in to comment.