88 lines
No EOL
2.6 KiB
Groovy
88 lines
No EOL
2.6 KiB
Groovy
def androidFileFilter =
|
|
[ //jdk
|
|
'jdk.internal.*',
|
|
// data binding
|
|
'**/databinding/*.class',
|
|
'**/BR.*',
|
|
// android
|
|
'**/R.class',
|
|
'**/R$*.class',
|
|
'**/BuildConfig.*',
|
|
'**/Manifest*.*',
|
|
'**/*Test*.*',
|
|
'android/**/*.*',
|
|
// kotlin
|
|
'**/*MapperImpl*.*',
|
|
'**/*$ViewInjector*.*',
|
|
'**/*$ViewBinder*.*',
|
|
'**/BuildConfig.*',
|
|
'**/*Component*.*',
|
|
'**/*BR*.*',
|
|
'**/Manifest*.*',
|
|
'**/*$Lambda$*.*',
|
|
'**/*Companion*.*',
|
|
'**/*Module*.*',
|
|
'**/*Dagger*.*',
|
|
'**/*Hilt*.*',
|
|
'**/*MembersInjector*.*',
|
|
'**/*_MembersInjector.class',
|
|
'**/*_Factory*.*',
|
|
'**/*_Provide*Factory*.*',
|
|
'**/*Extensions*.*',
|
|
// sealed and data classes
|
|
'**/*$Result.*',
|
|
'**/*$Result$*.*',
|
|
// adapters generated by moshi
|
|
'**/*JsonAdapter.*',
|
|
// room
|
|
'**/*_Impl.class',
|
|
'**/*_Impl*.*',
|
|
]
|
|
|
|
subprojects { module ->
|
|
plugins.withType(JavaPlugin).whenPluginAdded {
|
|
configure(module) {
|
|
apply plugin: "jacoco"
|
|
|
|
jacocoTestReport {
|
|
dependsOn test // tests are required to run before generating the report
|
|
|
|
afterEvaluate {
|
|
classDirectories.setFrom(files(classDirectories.files.collect {
|
|
fileTree(dir: it, exclude: androidFileFilter)
|
|
}))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
plugins.withId("com.android.application") {
|
|
configure(module) {
|
|
apply plugin: "jacoco"
|
|
|
|
module.android.testOptions.unitTests.all {
|
|
jacoco.includeNoLocationClasses = true
|
|
jacoco.excludes = androidFileFilter
|
|
}
|
|
android.buildTypes.debug.enableAndroidTestCoverage true
|
|
android.buildTypes.debug.enableUnitTestCoverage true
|
|
|
|
jacoco.toolVersion = "$jacoco_version"
|
|
}
|
|
}
|
|
|
|
plugins.withId("com.android.library") {
|
|
configure(module) {
|
|
apply plugin: "jacoco"
|
|
|
|
module.android.testOptions.unitTests.all {
|
|
jacoco.includeNoLocationClasses = true
|
|
jacoco.excludes = androidFileFilter
|
|
}
|
|
android.buildTypes.debug.enableAndroidTestCoverage true
|
|
android.buildTypes.debug.enableUnitTestCoverage true
|
|
|
|
jacoco.toolVersion = "$jacoco_version"
|
|
}
|
|
}
|
|
} |