annotate metrics.gradle @ 128:c93df17513f1

CM-133: add jacoco for standard coverage reports. Add sonar properties for SCM and bamboo plan
author smith@nwoca.org
date Tue, 04 Jun 2013 23:13:59 +0100
parents b2532280341e
children 253374129034
rev   line source
126
b2532280341e CM-133: switch to sonar-runner
smith@nwoca.org
parents: 119
diff changeset
1 apply plugin: "sonar-runner"
85
f36eeb411845 add sonar publishing
smith@nwoca.org
parents:
diff changeset
2 ant.property(file: System.getProperty('user.home') + "/.ssdt/sonar.properties")
f36eeb411845 add sonar publishing
smith@nwoca.org
parents:
diff changeset
3
f36eeb411845 add sonar publishing
smith@nwoca.org
parents:
diff changeset
4 buildscript {
128
c93df17513f1 CM-133: add jacoco for standard coverage reports. Add sonar properties for SCM and bamboo plan
smith@nwoca.org
parents: 126
diff changeset
5 repositories {
85
f36eeb411845 add sonar publishing
smith@nwoca.org
parents:
diff changeset
6 maven { url 'http://repos.ssdt.nwoca.org/artifactory/gradle-plugins' }
116
8f3ba3b811bf update cobertura configuration
smith@nwoca.org
parents: 108
diff changeset
7 maven { url 'http://repos.ssdt.nwoca.org/artifactory/repository' }
8f3ba3b811bf update cobertura configuration
smith@nwoca.org
parents: 108
diff changeset
8 maven { url 'http://repos.ssdt.nwoca.org/artifactory/libs-snapshots' }
128
c93df17513f1 CM-133: add jacoco for standard coverage reports. Add sonar properties for SCM and bamboo plan
smith@nwoca.org
parents: 126
diff changeset
9 }
85
f36eeb411845 add sonar publishing
smith@nwoca.org
parents:
diff changeset
10 dependencies {
116
8f3ba3b811bf update cobertura configuration
smith@nwoca.org
parents: 108
diff changeset
11 classpath "me.davesmith:gradle-cobertura-plugin:1.0.2.SNAPSHOT"
8f3ba3b811bf update cobertura configuration
smith@nwoca.org
parents: 108
diff changeset
12 classpath "net.sourceforge.cobertura:cobertura:1.9.4.1"
85
f36eeb411845 add sonar publishing
smith@nwoca.org
parents:
diff changeset
13 }
f36eeb411845 add sonar publishing
smith@nwoca.org
parents:
diff changeset
14 }
f36eeb411845 add sonar publishing
smith@nwoca.org
parents:
diff changeset
15
126
b2532280341e CM-133: switch to sonar-runner
smith@nwoca.org
parents: 119
diff changeset
16 sonarRunner {
b2532280341e CM-133: switch to sonar-runner
smith@nwoca.org
parents: 119
diff changeset
17 sonarProperties {
b2532280341e CM-133: switch to sonar-runner
smith@nwoca.org
parents: 119
diff changeset
18 property "sonar.host.url", "http://sonar.ssdt-ohio.org/"
b2532280341e CM-133: switch to sonar-runner
smith@nwoca.org
parents: 119
diff changeset
19 property "sonar.jdbc.url", ant.properties['sonar.jdbc.url']
b2532280341e CM-133: switch to sonar-runner
smith@nwoca.org
parents: 119
diff changeset
20 property "sonar.jdbc.driverClassName", ant.properties['sonar.jdbc.driverClassName']
b2532280341e CM-133: switch to sonar-runner
smith@nwoca.org
parents: 119
diff changeset
21 property "sonar.jdbc.username", ant.properties['sonar.jdbc.username']
b2532280341e CM-133: switch to sonar-runner
smith@nwoca.org
parents: 119
diff changeset
22 property "sonar.jdbc.password", ant.properties['sonar.jdbc.password']
128
c93df17513f1 CM-133: add jacoco for standard coverage reports. Add sonar properties for SCM and bamboo plan
smith@nwoca.org
parents: 126
diff changeset
23 property "sonar.build-stability.url", "http://bamboo.ssdt-ohio.org/browse/${gradle.bambooPlan}"
c93df17513f1 CM-133: add jacoco for standard coverage reports. Add sonar properties for SCM and bamboo plan
smith@nwoca.org
parents: 126
diff changeset
24 property "sonar.scm.url", "scm:hg:${gradle.hgRepositoryUrl}"
117
5e06e0629f85 correct groovy language setting and force profile name
smith@nwoca.org
parents: 116
diff changeset
25 }
85
f36eeb411845 add sonar publishing
smith@nwoca.org
parents:
diff changeset
26 }
126
b2532280341e CM-133: switch to sonar-runner
smith@nwoca.org
parents: 119
diff changeset
27
128
c93df17513f1 CM-133: add jacoco for standard coverage reports. Add sonar properties for SCM and bamboo plan
smith@nwoca.org
parents: 126
diff changeset
28 subprojects {
126
b2532280341e CM-133: switch to sonar-runner
smith@nwoca.org
parents: 119
diff changeset
29 afterEvaluate { project ->
85
f36eeb411845 add sonar publishing
smith@nwoca.org
parents:
diff changeset
30
126
b2532280341e CM-133: switch to sonar-runner
smith@nwoca.org
parents: 119
diff changeset
31 def groovyProject = project.plugins.hasPlugin('groovy')
128
c93df17513f1 CM-133: add jacoco for standard coverage reports. Add sonar properties for SCM and bamboo plan
smith@nwoca.org
parents: 126
diff changeset
32 def javaProject = project.plugins.hasPlugin('java')
c93df17513f1 CM-133: add jacoco for standard coverage reports. Add sonar properties for SCM and bamboo plan
smith@nwoca.org
parents: 126
diff changeset
33
c93df17513f1 CM-133: add jacoco for standard coverage reports. Add sonar properties for SCM and bamboo plan
smith@nwoca.org
parents: 126
diff changeset
34 if (groovyProject || javaProject) {
c93df17513f1 CM-133: add jacoco for standard coverage reports. Add sonar properties for SCM and bamboo plan
smith@nwoca.org
parents: 126
diff changeset
35 project.apply plugin: 'jacoco'
c93df17513f1 CM-133: add jacoco for standard coverage reports. Add sonar properties for SCM and bamboo plan
smith@nwoca.org
parents: 126
diff changeset
36
c93df17513f1 CM-133: add jacoco for standard coverage reports. Add sonar properties for SCM and bamboo plan
smith@nwoca.org
parents: 126
diff changeset
37 project.jacocoTestReport {
c93df17513f1 CM-133: add jacoco for standard coverage reports. Add sonar properties for SCM and bamboo plan
smith@nwoca.org
parents: 126
diff changeset
38 if (groovyProject) {
c93df17513f1 CM-133: add jacoco for standard coverage reports. Add sonar properties for SCM and bamboo plan
smith@nwoca.org
parents: 126
diff changeset
39 sourceDirectories = files(sourceSets.main.allGroovy.srcDirs)
c93df17513f1 CM-133: add jacoco for standard coverage reports. Add sonar properties for SCM and bamboo plan
smith@nwoca.org
parents: 126
diff changeset
40 classDirectories = files(project.sourceSets.main.output.classesDir)
c93df17513f1 CM-133: add jacoco for standard coverage reports. Add sonar properties for SCM and bamboo plan
smith@nwoca.org
parents: 126
diff changeset
41 }
c93df17513f1 CM-133: add jacoco for standard coverage reports. Add sonar properties for SCM and bamboo plan
smith@nwoca.org
parents: 126
diff changeset
42 reports {
c93df17513f1 CM-133: add jacoco for standard coverage reports. Add sonar properties for SCM and bamboo plan
smith@nwoca.org
parents: 126
diff changeset
43 xml.enabled true
c93df17513f1 CM-133: add jacoco for standard coverage reports. Add sonar properties for SCM and bamboo plan
smith@nwoca.org
parents: 126
diff changeset
44 csv.enabled false
c93df17513f1 CM-133: add jacoco for standard coverage reports. Add sonar properties for SCM and bamboo plan
smith@nwoca.org
parents: 126
diff changeset
45 html.enabled true
c93df17513f1 CM-133: add jacoco for standard coverage reports. Add sonar properties for SCM and bamboo plan
smith@nwoca.org
parents: 126
diff changeset
46 }
c93df17513f1 CM-133: add jacoco for standard coverage reports. Add sonar properties for SCM and bamboo plan
smith@nwoca.org
parents: 126
diff changeset
47 }
c93df17513f1 CM-133: add jacoco for standard coverage reports. Add sonar properties for SCM and bamboo plan
smith@nwoca.org
parents: 126
diff changeset
48
c93df17513f1 CM-133: add jacoco for standard coverage reports. Add sonar properties for SCM and bamboo plan
smith@nwoca.org
parents: 126
diff changeset
49 task coverageReport {
c93df17513f1 CM-133: add jacoco for standard coverage reports. Add sonar properties for SCM and bamboo plan
smith@nwoca.org
parents: 126
diff changeset
50 dependsOn jacocoTestReport
c93df17513f1 CM-133: add jacoco for standard coverage reports. Add sonar properties for SCM and bamboo plan
smith@nwoca.org
parents: 126
diff changeset
51 }
c93df17513f1 CM-133: add jacoco for standard coverage reports. Add sonar properties for SCM and bamboo plan
smith@nwoca.org
parents: 126
diff changeset
52
c93df17513f1 CM-133: add jacoco for standard coverage reports. Add sonar properties for SCM and bamboo plan
smith@nwoca.org
parents: 126
diff changeset
53 }
126
b2532280341e CM-133: switch to sonar-runner
smith@nwoca.org
parents: 119
diff changeset
54
b2532280341e CM-133: switch to sonar-runner
smith@nwoca.org
parents: 119
diff changeset
55 sonarRunner {
b2532280341e CM-133: switch to sonar-runner
smith@nwoca.org
parents: 119
diff changeset
56 sonarProperties {
b2532280341e CM-133: switch to sonar-runner
smith@nwoca.org
parents: 119
diff changeset
57 property "sonar.language", groovyProject ? 'grvy' : 'java'
128
c93df17513f1 CM-133: add jacoco for standard coverage reports. Add sonar properties for SCM and bamboo plan
smith@nwoca.org
parents: 126
diff changeset
58 property "sonar.java.coveragePlugin", "jacoco"
c93df17513f1 CM-133: add jacoco for standard coverage reports. Add sonar properties for SCM and bamboo plan
smith@nwoca.org
parents: 126
diff changeset
59 property "sonar.jacoco.reportPath", project.test.jacoco.destPath
c93df17513f1 CM-133: add jacoco for standard coverage reports. Add sonar properties for SCM and bamboo plan
smith@nwoca.org
parents: 126
diff changeset
60 property "sonar.build-stability.url", "http://bamboo.ssdt-ohio.org/browse/${gradle.bambooPlan}"
c93df17513f1 CM-133: add jacoco for standard coverage reports. Add sonar properties for SCM and bamboo plan
smith@nwoca.org
parents: 126
diff changeset
61 property "sonar.scm.url", "scm:hg:${gradle.hgRepositoryUrl}"
85
f36eeb411845 add sonar publishing
smith@nwoca.org
parents:
diff changeset
62 }
f36eeb411845 add sonar publishing
smith@nwoca.org
parents:
diff changeset
63 }
f36eeb411845 add sonar publishing
smith@nwoca.org
parents:
diff changeset
64 }
126
b2532280341e CM-133: switch to sonar-runner
smith@nwoca.org
parents: 119
diff changeset
65 }