From 91e0979f803b32ef9d4f1b522fed0db6d71cd7ce Mon Sep 17 00:00:00 2001
From: hansen <dominik_hansen@web.de>
Date: Sat, 18 Jul 2015 15:49:35 +0200
Subject: [PATCH] disable findbugs by default

---
 build.gradle | 38 ++++++++++++--------------------------
 1 file changed, 12 insertions(+), 26 deletions(-)

diff --git a/build.gradle b/build.gradle
index b1d5964..048c586 100644
--- a/build.gradle
+++ b/build.gradle
@@ -2,11 +2,12 @@ apply plugin: 'java'
 apply plugin: 'eclipse'
 apply plugin: 'maven'
 apply plugin: 'jacoco'
+apply plugin: 'findbugs'
 
 project.version = '1.0.0-SNAPSHOT'
 project.group = 'de.prob'
 
-//sourceCompatibility = 1.5
+sourceCompatibility = 1.5
 
 repositories {
 	mavenCentral()
@@ -104,31 +105,16 @@ task tlc4b(dependsOn: build) << {
 	}
 }
 
-task all(dependsOn: tlc4b) <<{
-	ant.get(src: 'http://tla.msr-inria.inria.fr/tlatoolbox/dist/tla2tools.jar', verbose:true, dest: 'build/tlc4b/')
-}
-
-allprojects {
-	// Marker Task to enable findbugs.
-	task findbugs(
-		group: "Verification",
-		description: """Marker task to enabled findbugs. Findbugs is by default
-                        disabled. E.g. ( ./gradlew findbugs build )"""
-	)
-}
- 
-subprojects {
-	apply plugin: 'findbugs'
+tasks.withType(FindBugs) {
+	// disable findbugs by default
+	// in order to run findbugs type 'gradle tlc4b findbugsMain findbugsTest'
+	task -> enabled = gradle.startParameter.taskNames.contains(task.name)
 	
-	findbugs {
-		// your findbugs configuration.
-		ignoreFailures = true
-		
-	}
-	gradle.taskGraph.whenReady { taskGraph ->
-		tasks.findbugsMain.onlyIf { taskGraph.hasTask((tasks.findbugs)) }
-		tasks.findbugsTest.onlyIf { taskGraph.hasTask((tasks.findbugs)) }
-	}
+    reports {
+        xml.enabled = false
+        html.enabled = true
+    }
+	
+	ignoreFailures = true
 }
 
-
-- 
GitLab