Skip to content

Commit 8a80c7f

Browse files
alexrwegenervanniktech
authored andcommitted
Generate csv reports (#95)
1 parent 9c6280c commit 8a80c7f

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/main/groovy/com/vanniktech/android/junit/jacoco/GenerationPlugin.groovy

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class GenerationPlugin implements Plugin<Project> {
7070

7171
reports {
7272
xml.enabled = true
73+
csv.enabled = true
7374
html.enabled = true
7475
}
7576

@@ -147,6 +148,10 @@ class GenerationPlugin implements Plugin<Project> {
147148
enabled = true
148149
destination subProject.file("${subProject.buildDir}/reports/jacoco/${sourceName}/jacoco.xml")
149150
}
151+
csv {
152+
enabled = true
153+
destination subProject.file("${subProject.buildDir}/reports/jacoco/${sourceName}/jacoco.csv")
154+
}
150155
html {
151156
enabled = true
152157
destination subProject.file("${subProject.buildDir}/reports/jacoco/${sourceName}")
@@ -236,6 +241,10 @@ class GenerationPlugin implements Plugin<Project> {
236241
enabled = true
237242
destination project.file("${project.buildDir}/reports/jacoco/jacoco.xml")
238243
}
244+
csv {
245+
enabled = true
246+
destination project.file("${project.buildDir}/reports/jacoco/jacoco.csv")
247+
}
239248
html {
240249
enabled = true
241250
destination project.file("${project.buildDir}/reports/jacoco")

src/test/groovy/com/vanniktech/android/junit/jacoco/GenerationTest.groovy

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ public class GenerationTest {
156156

157157
assert reports.xml.enabled
158158
assert reports.xml.destination.toString() == project.buildDir.absolutePath + "/reports/jacoco/${flavor}${buildType.capitalize()}/jacoco.xml"
159+
assert reports.csv.enabled
160+
assert reports.csv.destination.toString() == project.buildDir.absolutePath + "/reports/jacoco/${flavor}${buildType.capitalize()}/jacoco.csv"
159161
assert reports.html.enabled
160162
assert reports.html.destination.toString() == project.buildDir.absolutePath + "/reports/jacoco/${flavor}${buildType.capitalize()}"
161163

@@ -196,6 +198,8 @@ public class GenerationTest {
196198

197199
assert reports.xml.enabled
198200
assert reports.xml.destination.toString() == project.buildDir.absolutePath + '/reports/jacoco/debug/jacoco.xml'
201+
assert reports.csv.enabled
202+
assert reports.csv.destination.toString() == project.buildDir.absolutePath + '/reports/jacoco/debug/jacoco.csv'
199203
assert reports.html.enabled
200204
assert reports.html.destination.toString() == project.buildDir.absolutePath + '/reports/jacoco/debug'
201205

@@ -230,6 +234,8 @@ public class GenerationTest {
230234

231235
assert reports.xml.enabled
232236
assert reports.xml.destination.toString() == project.buildDir.absolutePath + '/reports/jacoco/release/jacoco.xml'
237+
assert reports.csv.enabled
238+
assert reports.csv.destination.toString() == project.buildDir.absolutePath + '/reports/jacoco/release/jacoco.csv'
233239
assert reports.html.enabled
234240
assert reports.html.destination.toString() == project.buildDir.absolutePath + '/reports/jacoco/release'
235241

@@ -270,6 +276,7 @@ public class GenerationTest {
270276
assert contentEquals(classDirectories.includes, ["**/classes/**"])
271277

272278
assert reports.xml.enabled
279+
assert reports.csv.enabled
273280
assert reports.html.enabled
274281

275282
assert taskDependsOn(task, 'test')

0 commit comments

Comments
 (0)