ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antoine Levy-Lambert" <anto...@gmx.de>
Subject Re: Conditional execution of tasks
Date Thu, 31 Aug 2006 22:06:03 GMT
Hello Charles,

you can build a fileset using the different selector which will be the fileset you will copy.
Read under concept and types in the manual what is the different selector.

Here a possible solution :

<target name="copy">
   <fileset dir="origin" id="tocopy"> 
       <different targetdir="copydir"/>
   </fileset>
   <pathconvert refid="tocopy" setonempty="false" property="tocopy"/>
   <copy todir="copydir">
       <fileset refid="tocopy">
    </copy>
</target>

<target name="postcopy" if="tocopy" depends="copy">
    <!-- do here something only if and only there was something to copy -->
</target>

regards,

Antoine
-------- Original-Nachricht --------
Datum: Thu, 31 Aug 2006 14:47:39 -0300
Von: "Charles Abreu" <charlesabreu@gmail.com>
An: user@ant.apache.org
Betreff: Conditional execution of tasks

> Hi,
> 
> A use a copy task to copy modified files from one directory to another
> directory. I need to run another task if, and only if, at last one file
> was
> copied. Is this possible?
> 
> Thanks!

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


Mime
View raw message