build: 添加 Jacoco 插件, 以分析测试覆盖率.

以后有用, 目前先配置好先.
This commit is contained in:
LamGC 2021-08-20 02:35:15 +08:00
parent 616179c00a
commit cbb1784f5e
Signed by: LamGC
GPG Key ID: 6C5AE2A913941E1D

View File

@ -2,6 +2,7 @@ plugins {
id 'java' id 'java'
id 'org.springframework.boot' version '2.5.3' id 'org.springframework.boot' version '2.5.3'
id 'io.spring.dependency-management' version '1.0.11.RELEASE' id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'jacoco'
} }
group 'net.lamgc.oracle' group 'net.lamgc.oracle'
@ -43,8 +44,26 @@ dependencies {
test { test {
useJUnitPlatform() useJUnitPlatform()
jacoco {
classDumpDir = file("$buildDir/jacoco/classpathDumps")
}
} }
javadoc { javadoc {
options.encoding = 'UTF-8' options.encoding = 'UTF-8'
} }
jacoco {
version "0.8.7"
reportsDir file("$buildDir/jacoco/reports")
}
jacocoTestReport {
reports {
xml.enabled true
xml.destination file("$buildDir/jacoco/reports.xml")
html.enabled true
html.destination file("$buildDir/jacoco/reports-html/")
}
}