Gradle plugin that generates JaCoCo reports from an Android Gradle Project. It goes over every subproject and creates the jacocoReport
task. If you want an aggregated report from all subprojects use the jacocoFullReport
task.
Works with the latest Gradle Android Tools version 1.3.1. This plugin is compiled using Java 8 hence you also need Java 8 in order to use it.
root/build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.vanniktech:gradle-android-junit-jacoco-plugin:0.2.0'
}
}
apply plugin: 'com.vanniktech.android.junit.jacoco'
Information: This plugin is also available on Gradle plugins
Can be found here. Current one is:
classpath 'com.vanniktech:gradle-android-junit-jacoco-plugin:0.2.1-SNAPSHOT'
./gradlew jacocoReport
XML reports
<subproject>/build/reports/jacoco/jacoco.xml
HTML reports
<subproject>/build/reports/jacoco/index.html
Exec files
<subproject>/build/jacoco/testDebugUnitTest.exec
<subproject>/build/jacoco/testReleaseUnitTest.exec
./gradlew jacocoFullReport
XML reports
<root>/build/reports/jacoco/full/jacoco.xml
HTML reports
<root>/build/reports/jacoco/full/index.html
Copyright (C) 2015 Vanniktech - Niklas Baudy
Licensed under the Apache License, Version 2.0