Johannes Buehler-3 wrote:
>
> The Problem is that i have to pass the findbugs classpath (findbugs.jar +
> dependencies) to
> the FindbugsAntTask i am using.
>
I assume this is because FindBugs forks a new process? If the idea is to
ship the FindBugs Jar with the Gradle distribution, you can get at the Jar's
location with (from inside a Gradle task):
getServices().get(ClassPathRegistry.class).getClassPathFiles("FINDBUGS")
For this to work, you'll have to add an entry for FINDBUGS to
DefaultClassPathProvider.
Johannes Buehler-3 wrote:
>
> Since findbugs uses the bytecode for its analyses, Groovy Code can be
> analysed as well.
>
Sure Groovy code can be analyzed, but the question is if the results will be
meaningful (and FindBugs won't crash). Usually they aren't unless the tool
specifically supports the language in question.
Johannes Buehler-3 wrote:
>
> Bt you are right its almost impossible to map the
> compiled classes properly the groovy source files. Anyhow the sources
> are only need for better reporting purposes.
>
Finding the sources is straightforward. Just pass SourceSet.getAllSource()
to FindBugs. Or, if it gets irritated by non-Java sources,
SourceSet.getAllJava().
The reason why I was trying to find a way to map source files to class files
(not the other way around) was so that one could have FindBugs only analyze
classes written in a particular language. However, it is up to Gradle to
provide a better solution here. For the time being, just analyze whatever is
in SourceSet.getClassesDir(), and maybe provide a way to set a (file-based)
include/exclude filter for the class files. This way it's at least possible
to include/exclude certain packages.
Johannes Buehler-3 wrote:
>
> I already introduced a dependency to the compile task, cause findbugs
> needs the compiled artifact.
>
I think the dependency should be on sourceSet.getClassesTaskName().
--
Peter Niederwieser
Developer, Gradle
http://www.gradle.org
Trainer & Consultant, Gradle Inc.
http://www.gradle.biz
Founder, Spock Framework
http://spockframework.org
--
View this message in context:
http://gradle.1045684.n5.nabble.com/findbugs-plugin-some-open-issues-tp3370115p3372522.html
Sent from the gradle-dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email