# HG changeset patch # User smith@nwoca.org # Date 1370468758 -3600 # Node ID ca34c067b178d00b1cdad8221bbe61a60efb99f4 # Parent 2533741290341e573ec6452af5a3c4b41187fb9a CM-133: make coverage analysis controllable by property diff -r 253374129034 -r ca34c067b178 metrics.gradle --- a/metrics.gradle Wed Jun 05 15:45:28 2013 +0100 +++ b/metrics.gradle Wed Jun 05 22:45:58 2013 +0100 @@ -1,16 +1,18 @@ apply plugin: "sonar-runner" ant.property(file: System.getProperty('user.home') + "/.ssdt/sonar.properties") +if (!gradle.environment.containsKey('coverage')) { + gradle.environment.put('coverage', false) +} else { + gradle.environment.put('coverage', gradle.environment.coverage.toBoolean()) +} + 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 "me.davesmith:gradle-cobertura-plugin:1.0.2.SNAPSHOT" - classpath "net.sourceforge.cobertura:cobertura:1.9.4.1" - } } sonarRunner { @@ -25,18 +27,34 @@ } } +//gradle.rootProject.afterEvaluate { project -> +// +// project.jacocoTestReport { +// +// +// } +// +//} + + + subprojects { afterEvaluate { project -> def groovyProject = project.plugins.hasPlugin('groovy') def javaProject = project.plugins.hasPlugin('java') - if (groovyProject || javaProject) { + if (gradle.environment.coverage && groovyProject) { + logger.info "coverage analysis enabled" project.apply plugin: 'jacoco' + project.jacoco { + toolVersion = "0.6.3.201306030806" + } + project.test { jacoco { - enabled = false + enabled = true } } project.jacocoTestReport {