Skip to content

Commit

Permalink
Merge pull request #157 from xTeamTEICM/#156
Browse files Browse the repository at this point in the history
Accept JaCoCo for Android #156
  • Loading branch information
Jordan Kostelidis authored Jan 7, 2018
2 parents 5d33dd7 + 8ef0f21 commit 0b5e2e9
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,42 @@
apply plugin: 'com.android.application'
apply plugin: 'jacoco-android'

task jacocoCustomTestReport(type: JacocoReport, dependsOn: "testDebugUnitTest") {
println ":${project.name}:Generating Jacoco reports"
group = "Reporting"
description = "Generate Jacoco coverage reports"

reports {
xml.enabled = true
csv.enabled = true
html.enabled = true
}

def fileFilter = ['**/R.class',
'**/R$*.class',
'**/BuildConfig.*',
'**/Manifest*.*',
'android/**/*.*',
'**/Lambda$*.class', //Retrolambda
'**/Lambda.class',
'**/*Lambda.class',
'**/*Lambda*.class',
'**/*Lambda*.*',
'**/*Builder.*',
'**/*_MembersInjector.class', //Dagger2 generated code
'**/*_MembersInjector*.*', //Dagger2 generated code
'**/*_*Factory*.*', //Dagger2 generated code
'**/*Component*.*', //Dagger2 generated code
'**/*Module*.*' //Dagger2 generated code
]
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: project.projectDir, includes:
['**/*.exec' , '**/*.ec'])
}

android {
compileSdkVersion 26
Expand Down Expand Up @@ -40,6 +78,7 @@ android {
}
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
testCoverageEnabled true
}
}
}
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ buildscript {

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.dicedmelon.gradle:jacoco-android:0.1.2'
}
}

Expand Down

0 comments on commit 0b5e2e9

Please sign in to comment.