diff --git a/build.gradle b/build.gradle index a87ac436d..1294eaea5 100644 --- a/build.gradle +++ b/build.gradle @@ -61,6 +61,7 @@ dependencies { tasks.named('test') { useJUnitPlatform() jvmArgs("-XX:+EnableDynamicAgentLoading") + finalizedBy 'jacocoTestReport' } def jacocoDir = layout.buildDirectory.dir("reports/") @@ -71,7 +72,6 @@ for (qPattern in '*.QA'..'*.QZ') { // qPattern = '*.QA', '*.QB', ... '*.QZ' } def jacocoExcludePatterns = [ - // 측정 안하고 싶은 패턴 '**/*Application.class', '**/*Config*', '**/*Exception*', @@ -85,13 +85,30 @@ def jacocoExcludePatterns = [ '**/domains/*', ] +def jacocoExcludePatternsForVerify = [ + '*.*Application*', + '*.*Config*', + '*.*Exception*', + '*.*Request*', + '*.*Response*', + '*.*Entity*', + '*.*Dto*', + '*.jwt.*', + '*.auth.*', + '*.domain.*', + '*.domains.*', +] + jacocoTestReport { dependsOn test reports { - xml.required = true - html.required = true - csv.required = false + html.required.set(true) + xml.required.set(true) + csv.required.set(true) + html.destination jacocoDir.get().file("jacoco/index.html").asFile + xml.destination jacocoDir.get().file("jacoco/index.xml").asFile + csv.destination jacocoDir.get().file("jacoco/index.csv").asFile } afterEvaluate { @@ -122,7 +139,7 @@ jacocoTestCoverageVerification { minimum = 0.60 } - excludes = jacocoExcludePatterns + QDomains + excludes = jacocoExcludePatternsForVerify + QDomains } } } @@ -138,6 +155,6 @@ sonar { property 'sonar.test.exclusions', jacocoExcludePatterns.join(',') property 'sonar.test.inclusions', '**/*Test.java' property 'sonar.java.coveragePlugin', 'jacoco' - property 'sonar.coverage.jacoco.xmlReportPaths', jacocoDir.get().file("tests/test/index.xml").asFile + property 'sonar.coverage.jacoco.xmlReportPaths', jacocoDir.get().file("jacoco/index.xml").asFile } }