Skip to content

Instantly share code, notes, and snippets.

View ahmed-basyouni's full-sized avatar
💭
I may be slow to respond.

Ahmed basyouni ahmed-basyouni

💭
I may be slow to respond.
View GitHub Profile
@ahmed-basyouni
ahmed-basyouni / JacocoTestReport
Last active January 3, 2018 10:51
A gradle task that can ignore certain packages from test coverage such as models
// packages to exclude for example generated classes, R class and models package, add all packages that you wish to exclude from test coverage
def fileFilter = [
'**/models/**',
'**/*$ViewInjector*.*','**/*$ViewBinder*.*',
'**/R.class', '**/R$*.class', '**/BuildConfig.*',
'**/Manifest*.*', '**/*Test*.*', 'android/**/*.*']
def debugTree = fileTree(dir: "${buildDir}/intermediates/classes/debug", excludes: fileFilter)
def mainSrc = "${project.projectDir}/src/main/java"
// override jacocTestReport task