Skip to content

Instantly share code, notes, and snippets.

@khauser
Last active March 21, 2016 14:32
Show Gist options
  • Save khauser/079d4b6ebbab23484641 to your computer and use it in GitHub Desktop.
Save khauser/079d4b6ebbab23484641 to your computer and use it in GitHub Desktop.
apply plugin: 'jacoco'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.compilerArgs << '-Xlint:all'
}
jacocoTestReport {
group = 'Coverage reports'
description = 'Generates a test coverage report for a project'
reports {
xml.enabled = true
html.enabled = true
}
}
tasks.withType(Test) {
if (System.properties.containsKey('debug')) {
jvmArgs '-Xdebug', '-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005'
}
options {
jvmArgs '-XX:SoftRefLRUPolicyMSPerMB=0', '-noverify'
}
if (System.env.'CI') {
maxHeapSize = '512m'
reports.html.enabled = false
}
testLogging {
events 'skipped', 'failed'
exceptionFormat 'full'
showCauses = true
showExceptions = true
showStackTraces = true
}
jacoco {
append = true
destinationFile = file("${rootDir}/build/jacoco/jacocoTest.exec")
classDumpFile = file("${rootDir}/build/jacoco/classpathdumps")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment