Some remarks, and some questions related to the findbugs plugin :
-
Remark : The ‘excludes’ property of the findbugs task does not work, because it excludes java sources from the ‘sourcePath’ property of the FindBugs Ant task. Problem is, the ‘sourcePath’ property is optional and does not drive the list of analyzed classes (it is simple there to gather source code information for the report). Actually, ‘classes’ is the real list
-
Remark : Because of 1) I’ve tried to filter the list of analyzed classes with the ‘classes’ property :
findbugsMain.classes.exclude '**/foo/*'
This should work, because ‘classes’ is a ConfigurableFileTree, but it does not work because the exclude information is not properly propagated to the Ant task. However, I’ve found a workaround :
def
ft = findbugsMain.classes
ft.exclude '**/foo/*'
findbugsMain.classes = files(ft.files) // explicit list of files
-
Question : All quality plugins have an ‘extension’ that allows to override the analyzed sourceSets. Let’s say that I want to analyse a sourceSet ‘foo’ that is a subset of my ‘main’ sourceSet. How can I create this new sourceSet ‘foo’ ? - I can not mutate the ‘main’ sourceSet because I still want all my classes to be compiled - I can not redefine a third ‘foo’ sourceSet in the ‘sourceSets’ of the project because the ‘main’ sourceSet and the ‘foo’ sourceSet would overlap (what would be the behavior of the compilation?) So, should I manually create a ‘foo’ sourceset ? To sum it up, is there an idiom associated to the existence of this extension ?
-
Question : For the findBugs plugin, do you intend to add the ‘Filter’ feature that allows to deactivate some checks ?
-
Remark : I think that the DSL documentation should explain how to activate the html report
[findbugsMain, findbugsTest]*.reports {
xml.enabled false
html.enabled true
}
(I’ve found this in the integration test of the plugin, but when you don’t know it, it is not a slam dunk)
Thank you