groovy exclude .svn directory from while traversing thru all sub-directories
I am开发者_如何学运维 trying to traverse through all files and sub-directories excluding .svn
directory. Can somebody please let me know how to this?
In what regards? Build tools like GMaven already handle .svn directories. If you are writing a groovy script to do something on your filesystem, then you'll have to handle it yourself.
Something like:
def dir = new File('some/path')
dir.eachFileRecurse { file ->
if (file.toString().contains(".svn")) { return }
// handle your processing
if (file.isDirectory()) { // do some directory processing
}
// etc
}
There's a grails page on adding grails to subversion, but I haven't had any problems.
If you're writing build scripts, you may want to consider gradle @ gradle.org - you get simplified domain specific languages for builds and can mix in groovy to handle special cases
精彩评论