Skip to content
Permalink
master
Go to file
 
 
Cannot retrieve contributors at this time
45 lines (41 sloc) 1.54 KB
apply plugin: 'jacoco'
ext {
coverageSourceDirs = 'src/test/java'
}
jacoco {
toolVersion = "0.7.5.201505241946"
reportsDir = file("$buildDir/reports")
}
task jacocoTestReport(type:JacocoReport, dependsOn: "testDebugUnitTest") {
group = "Reporting"
description = "Generate Jacoco coverage reports for Debug build"
classDirectories = fileTree(
dir: "$buildDir/intermediates/classes/debug",
excludes: ['**/R.class',
'**/R$*.class',
'**/*$ViewBinder*.*',
'**/*$InjectAdapter*.*',
'**/*Injector*.*',
'**/BuildConfig.*',
'**/Manifest*.*',
'**/*Test*.*',
'**/*Activity*.*',
'**/CiMattersApplication*.*',
'android/**/*.*']
)
if (project.hasProperty("teamcity")) {
println '##teamcity[jacocoReport dataPath=\'app/build/jacoco/testDebugUnitTest.exec\' includes=\'com.vgaidarji.cimatters.*\' excludes=\'com.vgaidarji.cimatters.test.* **/*R*.* **/*Injector*.* **/*Activity*.* .*R .*CiMattersApplication .*BuildConfig .*Activity .*Test \']'
}
reports {
xml.enabled = true
html.enabled = true
}
additionalSourceDirs = files(coverageSourceDirs)
sourceDirectories = files(coverageSourceDirs)
executionData = files("$buildDir/jacoco/testDebugUnitTest.exec")
}
tasks.withType(Test) {
testLogging {
events "passed", "skipped", "failed"
}
}
You can’t perform that action at this time.