Skip to content

Instantly share code, notes, and snippets.

@sw-samuraj
Last active July 2, 2018 04:38
Show Gist options
  • Save sw-samuraj/f245e6c8a05ea07d8d2bf513ff145bd1 to your computer and use it in GitHub Desktop.
Save sw-samuraj/f245e6c8a05ea07d8d2bf513ff145bd1 to your computer and use it in GitHub Desktop.
A minimalistic Gradle configuration for JaCoCo with JUnit 5.
apply plugin: 'jacoco'
jacoco {
toolVersion = '0.7.9'
applyTo junitPlatformTest
}
jacocoTestReport {
afterEvaluate {
classDirectories = files(classDirectories.files.collect {
fileTree(dir: it, exclude: ['**/Main*'])
})
}
}
junitPlatformTest {
jacoco {
destinationFile = file("${buildDir}/jacoco/test.exec")
}
}
@bondpp7
Copy link

bondpp7 commented Apr 10, 2018

Lines 8 thru 14 are not required, when using the latest JUnit5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment