From 068f10ace22168b57602d33d664aa3f92d45ec44 Mon Sep 17 00:00:00 2001 From: Arnaud Roland Date: Thu, 4 Jul 2024 16:21:10 +0200 Subject: [PATCH] all: fix jacoco --- hms-plugin/build.gradle | 6 ++++++ hms-plugin/jacoco.gradle | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/hms-plugin/build.gradle b/hms-plugin/build.gradle index 3d02fae..43d9e3d 100644 --- a/hms-plugin/build.gradle +++ b/hms-plugin/build.gradle @@ -35,6 +35,12 @@ android { } } } + unitTests.all { + jacoco { + includeNoLocationClasses = true + excludes = ['jdk.internal.*'] + } + } } } diff --git a/hms-plugin/jacoco.gradle b/hms-plugin/jacoco.gradle index 3a0c0d7..63d3146 100644 --- a/hms-plugin/jacoco.gradle +++ b/hms-plugin/jacoco.gradle @@ -43,7 +43,7 @@ task testDebugCoverageUnitTest(dependsOn: ['instrument', 'testDebugUnitTest']) { structure(name: 'HmsCoverage') { classfiles { fileset( - dir: "$buildDir/intermediates/javac/debug/classes", + dir: "$buildDir/intermediates/javac/debug/compileDebugJavaWithJavac/classes", excludes: '**/R.class,**/R$*.class,**/BuildConfig.*' ) } @@ -83,7 +83,7 @@ task instrument(dependsOn:'compileDebugUnitTestSources') { classpath: configurations.jacocoAnt.asPath) ant.instrument(destdir: offline_instrumented_outputDir) { - fileset(dir: "$buildDir.path/intermediates/javac/debug/classes") + fileset(dir: "$buildDir.path/intermediates/javac/debug/compileDebugJavaWithJavac/classes") } } -} \ No newline at end of file +}