view metrics.gradle @ 219:efa545c6dd65

DEP-11: implement release process as gradle rule
author smith@nwoca.org
date Fri, 01 Jul 2016 20:56:04 +0100
parents 0ca4f3c952b7
children 47535c8358ce
line wrap: on
line source
apply plugin: "sonar-runner"
ant.property(file: System.getProperty('user.home') + "/.ssdt/sonar.properties")

buildscript {
    repositories {
        maven { url 'http://repos.ssdt.nwoca.org/artifactory/gradle-plugins' }
        maven { url 'http://repos.ssdt.nwoca.org/artifactory/repo' }
    }
    dependencies {
        classpath 'me.davesmith:jaranalyzerplugin:0.2.0-SNAPSHOT'
    }
}

apply plugin: me.davesmith.gradle.plugins.jaranalyzer.JarAnalyzerPlugin

jaranalyzer {
    dot = true
    packageFilter += 'org.slf4j*'
    packageFilter += 'groovyx.*'
}

sonarRunner {
    sonarProperties {
        property "sonar.host.url", "http://sonar.ssdt-ohio.org/"
        property "sonar.jdbc.url", ant.properties['sonar.jdbc.url']
        property "sonar.jdbc.driverClassName", ant.properties['sonar.jdbc.driverClassName']
        property "sonar.jdbc.username", ant.properties['sonar.jdbc.username']
        property "sonar.jdbc.password", ant.properties['sonar.jdbc.password']
        property "sonar.build-stability.url", "http://bamboo.ssdt-ohio.org/browse/${gradle.bambooPlan}"
        property "sonar.scm.url", "scm:hg:${gradle.hgRepositoryUrl}"
    }
}

subprojects {
    afterEvaluate { project ->

        def groovyProject = project.plugins.hasPlugin('groovy')
        sonarRunner {
            sonarProperties {
                property "sonar.language", groovyProject ? 'grvy' : 'java'
                property "sonar.build-stability.url", "http://bamboo.ssdt-ohio.org/browse/${gradle.bambooPlan}"
                property "sonar.scm.url", "scm:hg:${gradle.hgRepositoryUrl}"
            }
        }
    }
}

allprojects {
    afterEvaluate { project ->	
		project.getTasksByName('sonarRunner',false).each { it.enabled = gradle.branchStream == 'develop' }
	}
}