Meanwhile I solved it.
def ex = ['aaa/bbb/*','ccc/ddd.*','eee/fff/*']
def ft = reportTask.classDirectories.asFileTree.matching {
ex.each {
exclude it
}
}
I don’t know how it works, but it works. I think gradle somehow wraps it to AntlrTask
since it’s an implementation of PatternFilterable
.