android studio 安装 FindBugs-IDEA
File--Settings--Plugins 然后如图 搜索
-
在这里找到
下面代码 添加至 module build.gradle 里
apply plugin: 'findbugs'
task findbugs(type: FindBugs) {
ignoreFailures = true
effort = "default"
reportLevel = "medium"
println( "$project.buildDir")
excludeFilter = new File("${project.rootDir}/findbugs/findbugs-filter.xml")
classes = files("${project.rootDir}/app/build/intermediates/classes")
source = fileTree('src/main/java/')
classes = files("$project.buildDir/intermediates/classes")
source= fileTree("src/main/java/")
classpath = files()
reports {
xml.enabled = true
html.enabled = true
xml {
destination "$project.buildDir/findbugs/findbugs-output.xml"
}
html {
destination "$project.buildDir/findbugs/findbugs-output.html"
}
}
}
-
点击开始