Mercurial > public > develkit
changeset 127:2a4ea22a6dd3
merge
author | smith@nwoca.org |
---|---|
date | Tue, 04 Jun 2013 16:51:29 +0100 |
parents | b2532280341e (diff) 37e527f414c4 (current diff) |
children | c93df17513f1 |
files | |
diffstat | 3 files changed, 44 insertions(+), 86 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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"] }
--- 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 +}