-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added JaCoCo code coverage reporting
- Loading branch information
Andrei Diaconu
committed
Jun 21, 2017
1 parent
e5c3a3b
commit 5ff5e58
Showing
6 changed files
with
81 additions
and
5 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
apply plugin: 'jacoco' | ||
|
||
task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest', 'createDebugCoverageReport']) { | ||
|
||
reports { | ||
xml.enabled = true | ||
html.enabled = true | ||
} | ||
|
||
def fileFilter = [ | ||
'**/R.class', | ||
'**/R$*.class', | ||
'**/BuildConfig.*', | ||
'**/Manifest*.*', | ||
'**/*Test*.*', | ||
'android/**/*.*', | ||
// Dagger | ||
'**/*Dagger*.*', | ||
'**/*MembersInjector*.*', | ||
'**/*_Factory*.*', | ||
'**/*_Provide*Factory*.*', | ||
//Enums are terrible | ||
'**/ActivityType.class', | ||
'**/AgeDisplayType.class', | ||
'**/ApprovalStatus.class', | ||
'**/ContentType.class', | ||
'**/GalleryFilter.class', | ||
'**/GallerySortMode.class', | ||
'**/GrantType.class', | ||
'**/ImageStatus.class', | ||
'**/ISO_3166_CountryCode.class', | ||
'**/LandingUrlType.class', | ||
'**/Locale.class', | ||
'**/NotificationFilter.class', | ||
'**/NotificationType.class', | ||
'**/OAuthResponseType.class', | ||
'**/ObjectType.class', | ||
'**/Operation.class', | ||
'**/Role.class', | ||
'**/Rotation.class', | ||
'**/UploadStep.class', | ||
'**/UserSortMode.class', | ||
'**/VideoProvider.class',] | ||
def debugTree = fileTree(dir: "${buildDir}/intermediates/classes/debug", excludes: fileFilter) | ||
def mainSrc = "${project.projectDir}/src/main/java" | ||
|
||
sourceDirectories = files([mainSrc]) | ||
classDirectories = files([debugTree]) | ||
executionData = fileTree(dir: "$buildDir", includes: [ | ||
"jacoco/testDebugUnitTest.exec", | ||
"outputs/code-coverage/connected/*coverage.ec" | ||
]) | ||
} | ||
|
||
android { | ||
|
||
buildTypes { | ||
debug { | ||
testCoverageEnabled true | ||
} | ||
} | ||
|
||
testOptions { | ||
unitTests.all { | ||
jacoco { | ||
includeNoLocationClasses = true | ||
} | ||
} | ||
} | ||
} |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Wed Oct 12 12:18:39 CEST 2016 | ||
#Wed Jun 21 16:25:56 EEST 2017 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip |