ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rebhan, Gilbert" <Gilbert.Reb...@huk-coburg.de>
Subject RE: Conditionally execute copy task
Date Fri, 26 Sep 2008 09:21:01 GMT


-----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


Mime
View raw message