diff metrics.gradle @ 248:c8c8766492c5

USASR-2891: Update metrics.gradle to support update to Gradle v4.2.1 and Sonar v2.5
author Christopher Springer <springer@nwoca.org>
date Mon, 23 Oct 2017 18:52:24 +0100
parents 60c552fce00d
children 969e33b82a99
line wrap: on
line diff
--- a/metrics.gradle	Fri Jul 14 18:21:46 2017 +0100
+++ b/metrics.gradle	Mon Oct 23 18:52:24 2017 +0100
@@ -5,13 +5,15 @@
 final boolean newSonar = !legacySonar
 
 buildscript {
+    final GradleVersion gradleV421 = GradleVersion.version('4.2.1')
+
     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'
-        classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.2"
+        classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:${GradleVersion.current() >= gradleV421 ? '2.5' : '2.2'}"
     }
 }
 
@@ -51,4 +53,4 @@
         println "legacy sonar disabled"
    }
 
-}
\ No newline at end of file
+}