Skip to content

Commit

Permalink
Fixed findbugs task in gradle build
Browse files Browse the repository at this point in the history
  • Loading branch information
lhotari committed Sep 1, 2011
1 parent a2fe590 commit 0b0722b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
1 change: 1 addition & 0 deletions build.gradle
Expand Up @@ -227,4 +227,5 @@ subprojects.each { evaluationDependsOn it.path }
apply { apply {
from 'gradle/docs.gradle' // tasks for building the documentation (e.g. user guide, javadocs) from 'gradle/docs.gradle' // tasks for building the documentation (e.g. user guide, javadocs)
from 'gradle/assemble.gradle' // tasks for creating an installation or distribution from 'gradle/assemble.gradle' // tasks for creating an installation or distribution
from 'gradle/findbugs.gradle'
} }
24 changes: 14 additions & 10 deletions gradle/findbugs.gradle
@@ -1,23 +1,27 @@
// To use findbugs you must have findbugs installed. Additionally you need a property called findbugsHome. You can define this // To use findbugs you must have findbugs installed. Additionally you need a property called findbugsHome. You can define this
// in ~/.gradle/gradle.properties // in ~/.gradle/gradle.properties


task findbugs(dependsOn: tasks.withType(Jar).all) << { task findbugs(dependsOn: install) << {
ant { ant {
taskdef(name: "findbugs", classname: "edu.umd.cs.findbugs.anttask.FindBugsTask", classpath: "$findbugsHome/lib/findbugs-ant.jar") taskdef(name: "findbugs", classname: "edu.umd.cs.findbugs.anttask.FindBugsTask", classpath: "$findbugsHome/lib/findbugs-ant.jar")
mkdir dir: "$buildDir/findbugs-report" mkdir dir: "$buildDir/findbugs-report"
findbugs(home: findbugsHome, output: "xml:withMessages", outputFile: "$buildDir/findbugs-report/grails-fb.xml", jvmargs: "-Xmx768M") { findbugs(home: findbugsHome, output: "xml:withMessages", outputFile: "$buildDir/findbugs-report/grails-fb.xml", jvmargs: "-Xmx768M") {
auxClasspath() { auxClasspath() {
fileset(dir: "lib") { for(sub in subprojects) {
include(name: "*.jar") pathElement(path: sub.sourceSets.main.compileClasspath.asPath)
exclude(name: "jsp-api-2.1.jar") }
} }
fileset(dir: "${System.properties['JAVA_HOME']}/lib") { sourcePath() {
include(name: "tools.jar") for (sub in subprojects) {
} sub.sourceSets.main.groovy.srcDirs.each { srcDir ->
if (srcDir.exists()) {
pathElement(path: srcDir.absolutePath)
}
}
}
} }
sourcePath path: file('src/java')
auxAnalyzepath() { auxAnalyzepath() {
fileset dir: libsDir, includes: "grails-*.jar" 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") xslt(in: "$buildDir/findbugs-report/grails-fb.xml", out: "$buildDir/findbugs-report/grails-fb.html", style: "$findbugsHome/src/xsl/fancy.xsl")
Expand Down

0 comments on commit 0b0722b

Please sign in to comment.