You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Antoine Levy-Lambert <an...@gmx.de> on 2006/09/01 00:06:03 UTC

Re: Conditional execution of tasks

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" <ch...@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