From 7ad1df97c085e19e6d4af4d5807f40e9e4ab5458 Mon Sep 17 00:00:00 2001 From: soloturn Date: Sun, 26 Jul 2020 19:41:16 +0200 Subject: [PATCH] gradle, produce jacoco coverage report, html --- build.gradle.kts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index 82b02113..d844c0ea 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,5 @@ plugins { + id("jacoco") id("java") id("maven-publish") } @@ -64,6 +65,7 @@ tasks.test { includeEngines("junit-jupiter") includeEngines("junit-vintage") } + finalizedBy(tasks.jacocoTestReport) // report is always generated after tests run } // make all archive tasks in the build reproducible @@ -72,3 +74,12 @@ tasks.withType().configureEach { isReproducibleFileOrder = true } +tasks.jacocoTestReport { + dependsOn(tasks.test) // tests are required to run before generating the report + reports { + xml.isEnabled = false + csv.isEnabled = false + html.destination = file("${buildDir}/jacocoHtml") + } +} +