Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:8.2.2'
classpath 'gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.7.5'
classpath 'com.github.spotbugs.snom:spotbugs-gradle-plugin:6.0.7'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.23.4"
}
Expand Down
36 changes: 21 additions & 15 deletions lib/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import com.github.spotbugs.snom.SpotBugsTask
import com.github.spotbugs.snom.Confidence
import com.github.spotbugs.snom.Effort

repositories {
google()
Expand All @@ -15,8 +17,9 @@ apply plugin: 'maven-publish' // needed for JitPack.io
group = 'com.github.nextcloud'

spotbugs {
toolVersion = '4.8.3'
ignoreFailures = true
ignoreFailures = true // should continue checking
effort = Effort.MAX
reportLevel = Confidence.valueOf('MEDIUM')
}

configurations {
Expand Down Expand Up @@ -65,20 +68,23 @@ android {
htmlOutput file("$project.layout.buildDirectory/reports/lint/lint.html")
htmlReport true
}
}

tasks.register("spotbugsDebugReport", SpotBugsTask) {
ignoreFailures = true
effort = "max"
reportLevel = "medium"
classes = fileTree("$project.layout.buildDirectory/intermediates/javac/debug/classes/")
excludeFilter = file("${project.rootDir}/spotbugs-filter.xml")

reports {
xml.enabled = false
html {
enabled = true
destination = file("$project.layout.buildDirectory/reports/spotbugs/spotbugs.html")
}
tasks.withType(SpotBugsTask).configureEach { task ->
String variantNameCap = task.name.replace("spotbugs", "")

dependsOn "compile${variantNameCap}Sources"

excludeFilter.set(file("${project.rootDir}/spotbugs-filter.xml"))
classes = fileTree("$project.layout.buildDirectory/intermediates/javac/debug/classes/")
reports {
xml {
required = true
}
html {
required = true
outputLocation = file("$project.layout.buildDirectory/reports/spotbugs/spotbugs.html")
stylesheet = 'fancy.xsl'
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/analysis/findbugs-up.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
# run FindBugs
puts "running FindBugs..."
system './gradlew lib:assembleDebug'
system './gradlew lib:spotbugsDebugReport'
system './gradlew lib:spotbugsDebug'

# find FindBugs report file
findbugs_reports = Dir.glob(FINDBUGS_REPORT_FILE)
Expand Down