Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed findbugs task in gradle build

  • Loading branch information...
commit 0b0722b8db5077a402e6e9653e1253078ae22d7a 1 parent a2fe590
@lhotari lhotari authored
Showing with 15 additions and 10 deletions.
  1. +1 −0  build.gradle
  2. +14 −10 gradle/findbugs.gradle
View
1  build.gradle
@@ -227,4 +227,5 @@ subprojects.each { evaluationDependsOn it.path }
apply {
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/findbugs.gradle'
}
View
24 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
// in ~/.gradle/gradle.properties
-task findbugs(dependsOn: tasks.withType(Jar).all) << {
+task findbugs(dependsOn: install) << {
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() {
- fileset(dir: "lib") {
- include(name: "*.jar")
- exclude(name: "jsp-api-2.1.jar")
- }
- fileset(dir: "${System.properties['JAVA_HOME']}/lib") {
- include(name: "tools.jar")
- }
+ 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)
+ }
+ }
+ }
}
- sourcePath path: file('src/java')
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")
Please sign in to comment.
Something went wrong with that request. Please try again.