将 Android Gradle 插件从 3.1.3 升级到 3.2.0 后,FindBugs 停止工作
FindBugs stopped working after upgrading Android Gradle Plugin from 3.1.3 to 3.2.0
我在 Android 项目中使用 FindBugs 进行静态代码分析。设置如下:
quality.gradle
plugins.apply('findbugs')
task findbugs(type: FindBugs) {
ignoreFailures = false
effort = 'max'
reportLevel = 'high' // Report only high priority problems.
classes = files("${project.projectDir}/build/intermediates/classes")
source = fileTree('src/main/java')
classpath = files()
reports {
xml.enabled = true
html.enabled = false
}
excludeFilter = rootProject.file('quality/findbugs.xml')
}
build.gradle:
subprojects {
afterEvaluate {
project.apply from: '../quality/quality.gradle'
tasks.findByName('findbugs').dependsOn('assemble')
tasks.findByName('check').dependsOn('findbugs')
}
}
但是在我将 Gradle Android 插件从 3.1.3 升级到 3.2.0 之后,构建开始失败:
./gradlew clean build
> Task :app:findbugs FAILED
No files to be analyzed
...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:findbugs'.
> Failed to run Gradle FindBugs Worker
> Process 'Gradle FindBugs Worker 6' finished with non-zero exit value 1
降级到 3.1.3 使构建再次通过。我没有在 Gradle Android 插件的 changelog 中找到任何相关内容。谁能指出我的插件或我的设置有什么问题吗?
我在 Android 项目中使用 FindBugs 进行静态代码分析。设置如下:
quality.gradle
plugins.apply('findbugs')
task findbugs(type: FindBugs) {
ignoreFailures = false
effort = 'max'
reportLevel = 'high' // Report only high priority problems.
classes = files("${project.projectDir}/build/intermediates/classes")
source = fileTree('src/main/java')
classpath = files()
reports {
xml.enabled = true
html.enabled = false
}
excludeFilter = rootProject.file('quality/findbugs.xml')
}
build.gradle:
subprojects {
afterEvaluate {
project.apply from: '../quality/quality.gradle'
tasks.findByName('findbugs').dependsOn('assemble')
tasks.findByName('check').dependsOn('findbugs')
}
}
但是在我将 Gradle Android 插件从 3.1.3 升级到 3.2.0 之后,构建开始失败:
./gradlew clean build
> Task :app:findbugs FAILED
No files to be analyzed
...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:findbugs'.
> Failed to run Gradle FindBugs Worker
> Process 'Gradle FindBugs Worker 6' finished with non-zero exit value 1
降级到 3.1.3 使构建再次通过。我没有在 Gradle Android 插件的 changelog 中找到任何相关内容。谁能指出我的插件或我的设置有什么问题吗?