def isCI = System.getenv("CI") != null

allprojects {
  apply plugin: 'com.github.spotbugs'

  spotbugs {
    ignoreFailures = false
    reportLevel = "high"
    omitVisitors = ["FindDeadLocalStores"]
    effort = "max"
    excludeFilter = file("$rootDir/gradle/spotbugs-exclude.xml")
  }

  spotbugsTest {
    reports {
      html.enabled = !isCI
      xml.enabled = isCI
      html {
        stylesheet = 'fancy-hist.xsl'
      }
    }
  }
  spotbugsMain {
    reports {
      html.enabled = !isCI
      xml.enabled = isCI
      html {
        stylesheet = 'fancy-hist.xsl'
      }
    }
  }
}
