File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -107,17 +107,28 @@ allprojects {
107107 it. dependsOn = []
108108 }
109109
110- tasks. withType(FindBugs ) {
111- it. dependsOn = []
112- }
113-
114110 findbugs {
115- // toolVersion = "2.0.1"
116111 sourceSets = [sourceSets. main]
117112 excludeFilter = new File (rootDir, " findBugsSuppressions.xml" )
118113 effort = " max"
119114 }
120115
116+ task checkFindBugsReport << {
117+ try {
118+ def xmlReport = findbugsMain. reports. getXml()
119+ def slurped = new XmlSlurper (). parse(xmlReport. destination)
120+ def bugsFound = slurped.BugInstance . size()
121+ if (bugsFound > 0 ) {
122+ new XmlNodePrinter (). printList(slurped.BugInstance . list())
123+ throw new GradleException (" $bugsFound FindBugs rule violations were found. See the report at: $xmlReport . destination " )
124+ }
125+ } catch (Exception e) {
126+
127+ }
128+ }
129+
130+ findbugsMain. finalizedBy checkFindBugsReport
131+
121132 repositories {
122133 mavenCentral()
123134 jcenter()
You can’t perform that action at this time.
0 commit comments