annotate metrics.gradle @ 232:47535c8358ce

DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
author smith@nwoca.org
date Tue, 18 Oct 2016 18:29:04 +0100
parents 0ca4f3c952b7
children 400f9d8bbf5b
rev   line source
232
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
1 final GradleVersion gradleCurrent = GradleVersion.current()
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
2 final GradleVersion gradleV31 = GradleVersion.version('3.1')
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
3
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
4 final boolean legacySonar = gradleCurrent < gradleV31
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
5
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
6 if (legacySonar) {
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
7 apply plugin: "sonar-runner"
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
8 ant.property(file: System.getProperty('user.home') + "/.ssdt/sonar.properties")
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
9 }
85
f36eeb411845 add sonar publishing
smith@nwoca.org
parents:
diff changeset
10
f36eeb411845 add sonar publishing
smith@nwoca.org
parents:
diff changeset
11 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
12 repositories {
85
f36eeb411845 add sonar publishing
smith@nwoca.org
parents:
diff changeset
13 maven { url 'http://repos.ssdt.nwoca.org/artifactory/gradle-plugins' }
134
afafe40ae5a9 add jaranalyzer plugin
smith@nwoca.org
parents: 133
diff changeset
14 maven { url 'http://repos.ssdt.nwoca.org/artifactory/repo' }
afafe40ae5a9 add jaranalyzer plugin
smith@nwoca.org
parents: 133
diff changeset
15 }
afafe40ae5a9 add jaranalyzer plugin
smith@nwoca.org
parents: 133
diff changeset
16 dependencies {
135
51e4ee02d47a update jaranalyzerplugin version
smith@nwoca.org
parents: 134
diff changeset
17 classpath 'me.davesmith:jaranalyzerplugin:0.2.0-SNAPSHOT'
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
18 }
85
f36eeb411845 add sonar publishing
smith@nwoca.org
parents:
diff changeset
19 }
f36eeb411845 add sonar publishing
smith@nwoca.org
parents:
diff changeset
20
134
afafe40ae5a9 add jaranalyzer plugin
smith@nwoca.org
parents: 133
diff changeset
21 apply plugin: me.davesmith.gradle.plugins.jaranalyzer.JarAnalyzerPlugin
afafe40ae5a9 add jaranalyzer plugin
smith@nwoca.org
parents: 133
diff changeset
22
afafe40ae5a9 add jaranalyzer plugin
smith@nwoca.org
parents: 133
diff changeset
23 jaranalyzer {
afafe40ae5a9 add jaranalyzer plugin
smith@nwoca.org
parents: 133
diff changeset
24 dot = true
afafe40ae5a9 add jaranalyzer plugin
smith@nwoca.org
parents: 133
diff changeset
25 packageFilter += 'org.slf4j*'
afafe40ae5a9 add jaranalyzer plugin
smith@nwoca.org
parents: 133
diff changeset
26 packageFilter += 'groovyx.*'
afafe40ae5a9 add jaranalyzer plugin
smith@nwoca.org
parents: 133
diff changeset
27 }
afafe40ae5a9 add jaranalyzer plugin
smith@nwoca.org
parents: 133
diff changeset
28
232
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
29 if (!legacySonar) {
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
30
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
31 task('sonar') << {
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
32 println "sonar analysis currently disabled"
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
33 }
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
34
85
f36eeb411845 add sonar publishing
smith@nwoca.org
parents:
diff changeset
35 }
126
b2532280341e CM-133: switch to sonar-runner
smith@nwoca.org
parents: 119
diff changeset
36
232
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
37 if (legacySonar) {
85
f36eeb411845 add sonar publishing
smith@nwoca.org
parents:
diff changeset
38
232
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
39 sonarRunner {
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
40 sonarProperties {
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
41 property "sonar.host.url", "http://sonar.ssdt-ohio.org/"
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
42 property "sonar.jdbc.url", ant.properties['sonar.jdbc.url']
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
43 property "sonar.jdbc.driverClassName", ant.properties['sonar.jdbc.driverClassName']
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
44 property "sonar.jdbc.username", ant.properties['sonar.jdbc.username']
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
45 property "sonar.jdbc.password", ant.properties['sonar.jdbc.password']
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
46 property "sonar.build-stability.url", "http://bamboo.ssdt-ohio.org/browse/${gradle.bambooPlan}"
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
47 property "sonar.scm.url", "scm:hg:${gradle.hgRepositoryUrl}"
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
48 }
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
49 }
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
50
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
51 subprojects {
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
52 afterEvaluate { project ->
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
53
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
54 def groovyProject = project.plugins.hasPlugin('groovy')
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
55 sonarRunner {
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
56 sonarProperties {
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
57 property "sonar.language", groovyProject ? 'grvy' : 'java'
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
58 property "sonar.build-stability.url", "http://bamboo.ssdt-ohio.org/browse/${gradle.bambooPlan}"
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
59 property "sonar.scm.url", "scm:hg:${gradle.hgRepositoryUrl}"
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
60 }
85
f36eeb411845 add sonar publishing
smith@nwoca.org
parents:
diff changeset
61 }
f36eeb411845 add sonar publishing
smith@nwoca.org
parents:
diff changeset
62 }
f36eeb411845 add sonar publishing
smith@nwoca.org
parents:
diff changeset
63 }
142
45d2396e9fc8 configure sonar to publish only for 'develop' builts.
Dave Smith <smith@nwoca.org>
parents: 135
diff changeset
64
232
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
65 allprojects {
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
66 afterEvaluate { project ->
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
67 project.getTasksByName('sonarRunner',false).each { it.enabled = gradle.branchStream == 'develop' }
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
68 }
47535c8358ce DEP-13: adjust init script to handle both 2.+ and 3.1. Disable sonar for 3.1+
smith@nwoca.org
parents: 214
diff changeset
69 }
142
45d2396e9fc8 configure sonar to publish only for 'develop' builts.
Dave Smith <smith@nwoca.org>
parents: 135
diff changeset
70 }