Skip to content

Instantly share code, notes, and snippets.

@azenla
Created July 30, 2013 12:07
Show Gist options
  • Save azenla/6112378 to your computer and use it in GitHub Desktop.
Save azenla/6112378 to your computer and use it in GitHub Desktop.
def mainDirectory = new File(getClass().protectionDomain.codeSource.location.path).getParentFile().getParentFile()
def sourceDirectory = new File(mainDirectory, 'src/main/java/org/minetweak')
println('Found Source Directory: ' + sourceDirectory.toString())
int classCount = 0
sourceDirectory.eachFileRecurse {
if (it.getName().endsWith(".java")) {
classCount++
}
}
println(String.format('Found %s classes.', classCount))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment