File tree Expand file tree Collapse file tree 4 files changed +81
-6
lines changed Expand file tree Collapse file tree 4 files changed +81
-6
lines changed Original file line number Diff line number Diff line change 2929 environment :
3030 JEST_JUNIT_OUTPUT : test-results/jest/junit.xml
3131
32- - codecov/upload
32+ - codecov/upload :
33+ flags : javascript
3334
3435 - persist_to_workspace :
3536 root : ~/project
4647 executor :
4748 name : android/android-machine
4849 tag : " 2022.03.1"
49- working_directory : ~/project/example
50+ working_directory : ~/project
5051 steps :
5152 - checkout :
5253 path : ~/project
@@ -55,10 +56,14 @@ jobs:
5556 command : npm install -g yarn
5657 - run :
5758 name : Install Node Packages
59+ working_directory : example
5860 command : yarn
5961 - android/run-tests :
60- working-directory : ./android
62+ working-directory : ./example/ android
6163 test-command : ./gradlew test
64+ - codecov/upload :
65+ flags : android
66+ file : android/build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml
6267
6368 validate_shell_files :
6469 machine :
Original file line number Diff line number Diff line change 11apply plugin : ' com.android.library'
22
3+ apply from : ' ./jacoco.gradle'
4+
35String getExtOrDefault (String name ) {
46 if (rootProject. ext. has(name)) {
57 return rootProject. ext. get(name)
Original file line number Diff line number Diff line change 1+ apply plugin : ' jacoco'
2+
3+ jacoco {
4+ toolVersion ' 0.8.8'
5+ }
6+
7+ task jacocoTestReport (type : JacocoReport ) {
8+ group = ' Reporting'
9+ description = ' Generate Jacoco coverage reports for the debug build.'
10+
11+ dependsOn ' testDebugUnitTest'
12+
13+ reports {
14+ html. enabled true
15+ xml. enabled true
16+ }
17+
18+ def excludes = [
19+ ' **/R.class' ,
20+ ' **/R$*.class' ,
21+ ' **/BuildConfig.*' ,
22+ ' **/Manifest*.*' ,
23+ ' **/*Test*.*' ,
24+ ' android/**/*.*' ,
25+ ' androidx/**/*.*' ,
26+ ' **/*$ViewInjector*.*' ,
27+ ' **/*Dagger*.*' ,
28+ ' **/*MembersInjector*.*' ,
29+ ' **/*_Factory.*' ,
30+ ' **/*_Provide*Factory*.*' ,
31+ ' **/*_ViewBinding*.*' ,
32+ ' **/AutoValue_*.*' ,
33+ ' **/R2.class' ,
34+ ' **/R2$*.class' ,
35+ ' **/*Directions$*' ,
36+ ' **/*Directions.*' ,
37+ ' **/*Binding.*'
38+ ]
39+
40+ def jClasses = " ${ project.buildDir} /intermediates/javac/debug/classes"
41+ def javaClasses = fileTree(dir : jClasses, excludes : excludes)
42+ def sourceDirs = [" ${ project.projectDir} /src/main/java" ]
43+ classDirectories. from = files(javaClasses)
44+ sourceDirectories. from = files(sourceDirs)
45+ executionData. from = files([" ${ project.buildDir} /jacoco/testDebugUnitTest.exec" ])
46+ }
47+
48+ tasks. whenTaskAdded { task ->
49+ if (task. name == ' testDebugUnitTest' ) {
50+ task. finalizedBy jacocoTestReport
51+ }
52+ }
Original file line number Diff line number Diff line change @@ -8,9 +8,25 @@ coverage:
88 range : " 70...100"
99
1010 status :
11- patch :
12- default :
13- target : 90%
1411 project :
1512 default :
13+ target : 50%
14+ patch :
15+ javascript :
1616 target : 90%
17+ flags :
18+ - javascript
19+ android :
20+ target : 35%
21+ flags :
22+ - android
23+
24+ flags :
25+ javascript :
26+ carryforward : true
27+ paths :
28+ - src
29+ android :
30+ carryforward : true
31+ paths :
32+ - android
You can’t perform that action at this time.
0 commit comments