Skip to content

Commit

Permalink
feat: jacoco 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
smartandhandsome committed Nov 30, 2023
1 parent a77029f commit 19f79ab
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
64 changes: 64 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ plugins {
id 'io.spring.dependency-management' version '1.1.3'
id 'com.epages.restdocs-api-spec' version "${restdocsApiSpecVersion}"
id 'org.hidetake.swagger.generator' version '2.18.2'
id 'jacoco'
}

group = 'coffee-meet'
Expand All @@ -21,6 +22,68 @@ java {
sourceCompatibility = '17'
}

jacoco {
toolVersion = "0.8.8"
}

jacocoTestReport {
reports {
xml.required = false
csv.required = false
}

def Qdomains = []
for (qPattern in '**/QA'..'**/QZ') {
Qdomains.add(qPattern + '*')
}

afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, excludes: [
'**/common/config/**',
'**/common/presentation/advice/**',
'**/common/presentation/interceptor/**',
'**/common/presentation/resolver/**',
'**/common/domain/**',
'**/common/annotation/**',
'**/exception/**',
'**/dto/**',
'**/oauth/config/**'
] + Qdomains)
}))
}

finalizedBy 'jacocoTestCoverageVerification'
}

jacocoTestCoverageVerification {
violationRules {
rule {
enabled = true
element = 'CLASS'

limit {
counter = 'LINE'
value = 'COVEREDRATIO'
//minimum = 0.7
}

excludes = [
'*.common.config.*',
'*.common.presentation.advice.*',
'*.common.presentation.interceptor.*',
'*.common.presentation.resolver.*',
'*.common.domain.*',
'*.common.annotation.*',
'*.exception.*',
'*.oauth.config.*',
'*.dto.*',
'*.*Application'
]
}
}
}

configurations {
compileOnly {
extendsFrom annotationProcessor
Expand Down Expand Up @@ -91,6 +154,7 @@ dependencies {

tasks.named('test') {
useJUnitPlatform()
finalizedBy jacocoTestReport
}

swaggerSources {
Expand Down
1 change: 1 addition & 0 deletions lombok.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lombok.addLombokGeneratedAnnotation = true

0 comments on commit 19f79ab

Please sign in to comment.