From 21536b9151b0566615814d74e0dce39f121923ef Mon Sep 17 00:00:00 2001 From: Yannik Bretschneider Date: Thu, 5 Aug 2021 23:12:24 +0200 Subject: [PATCH] build: added jacoco coverage support --- Server/build.gradle | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Server/build.gradle b/Server/build.gradle index f1ec58d..b996a67 100644 --- a/Server/build.gradle +++ b/Server/build.gradle @@ -2,6 +2,7 @@ plugins { id 'java' id 'idea' id "org.sonarqube" version "3.2.0" + id 'jacoco' } repositories { @@ -15,6 +16,26 @@ test { maxParallelForks = 1 } +jacocoTestReport { + reports { + html.enabled true + xml.enabled true + xml.destination file("${buildDir}/reports/jacoco.xml") + } +} + +plugins.withType(JacocoPlugin) { + tasks["test"].finalizedBy 'jacocoTestReport' +} + +sonarqube { + properties { + property "sonar.java.coveragePlugin", "jacoco" + property "sonar.host.url", "https://sonarqube.yandrik.dev" + property "sonar.coverage.jacoco.xmlReportPath", "${buildDir}/reports/jacoco.xml" + } +} + var mainClassName = "uulm.teamname.marvelous.server.Server" jar {