mirror of
https://github.com/k0shk0sh/FastHub.git
synced 2025-12-08 19:05:54 +00:00
41 lines
1.1 KiB
Groovy
41 lines
1.1 KiB
Groovy
apply plugin: "jacoco"
|
|
|
|
jacoco {
|
|
// see https://github.com/jacoco/jacoco/pull/288 and the top build.gradle
|
|
toolVersion "0.7.6.201602180812"
|
|
}
|
|
|
|
android {
|
|
testOptions {
|
|
unitTests.all {
|
|
systemProperty "robolectric.logging.enabled", true
|
|
systemProperty "robolectric.logging", "stdout"
|
|
|
|
jacoco {
|
|
includeNoLocationClasses = true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// ignore these when generating coverage
|
|
def ignoredPrefixes = ['R$', 'R.class', 'BuildConfig.class']
|
|
|
|
task coverage(type: JacocoReport, dependsOn: ["testDebugUnitTest"]) {
|
|
group = "Reports"
|
|
description = "Generate a coverage report"
|
|
|
|
classDirectories = fileTree(
|
|
dir: "${project.buildDir}/intermediates/classes/debug/com/firebase/",
|
|
exclude: { d -> ignoredPrefixes.any { p -> d.file.name.startsWith(p) } }
|
|
)
|
|
sourceDirectories = files(["src/main/java/com/firebase/"])
|
|
executionData = files("${project.buildDir}/jacoco/testDebugUnitTest.exec")
|
|
|
|
reports {
|
|
xml.enabled = true
|
|
html.enabled = true
|
|
html.destination "${buildDir}/coverage_html"
|
|
}
|
|
}
|