JacocoEverywhere Gradle plugin

Gradle plugin which allows to generate Jacoco coverage report for both integration & unit tests

License

License

Categories

Categories

JaCoCo Application Testing & Monitoring Code Coverage
GroupId

GroupId

com.trickyandroid
ArtifactId

ArtifactId

jacoco-everywhere
Last Version

Last Version

0.2.1
Release Date

Release Date

Type

Type

jar
Description

Description

JacocoEverywhere Gradle plugin
Gradle plugin which allows to generate Jacoco coverage report for both integration & unit tests
Project URL

Project URL

https://github.com/paveldudka/JacocoEverywhere
Source Code Management

Source Code Management

https://github.com/paveldudka/JacocoEverywhere.git

Download jacoco-everywhere

How to add to project

<!-- https://jarcasting.com/artifacts/com.trickyandroid/jacoco-everywhere/ -->
<dependency>
    <groupId>com.trickyandroid</groupId>
    <artifactId>jacoco-everywhere</artifactId>
    <version>0.2.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.trickyandroid/jacoco-everywhere/
implementation 'com.trickyandroid:jacoco-everywhere:0.2.1'
// https://jarcasting.com/artifacts/com.trickyandroid/jacoco-everywhere/
implementation ("com.trickyandroid:jacoco-everywhere:0.2.1")
'com.trickyandroid:jacoco-everywhere:jar:0.2.1'
<dependency org="com.trickyandroid" name="jacoco-everywhere" rev="0.2.1">
  <artifact name="jacoco-everywhere" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.trickyandroid', module='jacoco-everywhere', version='0.2.1')
)
libraryDependencies += "com.trickyandroid" % "jacoco-everywhere" % "0.2.1"
[com.trickyandroid/jacoco-everywhere "0.2.1"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

JacocoEverywhere

Gradle plugin which allows to generate Jacoco coverage report for both integration & unit tests

Warning!

This plugin is not maintained anymore and is deprecated!

Why?

Android plugin has built-in support for generating test coverage report:

android {
    buildTypes {
        debug {
            testCoverageEnabled = true
        }
    }
}

However, this report only shows test coverage for your integration tests (aka UI tests, aka those ones you run with ./gradlew connectedCheck).

But what we really want - is to see test coverage report for both integration AND unit test suites!

jacoco-everywhere plugin does just that!

Usage

  1. Enable code coverage like you normally would for your integration tests:
android {
    buildTypes {
        debug {
            testCoverageEnabled = true
        }
    }
}
  1. Add jacoco-everywhere dependency to Android module buildscript and apply jacoco-everywhere plugin: build.gradle:
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.trickyandroid:jacoco-everywhere:0.2.1'
    }
}

apply plugin: 'com.android.application'
apply plugin: 'jacoco-everywhere'
  1. execute ./gradlew connectedCheck from your command line

  2. Observe Jacoco test coverage report in <your_project_dir>/<android_module>/build/reports/coverage/debug/index.html

Versions

Version
0.2.1
0.2.0
0.1.1
0.1.0