2018-07-14 14:06:57 +02:00
|
|
|
apply plugin: "jacoco"
|
|
|
|
|
|
|
|
jacoco {
|
2021-04-03 11:56:07 +02:00
|
|
|
toolVersion "0.8.6"
|
|
|
|
reportsDirectory = file("$buildDir/reports")
|
2018-07-14 14:06:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType(Test) {
|
|
|
|
jacoco.includeNoLocationClasses = true
|
2020-12-27 18:30:50 +01:00
|
|
|
jacoco.excludes = ['jdk.internal.*']
|
2018-07-14 14:06:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
task jacocoTestReport(type: JacocoReport) {
|
|
|
|
|
|
|
|
group = "Reporting"
|
|
|
|
description = "Generate Jacoco coverage reports"
|
|
|
|
|
|
|
|
reports {
|
|
|
|
xml.enabled = true
|
|
|
|
html.enabled = true
|
|
|
|
}
|
|
|
|
|
2018-08-24 15:48:29 +02:00
|
|
|
def excludes = ['**/R.class',
|
|
|
|
'**/R$*.class',
|
|
|
|
'**/BuildConfig.*',
|
|
|
|
'**/Manifest*.*',
|
|
|
|
'**/*Test*.*',
|
|
|
|
'android/**/*.*',
|
|
|
|
'**/*Module.*',
|
|
|
|
'**/*Dagger*.*',
|
|
|
|
'**/*MembersInjector*.*',
|
|
|
|
'**/*_Provide*Factory*.*',
|
2018-08-26 00:18:31 +02:00
|
|
|
'**/*_Factory.*']
|
2018-07-14 14:06:57 +02:00
|
|
|
|
2019-04-29 20:39:35 +02:00
|
|
|
classDirectories.setFrom(fileTree(
|
2018-07-14 14:06:57 +02:00
|
|
|
dir: "$buildDir/intermediates/classes/debug",
|
|
|
|
excludes: excludes
|
|
|
|
) + fileTree(
|
2020-09-20 21:54:59 +02:00
|
|
|
dir: "$buildDir/tmp/kotlin-classes/fdroidDebug",
|
2018-07-14 14:06:57 +02:00
|
|
|
excludes: excludes
|
2019-04-29 20:39:35 +02:00
|
|
|
))
|
2018-07-14 14:06:57 +02:00
|
|
|
|
2019-06-03 14:12:48 +02:00
|
|
|
sourceDirectories.setFrom(files([
|
|
|
|
"src/main/java",
|
2020-09-20 21:54:59 +02:00
|
|
|
"src/fdroid/java"
|
2019-06-03 14:12:48 +02:00
|
|
|
]))
|
2019-04-29 20:39:35 +02:00
|
|
|
executionData.setFrom(fileTree(
|
2018-07-14 14:06:57 +02:00
|
|
|
dir: project.projectDir,
|
2018-08-24 15:48:29 +02:00
|
|
|
includes: ["**/*.exec", "**/*.ec"]
|
2019-04-29 20:39:35 +02:00
|
|
|
))
|
2018-07-14 14:06:57 +02:00
|
|
|
}
|