This is easy enough to implement (will do it now unless someone answers real quick), but I'd always rather reuse than implement.
How can one recursively copy a folder in groovy, while excluding some folders/paths? I know this can be done with ant, but I think a simple native groovy code is nice to have as well.
Posting the code to use AntBuilder (Linked to from my comment above) in case the page disappears at a later date:
new AntBuilder().copy(todir: "dstFolder") {
fileset(dir : "srcFolder") {
include(name:"**/*.java")
exclude(name:"**/*Test.java")
}
}
Not sure if you meant that for some reaon you wanted to avoid using Ant completely however...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With