groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject groovy git commit: GROOVY-8664: ignore spotbugs under JDK7
Date Tue, 03 Jul 2018 11:54:49 GMT
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_5_X 732c8c5ac -> 7b1d89990


GROOVY-8664: ignore spotbugs under JDK7


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/7b1d8999
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/7b1d8999
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/7b1d8999

Branch: refs/heads/GROOVY_2_5_X
Commit: 7b1d899903bfb8099ba369d983c09455f5d86fd5
Parents: 732c8c5
Author: Paul King <paulk@asert.com.au>
Authored: Tue Jul 3 21:54:43 2018 +1000
Committer: Paul King <paulk@asert.com.au>
Committed: Tue Jul 3 21:54:43 2018 +1000

----------------------------------------------------------------------
 build.gradle          |  9 ++++++---
 gradle/quality.gradle | 36 ++++++++++++++++++++----------------
 2 files changed, 26 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/7b1d8999/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 2c1c8c9..3473ef1 100644
--- a/build.gradle
+++ b/build.gradle
@@ -42,14 +42,15 @@ buildscript {
         //classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0'
         classpath "gradle.plugin.org.nosphere.apache:creadur-rat-gradle:0.1.3"
         classpath "gradle.plugin.com.github.jk1:gradle-license-report:0.3.2"
-
+        if (JavaVersion.current() >= JavaVersion.VERSION_1_8) {
+            classpath "gradle.plugin.com.github.spotbugs:spotbugs-gradle-plugin:1.6.2"
+        }
     }
 }
 
 plugins {
     id 'com.gradle.build-scan' version '1.13.4'
     id 'me.champeau.buildscan-recipes' version '0.2.3'
-    id 'com.github.spotbugs' version '1.6.2'
 }
 
 buildScan {
@@ -475,7 +476,9 @@ if (!JavaVersion.current().java8Compatible) {
 
 // Workaround to be able to access SpotBugsTask from external gradle script.
 // More info: https://discuss.gradle.org/t/buildscript-dependencies-in-external-script/23243
-project.extensions.extraProperties.set('SpotBugsTask', com.github.spotbugs.SpotBugsTask)
+if (JavaVersion.current() >= JavaVersion.VERSION_1_8) {
+    project.extensions.extraProperties.set('SpotBugsTask', com.github.spotbugs.SpotBugsTask)
+}
 
 apply from: 'gradle/test.gradle'
 apply from: 'gradle/groovydoc.gradle'

http://git-wip-us.apache.org/repos/asf/groovy/blob/7b1d8999/gradle/quality.gradle
----------------------------------------------------------------------
diff --git a/gradle/quality.gradle b/gradle/quality.gradle
index c30f37f..591b069 100644
--- a/gradle/quality.gradle
+++ b/gradle/quality.gradle
@@ -24,7 +24,9 @@ allprojects {
     //apply plugin: "com.github.hierynomus.license"
     apply plugin: 'checkstyle'
     apply plugin: 'codenarc'
-    apply plugin: 'com.github.spotbugs'
+    if (JavaVersion.current() >= JavaVersion.VERSION_1_8) {
+        apply plugin: 'com.github.spotbugs'
+    }
     configurations.codenarc {
         // because we will rely on the version we build
         // because version ranges are evil
@@ -127,23 +129,25 @@ allprojects {
         }
     }
 
-    spotbugs {
-        toolVersion = '3.1.1'
-        // continue build despite findbug warnings
-        ignoreFailures = true
-        //defining source set is needless
-        //just run ./gradlew spotbugsMain then it will parse src/main/java.
-        //To parse test cases, you need to use ./gradlew spotbugsTest.
-    }
+    if (JavaVersion.current() >= JavaVersion.VERSION_1_8) {
+        spotbugs {
+            toolVersion = '3.1.1'
+            // continue build despite findbug warnings
+            ignoreFailures = true
+            //defining source set is needless
+            //just run ./gradlew spotbugsMain then it will parse src/main/java.
+            //To parse test cases, you need to use ./gradlew spotbugsTest.
+        }
 
-    // To generate an HTML report instead of XML
-    tasks.withType(SpotBugsTask) {
-        effort = 'max'
-        reports {
-            xml.enabled = false
-            html.enabled = true
+        // To generate an HTML report instead of XML
+        tasks.withType(SpotBugsTask) {
+            effort = 'max'
+            reports {
+                xml.enabled = false
+                html.enabled = true
+            }
+            maxHeapSize '2g'
         }
-        maxHeapSize '2g'
     }
 }
 


Mime
View raw message