开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜