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: How to avoid multiple <target unless= >
Date Mon, 02 Jun 2003 13:49:38 GMT
Maybe you can use one dependency-checking target which does the checks
for all targets.

<target name="check">
    <condition property="cond1"> ...
    <condition property="cond2"> ...
    ...
</target>

<target name="one" if="cond1" />
<target name="two" unless="cond2" />

...


Jan

> -----Urspr√ľngliche Nachricht-----
> Von: Tharp, Joshua L, SOLGV [mailto:jltharp@att.com]
> Gesendet am: Montag, 2. Juni 2003 15:46
> An: Ant Users List
> Betreff: RE: How to avoid multiple <target unless= >
> 
> The way I have done it is to have a dependency-checking target that
> defines some property if all of the conditions are met (with the
> condition task).
> 
> <target name="check.for.uptodate">
>     <condition property="uptodate">
>         ...
>     </condition>
> </target>
> 
> <target name="exec" depends="check.for.uptodate" unless="uptodate">
>     ...
> </target>
> 
> I don't know if this qualifies as a "way to avoid define 
> [sic] multiple
> <target>s."
> 
> Josh
> 
> -----Original Message-----
> From: Thai Thanh Ha [mailto:thaiha@psv.com.vn] 
> Sent: Friday, May 30, 2003 1:53 AM
> To: 'user@ant.apache.org'
> Subject: How to avoid multiple <target unless= >
> 
> 
>  Hi all,
> 
>  In my build file, I want to call <java> tasks only when some 
> files are
> not
> uptodate. I know that I can call <uptodate> tasks to check  and define
> multiple targets (using <target unless="condition">). Is 
> there any other
> way
> to avoid define multiple <target>s? 
> 
>  Thanks,
>  Thai
> 
> ---------------------------------------------------------------------
> 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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message