JaCoCo Gradle Plugin

Maven parent project for OSS publishment

License

License

Categories

Categories

Gradle Build Tools JaCoCo Application Testing & Monitoring Code Coverage
GroupId

GroupId

com.sdklite.jacoco
ArtifactId

ArtifactId

gradle
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

JaCoCo Gradle Plugin
Maven parent project for OSS publishment
Project Organization

Project Organization

SDKLite

Download gradle

How to add to project

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

Dependencies

provided (3)

Group / Artifact Type Version
org.codehaus.groovy : groovy-all jar 2.4.4
org.gradle » gradle-api jar 2.14.1
com.android.tools.build : gradle jar 1.5.0

test (4)

Group / Artifact Type Version
junit : junit jar 4.12
org.robolectric : robolectric jar 3.0
org.robolectric : android-all jar 5.0.0_r2-robolectric-1
org.hamcrest : hamcrest-library jar 1.3

Project Modules

There are no modules declared in this project.

Introduction

JaCoCo gradle plugin is used to generate code coverage reports for Android project, it creates JaCoCoReport task for the variants which buildType.testCoverageEnabled is true.

Getting Started

  1. Config JaCoCo gradle plugin in build.gradle of root project.

    buildscript {
        repositories {
            ...
            jcenter()
        }
        dependencies {
            ...
            classpath 'com.sdklite.jacoco:gradle:0.1.0'
        }
    }
  2. Apply JaCoCo gradle plugin in build.gradle of android project

    apply plugin: 'com.sdklite.jacoco'
    
    android {
        ...
        buildTypes {
            debug {
                ...
                testCoverageEnabled true
            }
            ...
        }
    }
    
    jacocoUnitTestReport {
        csv.enabled false
        xml.enabled false
        html.enabled true
    }

    The plugin excludes Android generated classes from report by default. You can specify custom exclusion patterns by jacocoUnitTestReport:

    jacocoUnitTestReport {
        ...
        excludes += [
            '**/AutoValue_*.*',
            ...
        ]
    }
  3. Generate coverage report

    $ ./gradlew jacocoTestReport

Example

com.sdklite.jacoco

SDKLite

SDKLite

Versions

Version
0.1.0