Last active
November 10, 2017 14:42
-
-
Save josomers/9f90b017e321c54bb918 to your computer and use it in GitHub Desktop.
Test coverage with Jacoco on Android gradle project with injection frameworks like Dagger/Butterknife and Robolectric 2.3
This file contains 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
apply plugin: 'jacoco' | |
apply plugin: 'idea' | |
jacoco { | |
toolVersion = "0.7.0.201403182114" | |
} | |
jacocoTestReport { | |
reports { | |
xml.enabled = true | |
html.enabled = true | |
} | |
classDirectories = fileTree( | |
dir: '../my-project/build/intermediates/classes/debug', | |
exclude: [ | |
'**/R*.class', | |
'**/BuildConfig*', | |
'**/*$*.class', | |
'**/*$*.java'] | |
) | |
additionalSourceDirs = files([ | |
'../my-project/src/main/java', | |
'../my-project/build/generated/source/buildConfig/debug', | |
'../my-project/build/generated/source/r/debug']) | |
executionData = files('build/jacoco/testDebug.exec') | |
} | |
idea { | |
module { | |
testOutputDir = file('build/outputs/test-classes/debug') | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment