ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: Conditionally execute copy task
Date Fri, 26 Sep 2008 10:00:23 GMT
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:Gilbert.Rebhan@huk-coburg.de] 
>Gesendet: Freitag, 26. September 2008 11:21
>An: 'Ant Users List'
>Betreff: RE: Conditionally execute copy task
>
>
>
>-----Original Message-----
>From: "Spilker, Jörg" [mailto:Joerg.Spilker@sla.niedersachsen.de]
>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: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message