update spotbugs config

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2022-10-10 17:06:43 +02:00
parent 9fdc1c2a6e
commit d7807f64d3
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B

View file

@ -120,29 +120,6 @@ android {
}
}
android.applicationVariants.all { variant ->
String variantName = variant.name
String capVariantName = variantName.substring(0, 1).toUpperCase(Locale.ROOT) + variantName.substring(1)
tasks.register("spotbugs${capVariantName}Report", SpotBugsTask) {
ignoreFailures = true // should continue checking
effort = "max"
reportLevel = "medium"
classes = fileTree("$project.buildDir/intermediates/javac/${variantName}/classes/")
excludeFilter = file("${project.rootDir}/spotbugs-filter.xml")
reports {
xml {
required = true
}
html {
required = true
outputLocation = file("$project.buildDir/reports/spotbugs/spotbugs.html")
stylesheet = 'fancy.xsl'
}
}
}
}
check.dependsOn 'spotbugsGplayDebug', 'lint', 'ktlintCheck', 'detekt'
compileOptions {
@ -349,6 +326,32 @@ task installGitHooks(type: Copy, group: "development") {
into '../.git/hooks'
}
spotbugs {
ignoreFailures = true // should continue checking
effort = "max"
reportLevel = "medium"
}
tasks.withType(SpotBugsTask) { task ->
String variantNameCap = task.name.replace("spotbugs", "")
String variantName = variantNameCap.substring(0, 1).toLowerCase() + variantNameCap.substring(1)
dependsOn "compile${variantNameCap}Sources"
excludeFilter = file("${project.rootDir}/spotbugs-filter.xml")
classes = fileTree("$project.buildDir/intermediates/javac/${variantName}/classes/")
reports {
xml {
required = true
}
html {
required = true
outputLocation = file("$project.buildDir/reports/spotbugs/spotbugs.html")
stylesheet = 'fancy.xsl'
}
}
}
tasks.named("detekt").configure {
reports {
html.required.set(true)