1+ import groovy.xml.XmlUtil
2+
13buildscript {
24 repositories {
35 jcenter()
@@ -85,13 +87,14 @@ def getVersionSimple = { ->
8587 }
8688}
8789
88- configure(allprojects - project(' :ui:linuxLauncher' )) {
90+ configure(subprojects - project(' :ui:linuxLauncher' )) {
8991 apply plugin : ' java'
9092 apply plugin : ' application'
9193 apply plugin : ' jacoco'
9294 apply plugin : ' net.ltgt.errorprone'
9395 apply plugin : ' checkstyle'
9496 apply plugin : ' pmd'
97+ apply plugin : ' findbugs'
9598
9699 configurations. errorprone {
97100 resolutionStrategy. force ' com.google.errorprone:error_prone_core:2.0.9'
@@ -119,6 +122,30 @@ configure(allprojects - project(':ui:linuxLauncher')) {
119122 ruleSets = []
120123 }
121124
125+ findbugs {
126+ sourceSets = [sourceSets. main]
127+ excludeFilter = new File (rootDir, " findBugsSuppressions.xml" )
128+ effort = " max"
129+ }
130+
131+ ext. printReportSafe = { xmlReport ->
132+ if (xmlReport. exists()) {
133+ def bugs = (new XmlParser (). parse(xmlReport)). BugInstance
134+ bugs. each { System . out. println (new XmlUtil (). serialize(it)) }
135+ }
136+ }
137+
138+ task findbugsMainReport << {
139+ printReportSafe(findbugsMain. reports. getXml(). destination)
140+ }
141+
142+ task findbugsTestReport << {
143+ printReportSafe(findbugsTest. reports. getXml(). destination)
144+ }
145+
146+ findbugsMain. finalizedBy findbugsMainReport
147+ findbugsTest. finalizedBy findbugsTestReport
148+
122149 repositories {
123150 mavenCentral()
124151 jcenter()
@@ -129,6 +156,7 @@ configure(allprojects - project(':ui:linuxLauncher')) {
129156
130157
131158 dependencies {
159+ compile group : ' com.google.code.findbugs' , name : ' annotations' , version : ' 3.0.1'
132160 testCompile group : ' net.jodah' , name : ' concurrentunit' , version : ' 0.4.2'
133161 testCompile group : ' org.hamcrest' , name : ' hamcrest-all' , version : ' 1.3'
134162 testCompile group : ' junit' , name : ' junit' , version : ' 4.12'
0 commit comments