Last active
January 18, 2018 20:20
-
-
Save chilicat/5187398 to your computer and use it in GitHub Desktop.
Gradle Findbugs: This gradle script will disable findbugs until "findbugs" task is in the task graph. This allows to skip the findbugs verification for cases it is not needed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
allprojects { | |
// Marker Task to enable findbugs. | |
task findbugs( | |
group: "Verification", | |
description: """Marker task to enabled findbugs. Findbugs is by default | |
disabled. E.g. ( ./gradlew findbugs build )""" | |
) | |
} | |
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)) } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Working perfectly thank you!