The filtering for SourceDirectorySets is currently broken. The include/exclude patterns don’t apply to directories. So the the getSrcDirTrees method will return all source folders even though some of them are completely excluded by a filter.
One use case is with Xtext languages: They can link against Java and can produce Java code themselves. So my input is “all Java source directories minus my own output directories”. This currently does not work, so I have to subclass internal API to work around it.