Skip to content

Commit

Permalink
chore: JaCoCo 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
ymkim97 committed Dec 25, 2024
1 parent 852eef1 commit ec86fe9
Showing 1 changed file with 84 additions and 24 deletions.
108 changes: 84 additions & 24 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,112 @@ plugins {
id 'org.ec4j.editorconfig' version "0.1.0"
id "org.sonarqube" version "6.0.1.5171"
id 'checkstyle'
id 'jacoco'
}

group = 'com.TnT'
version = '0.0.1-SNAPSHOT'
jar.enabled = false

java {
sourceCompatibility = '21'
}

compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'

configurations {
all {
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
}

compileOnly {
extendsFrom annotationProcessor
}
}

repositories {
mavenCentral()
}


sonar {
properties {
property "sonar.projectKey", "YAPP-Github_25th-App-Team-2-BE"
property "sonar.organization", "yapp-github"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.coverage.jacoco.xmlReportPaths", "build/reports/jacoco/test/jacocoTestReport.xml"
}
}

checkstyle {
toolVersion = "10.4"
maxWarnings = 0
configFile = file("${rootDir}/config/naver-checkstyle-rules.xml")
configProperties = ["suppressionFile": "${rootDir}/config/naver-checkstyle-suppressions.xml"]
toolVersion = "8.42"
}

check.dependsOn editorconfigCheck

group = 'com.TnT'
version = '0.0.1-SNAPSHOT'
jar.enabled = false
jacoco {
toolVersion = "0.8.12"
}

java {
sourceCompatibility = '21'
test {
useJUnitPlatform()
finalizedBy 'jacocoTestReport'
}

configurations {
all {
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
jacocoTestReport {
dependsOn test

reports {
xml.required = true
html.required = true
}

compileOnly {
extendsFrom annotationProcessor
afterEvaluate {
classDirectories.setFrom(
files(classDirectories.files.collect {
fileTree(dir: it, excludes: [
"**/*Application*.class",
"**/*Config*.class",
])
})
)
}

finalizedBy 'jacocoTestCoverageVerification'
}

repositories {
mavenCentral()
jacocoTestCoverageVerification {
violationRules {
rule {
enabled = true
element = 'CLASS'

limit {
counter = 'LINE'
value = 'COVEREDRATIO'
minimum = 0.80
}

limit {
counter = 'METHOD'
value = 'COVEREDRATIO'
minimum = 0.80
}

excludes = [
'*.*Application',
'*.*Config'
]
}
}
}

editorconfig {
excludes = ['build']
}

dependencies {
Expand All @@ -61,7 +128,7 @@ dependencies {
implementation 'org.json:json:20231013'
implementation 'org.bouncycastle:bcprov-jdk18on:1.79'

// 레디스
// Redis
implementation 'org.springframework.boot:spring-boot-starter-data-redis'

// Log4j2
Expand All @@ -70,19 +137,12 @@ dependencies {
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.18.2'
implementation 'com.lmax:disruptor:4.0.0'

// Lombok
annotationProcessor 'org.projectlombok:lombok'

compileOnly 'org.projectlombok:lombok'

// MySQL
runtimeOnly 'com.mysql:mysql-connector-j'

testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

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

editorconfig {
excludes = ['build']
}

0 comments on commit ec86fe9

Please sign in to comment.