From 0119e791132f3edeb43e5f7d9317020616e6b925 Mon Sep 17 00:00:00 2001 From: Gabor Bata Date: Tue, 8 Nov 2022 11:10:29 +0100 Subject: [PATCH] Added jacoco coverage check --- build.gradle | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/build.gradle b/build.gradle index 53b1da95..20ab834b 100644 --- a/build.gradle +++ b/build.gradle @@ -3,6 +3,7 @@ plugins { id 'distribution' id 'org.gradle.crypto.checksum' version '1.4.0' id 'checkstyle' + id 'jacoco' } compileJava.options.encoding = 'UTF-8' @@ -72,6 +73,44 @@ task bumpVersion { } } +jacocoTestCoverageVerification { + violationRules { + rule { + element = 'PACKAGE' + limit { + counter = 'LINE' + value = 'COVEREDRATIO' + minimum = 0.8 + } + includes = [ + 'jpass.data', + 'jpass.crypt', + 'jpass.crypt.io', + 'jpass.io', + 'jpass.xml.converter', + 'jpass.xml.bind' + ] + } + + rule { + element = 'PACKAGE' + limit { + counter = 'LINE' + value = 'COVEREDRATIO' + minimum = 0.4 + } + includes = [ + 'jpass.util' + ] + } + } +} + distTar.enabled = false distZip.finalizedBy(createChecksum) assembleDist.dependsOn copyConfig + +test.finalizedBy jacocoTestReport +jacocoTestReport.dependsOn test +jacocoTestCoverageVerification.dependsOn jacocoTestReport +check.dependsOn jacocoTestCoverageVerification