Created
June 10, 2012 00:50
-
-
Save cholick/2903272 to your computer and use it in GitHub Desktop.
Gradle task for gmetrics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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