This blog has been moved to the Octopress plus Github Pages and can now be accessed by sklyarenko.net. The contents of this Blogger instance will continue living here in order not to break the external references.
This blog is used as a memory dump of random thoughts and interesting facts about different things in the world of IT. If anyone finds it useful, the author will be just happy! :-)
Tuesday, July 30, 2013
Thursday, January 3, 2013
NAnt <copy> task behaves differently in 0.92 and prior versions
If you need to copy a folder together with all its contents to another folder in NAnt, you would typically write something like this:
It turns out this code works correctly in NAnt 0.92 Alpha and above. The output is expected:
However, the same code doesn’t work in prior versions of NAnt, for instance, 0.91. The output is as follows (only in –debug+ mode):
Obviously, the issue was fixed in 0.92, so the best recommendation would be to upgrade NAnt toolkit. However, if this is not an option for some reason, the following code seems to work correctly for any version:
Hope this saves you some time.
<copy todir="${target}"> <fileset basedir="${source}" /> </copy>
[copy] Copying 1 directory to '...'.
[copy] Copying 0 files to '...'.
<copy todir="${target}"> <fileset basedir="${source}"> <include name="**/*" /> </fileset> </copy>
Tags:
NAnt
Subscribe to:
Posts (Atom)