diff --git a/build.gradle b/build.gradle index 710c0543..96458eb2 100644 --- a/build.gradle +++ b/build.gradle @@ -115,12 +115,47 @@ sonarqube { property "sonar.java.checkstyle.reportPaths", "build/reports/checkstyle/main.xml" } } + +jacoco { + toolVersion = '0.8.12' +} + +tasks.named('test') { + useJUnitPlatform() + + finalizedBy jacocoTestReport +} + //sonarCloud testCoverage jacocoTestReport { + dependsOn test reports { + html.required = true xml.required = true } + + def QDomains = [] + + for (qPattern in '**/QA'..'**/QZ') { + QDomains.add(qPattern + '*') + } + + afterEvaluate { + classDirectories.setFrom( + files(classDirectories.files.collect { + fileTree(dir: it, excludes: [ + "com.project.bumawiki.BumawikiApplication", + "**.*Config*", + "**.*Exception*", + "**.*Dto*" + ] + QDomains) + }) + ) + } + + finalizedBy jacocoTestCoverageVerification } + //plain jar λΉ„ν™œμ„±ν™” jar { enabled = false