From 6086836f63685ce727d8a288926fed264e9d1c66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Brey=20Vilas?= Date: Wed, 6 Oct 2021 12:35:51 +0200 Subject: [PATCH] Force JaCoCo version 0.8.7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes crashes with Kotlin 1.5 + Android Gradle Plugin 7.x Signed-off-by: Álvaro Brey Vilas --- build.gradle | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index a074fe176a..1fe36c7bc6 100644 --- a/build.gradle +++ b/build.gradle @@ -10,6 +10,7 @@ import org.gradle.internal.jvm.Jvm buildscript { ext.kotlin_version = '1.5.31' + ext.jacoco_version = '0.8.7' repositories { google() maven { @@ -25,6 +26,9 @@ buildscript { classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.18.1" classpath "commons-httpclient:commons-httpclient:3.1@jar" // remove after entire switch to lib v2 classpath 'com.karumi:shot:5.11.2' + classpath "org.jacoco:org.jacoco.core:$jacoco_version" + classpath "org.jacoco:org.jacoco.report:$jacoco_version" + classpath "org.jacoco:org.jacoco.agent:$jacoco_version" } } @@ -379,6 +383,11 @@ configurations.all { resolutionStrategy{ cacheChangingModulesFor 0, 'seconds' force 'org.objenesis:objenesis:2.6' + eachDependency { details -> + if ('org.jacoco' == details.requested.group) { + details.useVersion "$jacoco_version" + } + } } } @@ -398,6 +407,8 @@ android.applicationVariants.all { variant -> tasks.register("combinedTestReport", JacocoReport) { + jacocoClasspath = configurations['jacocoAnt'] + reports { xml.enabled true html.enabled true @@ -449,5 +460,5 @@ shot { } jacoco { - toolVersion = "0.8.7" + toolVersion = "$jacoco_version" }