AndroidCoverageCheck is Gradle plugin to check JaCoCo coverage reports.
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
- androidCovrageCheck - Check JaCoCo coverage reports.
./gradlew createDebugCoverageReport androidCoverageCheck
./gradlew androidCoverageCheck
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
}
MIT