Created
May 22, 2017 21:31
-
-
Save ondrej-kvasnovsky/3d93bad1fa06ce70b7ce97932b9c0a5c to your computer and use it in GitHub Desktop.
Exclude all immutable Groovy Files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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