From cbb1784f5e195cda07adbe6f43b3956d98ec4081 Mon Sep 17 00:00:00 2001 From: LamGC Date: Fri, 20 Aug 2021 02:35:15 +0800 Subject: [PATCH] =?UTF-8?q?build:=20=E6=B7=BB=E5=8A=A0=20Jacoco=20?= =?UTF-8?q?=E6=8F=92=E4=BB=B6,=20=E4=BB=A5=E5=88=86=E6=9E=90=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E8=A6=86=E7=9B=96=E7=8E=87.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 以后有用, 目前先配置好先. --- build.gradle | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/build.gradle b/build.gradle index 4879e99..d202045 100644 --- a/build.gradle +++ b/build.gradle @@ -2,6 +2,7 @@ plugins { id 'java' id 'org.springframework.boot' version '2.5.3' id 'io.spring.dependency-management' version '1.0.11.RELEASE' + id 'jacoco' } group 'net.lamgc.oracle' @@ -43,8 +44,26 @@ dependencies { test { useJUnitPlatform() + jacoco { + classDumpDir = file("$buildDir/jacoco/classpathDumps") + } } javadoc { 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/") + } +}