AndroidCoverageCheck is Gradle plugin to check JaCoCo coverage reports.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
gradle/wrapper
repository/org/shikato/gradle/android/coverage/check/android-coverage-check
src
.gitignore
.travis.yml
LICENSE
README.md
build.gradle
gradlew
gradlew.bat
settings.gradle

README.md

gradle-android-coverage-check

AndroidCoverageCheck is Gradle plugin to check JaCoCo coverage reports.

2016-07-31 21 10 03

Download

build.gradle

Build script snippet for use in all Gradle versions:

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "gradle.plugin.org.shikato.gradle.android.coverage.check:gradle-android-coverage-check:0.0.9"
  }
}

apply plugin: "org.shikato.gradle.android.coverage.check"

https://plugins.gradle.org/plugin/org.shikato.gradle.android.coverage.check

Usage

Task

  • androidCovrageCheck - Check JaCoCo coverage reports.

Examples

Create coverage reports & check

Only at the time of "org.gradle.parallel=false".

./gradlew createDebugCoverageReport androidCoverageCheck  
Only check

If report.xml already exists.

./gradlew androidCoverageCheck  

Options

build.gradle

// Excluded targets
// Default: []
String[] excludeFiles = ["**/*Activity.java",
                         "**/*Fragment.java",
                         "package/name/**/Shikato2.java"];

// Coverage reports path
// If reports are plural, The task each checks.
// Default: ["**/coverage/**/report.xml"]
String[] reportXmlPath = ["hoge/fuga/**/report.xml"];

androidCoverageCheck {
    // If there are unsatisfied coverages, this option will make a build failure.
    // Default: true
    isBuildFailure false

    // Minimum threshold of INSTRUCTION
    // Default: 20
    instruction 50

    // Minimum threshold of BRANCH
    // Default: 20
    branch 50

    // Set excluded targets
    excludes excludeFiles
    // Set coverage report path
    reportXml reportXmlPath
}

Other documents

Qiita

License

MIT