Skip to content

shikato/gradle-android-coverage-check

Repository files navigation

gradle-android-coverage-check

AndroidCoverageCheck is Gradle plugin to check JaCoCo coverage reports.

2016-07-31 21 10 03

Getting started

build.gradle

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

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

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

Usage

Task

  • androidCovrageCheck - Check JaCoCo coverage reports.

e.g.

Create coverage reports & check
./gradlew createDebugCoverageReport androidCoverageCheck  

cf. createDebugCoverageReport

Check coverage reports only
./gradlew androidCoverageCheck  

Options

build.gradle

// to exclude files
// Default: []
String[] excludeFiles = ["**/*Activity.java",
                         "**/*Fragment.java",
                         "package/name/**/Shikato2.java"];

// paths of coverage reports 
// Default: ["**/coverage/**/report.xml"]
String[] reportXmlPath = ["hoge/fuga/**/report.xml"];

androidCoverageCheck {
    // Set excludeFiles variable
    excludes excludeFiles
    
    // Set reportXmlPath variable
    reportXml reportXmlPath

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

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

    // If the threshold cannot be met, this option will cause the build to fail.
    // Default: true
    isBuildFailure false
}

Other documents

Qiita

License

MIT

About

AndroidCoverageCheck is Gradle plugin to check JaCoCo coverage reports.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages