forked from grails/grails-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfindbugs.gradle
31 lines (30 loc) · 1.42 KB
/
findbugs.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// To use findbugs you must have findbugs installed. Additionally you need a property called findbugsHome. You can define this
// in ~/.gradle/gradle.properties
task findbugs(dependsOn: install) {
doLast {
ant {
taskdef(name: "findbugs", classname: "edu.umd.cs.findbugs.anttask.FindBugsTask", classpath: "$findbugsHome/lib/findbugs-ant.jar")
mkdir dir: "$buildDir/findbugs-report"
findbugs(home: findbugsHome, output: "xml:withMessages", outputFile: "$buildDir/findbugs-report/grails-fb.xml", jvmargs: "-Xmx768M") {
auxClasspath() {
for (sub in subprojects) {
pathElement(path: sub.sourceSets.main.compileClasspath.asPath)
}
}
sourcePath() {
for (sub in subprojects) {
sub.sourceSets.main.groovy.srcDirs.each { srcDir ->
if (srcDir.exists()) {
pathElement(path: srcDir.absolutePath)
}
}
}
}
auxAnalyzepath() {
fileset dir: homeDistDir, includes: "grails-*.jar"
}
}
xslt(in: "$buildDir/findbugs-report/grails-fb.xml", out: "$buildDir/findbugs-report/grails-fb.html", style: "$findbugsHome/src/xsl/fancy.xsl")
}
}
}