From f8f006d41c82cd2652bdcfc432c853e99223992d Mon Sep 17 00:00:00 2001 From: Michael Kaye <1917473+michaelkaye@users.noreply.github.com> Date: Thu, 9 Jun 2022 23:58:04 +0100 Subject: [PATCH] Ignore generated and other template classes. --- coverage.gradle | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/coverage.gradle b/coverage.gradle index fb2352f47f..fc69ce7e90 100644 --- a/coverage.gradle +++ b/coverage.gradle @@ -1,4 +1,26 @@ -def excludes = [ ] +def excludes = [ +// dependency injection graph +'**/*Module.*', +'**/*Module*.*', + +// Framework entry points +'**/*Activity*', +'**/*Fragment*', +'**/*Application*', + +// We would like to exclude android widgets as well but our naming is inconsistent + +// Proof of concept +'**/*Login2*', + +// Generated +'**/*JsonAdapter*', +'**/*Item.*', +'**/*$Holder.*', +'**/*ViewHolder.*', +'**/*View.*', +'**/*BottomSheet.*' +] def initializeReport(report, projects, classExcludes) { projects.each { project -> project.apply plugin: 'jacoco' } @@ -56,8 +78,9 @@ task theCodeCoverageReport(type: JacocoReport) { } def projects = collectProjects { ['vector','matrix-sdk-android'].contains(it.name) } dependsOn { - [':matrix-sdk-android:testDebugUnitTest'] + [':vector:testGplayDebugUnitTest'] + + [':vector:connectedGplayDebugAndroidTest'] + + [':matrix-sdk-android:testDebugUnitTest'] + [':matrix-sdk-android:connectedDebugAndroidTest'] } initializeReport(it, projects, excludes)