There are several ways to delete files with certain extension.In general,you must select some files;then filter some of them and finally delete reminding file.For example try this :
def tree = fileTree('${SOME_DIR}')
tree.include '**/*.${SOME_EXT}'
tree.each { it.delete() }