From fe813a97d4439348067a83babcaf80b84225dc21 Mon Sep 17 00:00:00 2001
From: hansen <dominik_hansen@web.de>
Date: Thu, 21 May 2015 15:34:09 +0200
Subject: [PATCH] updated gradle file

---
 build.gradle | 36 +++++++++++++++++++++++-------------
 1 file changed, 23 insertions(+), 13 deletions(-)

diff --git a/build.gradle b/build.gradle
index 955cd14..1473342 100644
--- a/build.gradle
+++ b/build.gradle
@@ -2,7 +2,6 @@ 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'
@@ -58,18 +57,6 @@ jacocoTestReport {
     }
 }
 
-tasks.withType(FindBugs) {
-    reports {
-        xml.enabled = false
-        html.enabled = true
-    }
-}
-
-findbugs { 
-	ignoreFailures = true 
-} 
- 
-
 
 test { 
 	exclude('de/tlc4b/tlc/integration/probprivate')
@@ -110,4 +97,27 @@ 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'
+	
+	findbugs {
+		// your findbugs configuration.
+		ignoreFailures = true
+		
+	}
+	gradle.taskGraph.whenReady { taskGraph ->
+		tasks.findbugsMain.onlyIf { taskGraph.hasTask((tasks.findbugs)) }
+		tasks.findbugsTest.onlyIf { taskGraph.hasTask((tasks.findbugs)) }
+	}
+}
+
 
-- 
GitLab