take a look at the if attribute on <copy>. See the docs at: http://nant.sourceforge.net/nightly/help/tasks/copy.html
somthing like :
<copy todir="${binaries.dir}${destinationPath}" overwrite="true" if="${mySwitch}"> ... </copy>
Should do the trick Ian
Jo De Greef wrote:
Hi all,
I'm trying to create a task that will copy my binaries to a seperate folder after compilation. I created a csv file with the list of files to copy and let Nant iterate through it. Depending on the value of a property however I want to decide whether or not to copy these files.
I can't seem to find any documentation on how to do this exactly.
Here's a snippet from my build file:
<property name="mySwitch" value="on"/>
<foreach item="Line" in="binaries.csv" delim="," property="sourcePath,destinationPath,filename"> <copy todir="${binaries.dir}${destinationPath}" overwrite="true"> <fileset basedir="${string::replace(sourcePath,'[CONFIGURATION]', configuration)}"> <includes name="${filename}" if="test if mySwitch == 'on'" /> </fileset> </copy> </foreach>
Can someone please tell me what the exact if-statement should look like or where I can find documentation for more info?
TIA, -Jo
ps. I know it's odd to perform the check inside the loop, but this will make sense when I extend the script later on.
--
Ian MacLean, Developer, ActiveState, a division of Sophos
http://www.ActiveState.com
------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Nant-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-users