1- apply plugin : ' jacoco'
1+ apply plugin : " jacoco"
22
33jacoco {
44 toolVersion = " $jacoco_version "
@@ -10,7 +10,7 @@ subprojects {
1010 configurations. all {
1111 resolutionStrategy {
1212 eachDependency { details ->
13- if (' org.jacoco' == details. requested. group) {
13+ if (" org.jacoco" == details. requested. group) {
1414 details. useVersion " $jacocoVersion "
1515 }
1616 }
@@ -20,9 +20,9 @@ subprojects {
2020
2121project. afterEvaluate { project ->
2222
23- tasks. withType(Test ) {
23+ tasks. withType(Test ). configureEach {
2424 jacoco. includeNoLocationClasses = true
25- jacoco. excludes = [' jdk.internal.*' ]
25+ jacoco. excludes = [" jdk.internal.*" ]
2626 }
2727
2828 final flavor = " Gplay"
@@ -39,57 +39,56 @@ project.afterEvaluate { project ->
3939 }
4040
4141 final fileFilter = [
42- // data binding
43- ' **/databinding/*' ,
44- ' android/databinding/**/*.class' ,
45- ' **/android/databinding/*Binding.class' ,
46- ' **/android/databinding/*' ,
47- ' **/androidx/databinding/*' ,
48- ' **/BR.*' ,
49- // android
50- ' **/R.class' ,
51- ' **/R$*.class' ,
52- ' **/BuildConfig.*' ,
53- ' **/Manifest*.*' ,
54- ' **/*Test*.*' ,
55- ' android/**/*.*' ,
56- // kotlin
57- ' **/*MapperImpl*.*' ,
58- ' **/*$ViewInjector*.*' ,
59- ' **/*$ViewBinder*.*' ,
60- ' **/BuildConfig.*' ,
61- ' **/*Component*.*' ,
62- ' **/*BR*.*' ,
63- ' **/Manifest*.*' ,
64- ' **/*$Lambda$*.*' ,
65- ' **/*Companion*.*' ,
66- ' **/*Module*.*' ,
67- ' **/*Dagger*.*' ,
68- ' **/*Hilt*.*' ,
69- ' **/*MembersInjector*.*' ,
70- ' **/*_MembersInjector.class' ,
71- ' **/*_Factory*.*' ,
72- ' **/*_Provide*Factory*.*' ,
73- ' **/*Extensions*.*' ,
74- // sealed and data classes
75- ' **/*$Result.*' ,
76- ' **/*$Result$*.*' ,
77- // adapters generated by moshi
78- ' **/*JsonAdapter.*' ,
79- // Hilt
80- ' **/*Module.kt' ,
81- ' **/di/**' ,
82- ' dagger.hilt.internal/*' ,
83- ' hilt_aggregated_deps/*' ,
42+ // data binding
43+ " **/databinding/*" ,
44+ " android/databinding/**/*.class" ,
45+ " **/android/databinding/*Binding.class" ,
46+ " **/android/databinding/*" ,
47+ " **/androidx/databinding/*" ,
48+ " **/BR.*" ,
49+ // android
50+ " **/R.class" ,
51+ " **/R\ $ *.class" ,
52+ " **/BuildConfig.*" ,
53+ " **/Manifest*.*" ,
54+ " **/*Test*.*" ,
55+ " android/**/*.*" ,
56+ // kotlin
57+ " **/*MapperImpl*.*" ,
58+ " **/*\ $ ViewInjector*.*" ,
59+ " **/*\ $ ViewBinder*.*" ,
60+ " **/BuildConfig.*" ,
61+ " **/*Component*.*" ,
62+ " **/*BR*.*" ,
63+ " **/Manifest*.*" ,
64+ " **/*\ $ Lambda\ $ *.*" ,
65+ " **/*Companion*.*" ,
66+ " **/*Module*.*" ,
67+ " **/*Dagger*.*" ,
68+ " **/*Hilt*.*" ,
69+ " **/*MembersInjector*.*" ,
70+ " **/*_MembersInjector.class" ,
71+ " **/*_Factory*.*" ,
72+ " **/*_Provide*Factory*.*" ,
73+ " **/*Extensions*.*" ,
74+ // sealed and data classes
75+ " **/*\ $ Result.*" ,
76+ " **/*\ $ Result\ $ *.*" ,
77+ // adapters generated by moshi
78+ " **/*JsonAdapter.*" ,
79+ // Hilt
80+ " **/*Module.kt" ,
81+ " **/di/**" ,
82+ " dagger.hilt.internal/*" ,
83+ " hilt_aggregated_deps/*" ,
8484
85- ' **/*$Result.*' , /* filtering `sealed` and `data` classes */
86- ' **/*$Result$*.*' ,/* filtering `sealed` and `data` classes */
87- ' **/*Args*.*' , /* filtering Navigation Component generated classes */
88- ' **/*Directions*.*' , /* filtering Navigation Component generated classes */
89- ' **/*inlined*.class' , /* filtering inlined classes */
90- ' **/composables/**'
91- /* INSERT ANY OTHER JUNK YOU WANT FILTERED OUT HERE */
92- ]
85+ " **/*\$ Result.*" , /* filtering `sealed` and `data` classes */
86+ " **/*\$ Result\$ *.*" ,/* filtering `sealed` and `data` classes */
87+ " **/*Args*.*" , /* filtering Navigation Component generated classes */
88+ " **/*Directions*.*" , /* filtering Navigation Component generated classes */
89+ " **/*inlined*.class" , /* filtering inlined classes */
90+ " **/composables/**"
91+ /* INSERT ANY OTHER JUNK YOU WANT FILTERED OUT HERE */ ]
9392
9493 final androidKotlinTree = fileTree(dir : " ${ project.buildDir} /tmp/kotlin-classes/${ variant} " , excludes : fileFilter)
9594 final kotlinTree = fileTree(dir : " ${ project.buildDir} /classes/kotlin/main" , excludes : fileFilter)
@@ -101,9 +100,7 @@ project.afterEvaluate { project ->
101100
102101 sourceDirectories. setFrom files([mainSrc, productFlavorSrc, buildTypeSrc])
103102 classDirectories. setFrom files([androidKotlinTree, kotlinTree, javacTree])
104- executionData. setFrom fileTree(dir : project. buildDir, includes : [
105- " jacoco/test${ variant.capitalize()} UnitTest.exec" ,
106- " outputs/unit_test_code_coverage/${ variant} UnitTest/test${ variant.capitalize()} UnitTest.exec" ,
107- ])
103+ executionData. setFrom fileTree(dir : project. buildDir, includes : [" jacoco/test${ variant.capitalize()} UnitTest.exec" ,
104+ " outputs/unit_test_code_coverage/${ variant} UnitTest/test${ variant.capitalize()} UnitTest.exec" ,])
108105 }
109106}
0 commit comments