Last active
January 5, 2022 06:29
-
-
Save th-deng/2305025adb695aecad19ad02faa72d97 to your computer and use it in GitHub Desktop.
Config JaCoCo report and violation rules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// groovy DSL | |
jacocoTestReport { | |
reports { | |
// 원하는 리포트를 켜고 끌 수 있습니다. | |
html.enabled true | |
xml.enabled false | |
csv.enabled false | |
// 각 리포트 타입 마다 리포트 저장 경로를 설정할 수 있습니다. | |
// html.destination file("$buildDir/jacocoHtml") | |
// xml.destination file("$buildDir/jacoco.xml") | |
} | |
} | |
jacocoTestCoverageVerification { | |
violationRules { | |
rule { | |
element = 'CLASS' | |
limit { | |
counter = 'BRANCH' | |
value = 'COVEREDRATIO' | |
minimum = 0.90 | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// kotlin DSL | |
tasks.jacocoTestReport { | |
reports { | |
// 원하는 리포트를 켜고 끌 수 있습니다. | |
html.isEnabled = true | |
xml.isEnabled = false | |
csv.isEnabled = false | |
// 각 리포트 타입 마다 리포트 저장 경로를 설정할 수 있습니다. | |
// html.destination = file("$buildDir/jacocoHtml") | |
// xml.destination = file("$buildDir/jacoco.xml") | |
} | |
} | |
tasks.jacocoTestCoverageVerification { | |
violationRules { | |
rule { | |
element = "CLASS" | |
limit { | |
counter = "BRANCH" | |
value = "COVEREDRATIO" | |
minimum = "0.90".toBigDecimal() | |
} | |
} | |
} | |
} |
확인해 주셔서 고맙습니다!! 그 사이도 많이 바뀐 것 같군요. 정리해서 한번 업데이트를 해보겠습니다.
고맙습니다. =)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
좋은 글 올려주셔서 감사합니다
따라서 설정하다가 Deprecated 된 내용이 있어 공유합니다
.isEnabled
가 Deprecated 되었습니다 (저는 gradle 7.2 버전에 kotlin DSL 사용하고 있습니다)로 사용하면 됩니다
Deprecated 내용입니다
getRequired()를 사용해달라고 합니다. Gradle 8.0에서는 없어진다고 합니다.