Skip to content

Commit 91142c4

Browse files
committed
fix jacoco
1 parent 024acd0 commit 91142c4

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

jobqueue/build.gradle

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ android {
8484
unitTests.all {
8585
// All the usual Gradle options.
8686
jvmArgs '-Xmx2000m', '-XX:+HeapDumpOnOutOfMemoryError', "-XX:HeapDumpPath=${System.env.CIRCLE_ARTIFACTS == null ? "." : System.env.CIRCLE_ARTIFACTS}/oom.hprof"
87+
jacoco {
88+
includeNoLocationClasses = true
89+
}
8790
}
8891
}
8992

@@ -232,16 +235,20 @@ task jacocoTestReport(type:JacocoReport, dependsOn: "testDebugUnitTest") {
232235
'**/R$*.class',
233236
'**/BuildConfig.*',
234237
'**/Manifest*.*',
235-
'com/google/**']
238+
'android/**/*.*',
239+
'com/google/**']
236240
)
237241

238-
additionalSourceDirs = files(android.sourceSets.main.getJava().getSrcDirs())
239242
sourceDirectories = files(android.sourceSets.main.getJava().getSrcDirs())
240-
executionData = files("$buildDir/jacoco/testDebugUnitTest.exec")
243+
executionData = fileTree(dir: "$buildDir", includes: [
244+
"jacoco/testDebugUnitTest.exec",
245+
"outputs/code-coverage/connected/*coverage.ec"
246+
])
241247

242248
reports {
243249
xml.enabled = true
244250
html.enabled = true
245251
}
246252

253+
dependsOn "createDebugCoverageReport"
247254
}

0 commit comments

Comments
 (0)