views:

1634

answers:

1

How do you use the nant <copy> command and maintain the directory structure? This is what I am doing, but it is copying all the files to a single directory.

<copy todir="..\out">
  <fileset>
    <includes name="..\src\PrecompiledWeb\**\*" />
  </fileset>
</copy>
+8  A: 

Try:

<fileset baseDir="../src/PrecompiledWeb"><includes name="**/*" />
Just a small note : basedir is lower-case at least now. ( http://nant.sourceforge.net/nightly/latest/help/types/fileset.html )
VirtualBlackFox
Here's why this works "Files that are not located under the the base directory of the <fileset> will be copied directly under to the destination directory, regardless of the value of the flatten attribute." http://nant.sourceforge.net/release/latest/help/tasks/copy.html
russau