# HG changeset patch # User smith@nwoca.org # Date 1370361089 -3600 # Node ID 2a4ea22a6dd368c98db68fec6453cf3b287b891f # Parent b2532280341e7b5f3148fd253a32c771af150560# Parent 37e527f414c47a54e09b473c82d6350cbaf01505 merge diff -r 37e527f414c4 -r 2a4ea22a6dd3 .hgignore --- a/.hgignore Wed Apr 10 15:42:13 2013 +0100 +++ b/.hgignore Tue Jun 04 16:51:29 2013 +0100 @@ -3,4 +3,20 @@ \.chg\..*$ \.rej$ \.conflict\~$ -~$ +.*~$ +glob:out/* +glob:lib/* +glob:build/* +glob:dist/* +glob:nbproject/* +glob:.idea/workspace.* +glob:*.log +glob:.gradle/* +glob:.idea/* +glob:*.iml +glob:*.iws +glob:*.ipr +glob:gradle-app.* +glob:build.xml +glob:private*.* +glob:*.pdf diff -r 37e527f414c4 -r 2a4ea22a6dd3 init.gradle --- a/init.gradle Wed Apr 10 15:42:13 2013 +0100 +++ b/init.gradle Tue Jun 04 16:51:29 2013 +0100 @@ -49,6 +49,15 @@ apply from: "${gradle.ssdtGradlekitLocation}/artifactory.gradle" } + +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' } + } +} + apply from: "${gradle.ssdtDevelkitLocation}/metrics.gradle" task wrapper(type: Wrapper) {} @@ -145,7 +154,7 @@ } } - thisProject.tasks.add("publishLocal") { + thisProject.tasks.create("publishLocal") { description = "Publishes this projects artifacts to developer's local repository" dependsOn = ["uploadArchives"] } diff -r 37e527f414c4 -r 2a4ea22a6dd3 metrics.gradle --- a/metrics.gradle Wed Apr 10 15:42:13 2013 +0100 +++ b/metrics.gradle Tue Jun 04 16:51:29 2013 +0100 @@ -1,7 +1,5 @@ -apply plugin: "sonar" - -gradle.addListener(new SsdtSonarSettings()) +apply plugin: "sonar-runner" ant.property(file: System.getProperty('user.home') + "/.ssdt/sonar.properties") @@ -17,90 +15,25 @@ } } - -sonar { - server { - url = "http://sonar.ssdt-ohio.org" - } - database { - url = ant.properties['sonar.jdbc.url'] - driverClassName = ant.properties['sonar.jdbc.driverClassName'] - username = ant.properties['sonar.jdbc.username'] - password = ant.properties['sonar.jdbc.password'] - } - project { - dynamicAnalysis = "reuseReports" - sourceEncoding = "UTF-8" - } - withGlobalProperties { props -> - props["sonar.language"] = "grvy" - props['sonar.core.codeCoveragePlugin'] = 'cobertura' +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'] } } - -class SsdtSonarSettings extends BuildAdapter implements BuildListener { - - def void projectsEvaluated(Gradle gradle) { - Project root = gradle.getRootProject() + +allprojects { + afterEvaluate { project -> - def testableProjects = root.allprojects.findAll { it.configurations.any { it.name.contains('test') } } - - root.configure(testableProjects) { p -> - def usesGroovy = configurations.any { it.name == 'groovy' } - apply plugin: net.saliman.gradle.plugin.cobertura.CoberturaPlugin - - sonar { - project { - language = usesGroovy ? 'groovy' : 'java' - dynamicAnalysis = "reuseReports" - sourceEncoding = "UTF-8" - coberturaReportPath = file("${reporting.baseDir}/cobertura/coverage.xml") - withProjectProperties { props -> - if (usesGroovy) { - println "setting groovy profile on $p" - props['sonar.profile'] = 'SSDT Groovy Way' - } - props['sonar.core.codeCoveragePlugin'] = 'cobertura' - props['sonar.cobertura.reportPath'] = "${reporting.baseDir}/cobertura/coverage.xml" - props["sonar.cpd.skip"] = true - props['sonar.language'] = usesGroovy ? 'grvy' : 'java' - } - } - + def groovyProject = project.plugins.hasPlugin('groovy') + + sonarRunner { + sonarProperties { + property "sonar.language", groovyProject ? 'grvy' : 'java' } - - cobertura { - if (usesGroovy) { - coverageSourceDirs = sourceSets.main.groovy.srcDirs - } - if (gradle.bambooBuild) { - coverageFormat = 'xml' - } - } - - if (gradle.bambooBuild) { - build.dependsOn 'cobertura' - } - - } - - root.allprojects { - - def thisProject = delegate - def usesGroovy = thisProject.configurations.any { it.name == 'groovy' } - - sonar { - project { - language = usesGroovy ? 'groovy' : 'java' - dynamicAnalysis = "reuseReports" - sourceEncoding = "UTF-8" - withProjectProperties { props -> - props['sonar.core.codeCoveragePlugin'] = 'cobertura' - props['sonar.language'] = usesGroovy ? 'grvy' : 'java' - } - } - } - } } -} \ No newline at end of file +}