Mercurial > public > develkit
diff metrics.gradle @ 116:8f3ba3b811bf
update cobertura configuration
author | smith@nwoca.org |
---|---|
date | Thu, 01 Nov 2012 15:45:40 +0100 |
parents | bb3fa722df51 |
children | 5e06e0629f85 |
line wrap: on
line diff
--- a/metrics.gradle Wed Oct 31 22:27:31 2012 +0100 +++ b/metrics.gradle Thu Nov 01 15:45:40 2012 +0100 @@ -8,9 +8,12 @@ buildscript { repositories { maven { url 'http://repos.ssdt.nwoca.org/artifactory/gradle-plugins' } - } + maven { url 'http://repos.ssdt.nwoca.org/artifactory/repository' } + maven { url 'http://repos.ssdt.nwoca.org/artifactory/libs-snapshots' } + } dependencies { - classpath "gradle_cobertura:gradle_cobertura:1.0" + classpath "me.davesmith:gradle-cobertura-plugin:1.0.2.SNAPSHOT" + classpath "net.sourceforge.cobertura:cobertura:1.9.4.1" } } @@ -38,11 +41,9 @@ def testableProjects = root.allprojects.findAll { it.configurations.any { it.name.contains('test') } } - root.configure(testableProjects) { -> + root.configure(testableProjects) { p -> def usesGroovy = configurations.any { it.name == 'groovy' } - apply { -// plugin com.orbitz.gradle.cobertura.CoberturaPlugin - } + apply plugin: net.saliman.gradle.plugin.cobertura.CoberturaPlugin sonar { project { @@ -53,16 +54,21 @@ withProjectProperties { props -> props['sonar.cobertura.reportPath'] = "${reporting.baseDir}/cobertura/coverage.xml" props["sonar.cpd.skip"] = true + props['sonar.language'] = usesGroovy ? 'grvy' : 'java' } } + } -// cobertura { -// if (usesGroovy) { -// coverageSourceDirs = sourceSets.main.groovy.srcDirs -// } -// } - + cobertura { + if (usesGroovy) { + coverageSourceDirs = sourceSets.main.groovy.srcDirs + } + if (gradle.bambooBuild) { + coverageFormat = 'xml' + } + } + } root.allprojects { @@ -75,6 +81,9 @@ language = usesGroovy ? 'grvy' : 'java' dynamicAnalysis = "reuseReports" sourceEncoding = "UTF-8" + withProjectProperties { props -> + props['sonar.language'] = usesGroovy ? 'grvy' : 'java' + } } }