opentelemetry-java-instrume.../gradle/spotbugs.gradle

27 lines
620 B
Groovy

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")
}
// NB: For some reason, SpotBugsTask can't be referenced even when importing it.
tasks.withType(VerificationTask).configureEach {
if (name.startsWith("spotbugs")) {
reports {
html.enabled = !isCI
xml.enabled = isCI
html {
stylesheet = 'fancy-hist.xsl'
}
}
}
}
}