Skip to content

Commit 0718c3d

Browse files
authored
Merge pull request #422 from meilisearch/code-cov
Add code-coverage tool (jacoco)
2 parents e8d23d2 + bedfa81 commit 0718c3d

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,6 @@ atlassian-ide-plugin.xml
6161

6262
*.gpg
6363
secring*
64+
65+
# coverage output
66+
tmp/coverage

build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ plugins {
1111
id 'java-library'
1212
id 'maven-publish'
1313
id 'signing'
14+
id 'jacoco'
1415
id 'io.codearte.nexus-staging' version '0.30.0'
1516
id "com.diffplug.spotless" version "6.5.2"
1617
}
@@ -24,6 +25,11 @@ java {
2425
targetCompatibility = JavaVersion.VERSION_1_8
2526
}
2627

28+
jacoco {
29+
toolVersion = "0.8.8"
30+
reportsDir = file("$projectDir/tmp/coverage")
31+
}
32+
2733
repositories {
2834
mavenCentral() // Required for Lombok dependency
2935
jcenter()
@@ -78,6 +84,7 @@ task buildJar(type: Jar) {
7884
}
7985

8086
test {
87+
finalizedBy jacocoTestReport
8188
useJUnitPlatform {
8289
excludeTags('integration')
8390
}
@@ -86,6 +93,10 @@ test {
8693
}
8794
}
8895

96+
jacocoTestReport {
97+
dependsOn test
98+
}
99+
89100
task integrationTest(type: Test) {
90101
useJUnitPlatform {
91102
includeTags('integration')

0 commit comments

Comments
 (0)