0

I am trying to copy the directory /a/b/DIRtoCOPY to /d/e I am using the below code, but it copies the content of DIRtoCOPY directory to e, rather than /d/e/DIRtoCOPY.

def destLocation="/d/e"
def sourceDir="/a/b/DIRtoCOPY"
project.ant.copy(destLocation,overwrite:true)
{
       fileset(dir:sourceDir) 
}

Any help is much appreciated.

user1470220
  • 123
  • 2
  • 15

1 Answers1

0

you have to include DIRtoCOPY itself, f.e. :

<project>
 <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy"/>
  <groovy>
   destLocation="/d/e"
   sourceDir="="/a/b"
   incl="DIRtoCOPY/**"
   ant.copy(todir:destLocation) {
    fileset(dir:sourceDir, includes:incl)
   }
  </groovy>
</project>
Rebse
  • 10,307
  • 2
  • 38
  • 66