Use conditional patterns.

<copy todir="todir">
    <fileset dir="fromdir">
        <include name="conditionalA" if="propertyAIsSet"/>
        <include name="conditionalB" if="propertyBIsSet"/>
        <exclude name="conditionalA,conditionalB"/> <!-- the rest -->
    </fileset>
</copy>



Jan

>-----Ursprüngliche Nachricht-----
>Von: Rebhan, Gilbert [mailto:[EMAIL PROTECTED] 
>Gesendet: Freitag, 26. September 2008 11:21
>An: 'Ant Users List'
>Betreff: RE: Conditionally execute copy task
>
>
>
>-----Original Message-----
>From: "Spilker, Jörg" [mailto:[EMAIL PROTECTED]
>Sent: Friday, September 26, 2008 11:03 AM
>To: 'user@ant.apache.org'
>Subject: Conditionally execute copy task
>
>/*
>Hello,
>
>i want to copy some files only if some property is set to true. Is this
>possible? There is the condition tasks, but it only sets a 
>property based on
>prerequisites. I didn´t found anything like an <if> tasks or similar.
>
>Greetings, Jörg
>*/
>
>your condition sets a property ${mustcopy} and then
>
><target name="yourcopytask" if="mustcopy">
>...
>runs only if mustcopy is set
></target>
>
>
>the same vice versa
>
><target name="...." unless="someproperty">
>...
>runs only if someproperty is not set
><target>
>
>Regards,
>Gilbert
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to