ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoffrey Mitchell <>
Subject Re: *****spam***** Conditional execution of tasks
Date Thu, 31 Aug 2006 18:06:32 GMT
Have one target build a fileset of the modified files and give it a 
refid, and also use pathconvert to assign a property containing the 
contents of the fileset with setonempty="false".

Then run your copy target conditionally on the property.

<target name="check.copy">
  <fileset id="">
    <!--Use selectors to get your modified files-->
  <pathconvert property="copy.required" pathsep=";" setonempty="false">
       <fileset refid=">

<target name="copy.files" depends="check.copy" if="copy.required">
  <copy ...>
    <fileset refid=">
  <!--Do your other thing here.-->

Charles Abreu wrote:

> 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:
For additional commands, e-mail:

View raw message