diff metrics40.gradle @ 263:0a6a5a7470c4

add scripts for gradle 4+ to use new gradle dependency locking and cleanup accumulated clutter
author smith@nwoca.org
date Tue, 13 Nov 2018 18:14:45 +0000
parents metrics.gradle@46064f36ae31
children 2f6d25a71778
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/metrics40.gradle	Tue Nov 13 18:14:45 2018 +0000
@@ -0,0 +1,44 @@
+import org.gradle.api.Plugin
+import org.gradle.api.Project
+import org.gradle.api.tasks.bundling.Jar
+
+import org.gradle.api.DefaultTask
+import org.gradle.api.tasks.OutputDirectory
+import org.gradle.api.tasks.OutputFile
+import org.gradle.api.tasks.TaskAction
+
+import java.util.jar.JarFile
+
+final GradleVersion gradleCurrent = GradleVersion.current()
+final GradleVersion gradleV31 = GradleVersion.version('3.1')
+
+
+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 "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6"
+    }
+}
+
+apply plugin: org.sonarqube.gradle.SonarQubePlugin
+
+sonarqube {
+    properties {
+        property "sonar.host.url", "http://sonar.ssdt.io:9000"
+        property "sonar.login", System.getenv('bamboo_SONAR_TOKEN')
+        property "sonar.exclusions","**/ProjectVersion*"
+    }
+}
+
+allprojects {
+    afterEvaluate { project ->	
+        project.getTasksByName('sonarqube',false).each { 
+            it.enabled = gradle.branchStream in ['release']
+        }
+    }
+}