Skip to content

Instantly share code, notes, and snippets.

@domix
Forked from cholick/build.gradle
Last active August 29, 2015 14:24
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 domix/640bcc7e690b64d7ef7f to your computer and use it in GitHub Desktop.
Save domix/640bcc7e690b64d7ef7f to your computer and use it in GitHub Desktop.
//Minimal configuration needed for Gradle build file with GMetrics integration
apply plugin: 'groovy'
repositories {
mavenCentral()
}
configurations {
gmetrics
}
dependencies {
gmetrics 'org.gmetrics:GMetrics:0.5'
}
task gmetrics << {
//use GMetrics ant task - http://gmetrics.sourceforge.net/gmetrics-ant-task.html
ant.taskdef(name: 'gmetrics', classname: 'org.gmetrics.ant.GMetricsTask', classpath: configurations.gmetrics.asPath)
//ensure reporting directory created
ant.mkdir(dir: "${project.reporting.baseDir.path}/gmetrics")
ant.gmetrics() {
report(type: 'org.gmetrics.report.BasicHtmlReportWriter') {
option(name: 'outputFile', value: "${project.reporting.baseDir.path}/gmetrics/gmetrics.html")
}
report(type: 'org.gmetrics.report.XmlReportWriter') {
option(name: 'outputFile', value: "${project.reporting.baseDir.path}/gmetrics/gmetrics.xml")
}
fileset(dir: 'src') {
include(name: '**/*.groovy')
//exclusions to filter out any classes with inner classes - sonar doesn't support
exclude(name: '**/*Config*')
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment