Gradle Findbugs disabled by default
Gradle Findbugs: A gradle script which disables findbugs until "findbugs" task is in the task graph.
allprojects {
// Marker Task to enable findbugs.
task findbugs(
group: "Verification",
description: "Marker task to enabled findbugs."
)
}
subprojects {
apply plugin: 'findbugs'
findbugs {
// your findbugs configuration.
ignoreFailures = true
}
gradle.taskGraph.whenReady { taskGraph ->
tasks.findbugsMain.onlyIf {
taskGraph.hasTask((tasks.findbugs))
}
tasks.findbugsTest.onlyIf {
taskGraph.hasTask((tasks.findbugs))
}
}
}
Now findbugs will only be executed if you do following:
gradlew findbugs build
Written by Chilicat
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#