Created
August 13, 2015 04:12
-
-
Save shiraji/f701431a438112c4a4e7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
repositories { | |
mavenCentral() | |
} | |
apply plugin: 'jacoco' | |
// Specify latest jacoco, else use default | |
jacoco { | |
version '0.7.5.201505241946' | |
} | |
task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest']) { | |
group = 'Reporting' | |
description = 'Generate Jacoco coverage reports after running tests.' | |
reports { | |
xml { | |
enabled true // coveralls | |
destination "${project.buildDir}/reports/jacoco/test/jacocoTestReport.xml" | |
} | |
html { | |
enabled true | |
destination "${project.buildDir}/reports/jacoco/test/html" | |
} | |
} | |
// use hidden configuration, for details look into JacocoPlugin.groovy | |
jacocoClasspath = project.configurations['androidJacocoAnt'] | |
// exclude auto-generated classes and tests | |
def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', | |
'android/**/*.*'] | |
def debugTree = fileTree(dir: "${project.buildDir}/intermediates/classes/debug", excludes: fileFilter) | |
def mainSrc = "${project.projectDir}/src/main/java" | |
sourceDirectories = files([mainSrc]) | |
classDirectories = files([debugTree]) | |
executionData = fileTree(dir: project.projectDir, includes: ['**/*.exec', '**/*.ec']) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Code from AndroidGradleTemplate