Skip to content

Instantly share code, notes, and snippets.

@ondrej-kvasnovsky
Created May 22, 2017 21:31
Show Gist options
  • Save ondrej-kvasnovsky/3d93bad1fa06ce70b7ce97932b9c0a5c to your computer and use it in GitHub Desktop.
Save ondrej-kvasnovsky/3d93bad1fa06ce70b7ce97932b9c0a5c to your computer and use it in GitHub Desktop.
Exclude all immutable Groovy Files
List excludedGroovyClasses() {
String srcDir = System.getProperty("user.dir") + "/src/main/groovy/"
FileTree tree = fileTree(dir: 'src/main/groovy')
tree.include '**/*.groovy'
String immutableSign = 'import groovy.transform.Immutable'
Collection excludedClasses = tree.findAll {
it.text.contains(immutableSign)
}.collect {
it.absolutePath.replace(srcDir, "")
}
excludedClasses
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment