2018-07-14 07:06:57 -05:00
|
|
|
apply plugin: "jacoco"
|
|
|
|
|
|
|
|
jacoco {
|
2023-10-06 03:07:55 -05:00
|
|
|
toolVersion "0.8.10"
|
2021-08-25 13:49:44 -05:00
|
|
|
reportsDirectory.set(file("$buildDir/reports"))
|
2018-07-14 07:06:57 -05:00
|
|
|
}
|
|
|
|
|
2023-10-06 03:07:55 -05:00
|
|
|
tasks.withType(Test).configureEach {
|
2018-07-14 07:06:57 -05:00
|
|
|
jacoco.includeNoLocationClasses = true
|
2020-12-27 11:30:50 -06:00
|
|
|
jacoco.excludes = ['jdk.internal.*']
|
2018-07-14 07:06:57 -05:00
|
|
|
}
|
|
|
|
|
2023-10-06 03:07:55 -05:00
|
|
|
tasks.register('jacocoTestReport', JacocoReport) {
|
2018-07-14 07:06:57 -05:00
|
|
|
|
|
|
|
group = "Reporting"
|
|
|
|
description = "Generate Jacoco coverage reports"
|
|
|
|
|
|
|
|
reports {
|
2021-08-25 13:49:44 -05:00
|
|
|
xml.required.set(true)
|
|
|
|
html.required.set(true)
|
2018-07-14 07:06:57 -05:00
|
|
|
}
|
|
|
|
|
2018-08-24 08:48:29 -05:00
|
|
|
def excludes = ['**/R.class',
|
|
|
|
'**/R$*.class',
|
|
|
|
'**/BuildConfig.*',
|
|
|
|
'**/Manifest*.*',
|
|
|
|
'**/*Test*.*',
|
|
|
|
'android/**/*.*',
|
|
|
|
'**/*Module.*',
|
|
|
|
'**/*Dagger*.*',
|
|
|
|
'**/*MembersInjector*.*',
|
|
|
|
'**/*_Provide*Factory*.*',
|
2018-08-25 17:18:31 -05:00
|
|
|
'**/*_Factory.*']
|
2018-07-14 07:06:57 -05:00
|
|
|
|
2019-04-29 13:39:35 -05:00
|
|
|
classDirectories.setFrom(fileTree(
|
2023-10-06 03:07:55 -05:00
|
|
|
dir: "$buildDir/intermediates/classes/debug",
|
|
|
|
excludes: excludes
|
2018-07-14 07:06:57 -05:00
|
|
|
) + fileTree(
|
2023-10-06 03:07:55 -05:00
|
|
|
dir: "$buildDir/tmp/kotlin-classes/fdroidDebug",
|
|
|
|
excludes: excludes
|
2019-04-29 13:39:35 -05:00
|
|
|
))
|
2018-07-14 07:06:57 -05:00
|
|
|
|
2019-06-03 07:12:48 -05:00
|
|
|
sourceDirectories.setFrom(files([
|
2023-10-06 03:07:55 -05:00
|
|
|
"src/main/java",
|
|
|
|
"src/fdroid/java"
|
2019-06-03 07:12:48 -05:00
|
|
|
]))
|
2019-04-29 13:39:35 -05:00
|
|
|
executionData.setFrom(fileTree(
|
2023-10-06 03:07:55 -05:00
|
|
|
dir: project.projectDir,
|
|
|
|
includes: ["**/*.exec", "**/*.ec"]
|
2019-04-29 13:39:35 -05:00
|
|
|
))
|
2018-07-14 07:06:57 -05:00
|
|
|
}
|