Skip to content

Instantly share code, notes, and snippets.

@jivimberg
Created April 27, 2018 03:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jivimberg/3ee0beaa9ab8b20b48e4273378dcd30e to your computer and use it in GitHub Desktop.
Save jivimberg/3ee0beaa9ab8b20b48e4273378dcd30e to your computer and use it in GitHub Desktop.
Jacoco on Gradle - How to verify coverage with exclusions
jacocoTestCoverageVerification {
afterEvaluate {
classDirectories = files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
'com/example/my/package/*',
'com/example/service/MyApplication.kt',
'com/google/protobuf/*'
])
})
}
violationRules {
rule {
limit {
minimum = 0.79
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment