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:switch from findbugs to spotbugs (closes #766)
Date Tue, 03 Jul 2018 11:09:35 GMT
Repository: groovy
Updated Branches:
  refs/heads/master 3ed6a85ba -> 82586f5f4


GROOVY-8664:switch from findbugs to spotbugs (closes #766)


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

Branch: refs/heads/master
Commit: 82586f5f43f60bd7cf3fcf752b3e7d3f909f42ac
Parents: 3ed6a85
Author: Shruti Gupta <shrgupt@microsoft.com>
Authored: Mon Jul 2 22:55:43 2018 +0530
Committer: Paul King <paulk@asert.com.au>
Committed: Tue Jul 3 21:09:22 2018 +1000

----------------------------------------------------------------------
 build.gradle          |  7 ++++++-
 gradle/quality.gradle | 15 ++++++++++-----
 2 files changed, 16 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/82586f5f/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 20841dc..6164584 100644
--- a/build.gradle
+++ b/build.gradle
@@ -52,6 +52,7 @@ buildscript {
 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 {
@@ -195,7 +196,7 @@ dependencies {
     }
     compile files("${buildDir}/generated-classes")
 
-    compileOnly "com.google.code.findbugs:jsr305:$jsr305Version"
+    compileOnly 'com.github.spotbugs:spotbugs-annotations:3.1.3'
 
     runtime("org.codehaus.gpars:gpars:$gparsVersion") {
         exclude(group: 'org.codehaus.groovy', module: 'groovy-all')
@@ -469,6 +470,10 @@ 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)
+
 apply from: 'gradle/test.gradle'
 apply from: 'gradle/groovydoc.gradle'
 apply from: 'gradle/docs.gradle'

http://git-wip-us.apache.org/repos/asf/groovy/blob/82586f5f/gradle/quality.gradle
----------------------------------------------------------------------
diff --git a/gradle/quality.gradle b/gradle/quality.gradle
index b05b246..9242153 100644
--- a/gradle/quality.gradle
+++ b/gradle/quality.gradle
@@ -24,7 +24,7 @@ allprojects {
     //apply plugin: "com.github.hierynomus.license"
     apply plugin: 'checkstyle'
     apply plugin: 'codenarc'
-    apply plugin: 'findbugs'
+    apply plugin: 'com.github.spotbugs'
     configurations.codenarc {
         // because we will rely on the version we build
         // because version ranges are evil
@@ -127,18 +127,23 @@ allprojects {
         }
     }
 
-    findbugs {
+    spotbugs {
+        toolVersion = '3.1.1'
         // continue build despite findbug warnings
         ignoreFailures = true
-        sourceSets = [sourceSets.main]
+        //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.
     }
-    tasks.withType(FindBugs) {
+
+    // 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