ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wannheden, Knut" <knut.wannhe...@paranor.ch>
Subject RE: target ifTrue
Date Tue, 20 Aug 2002 09:51:40 GMT
you could just have the property defined in one properties file and
undefined in the other.  i.e.

in default.properties
test=true

in my.properties
#test=true

and then

<target name="test" if="test">
 ...
</target>

Now you just have to load the properties file prior to calling the test
target.  But I think the other pattern you're using is quite useful if you
have o test for something else than just a property.

--
knut

> -----Original Message-----
> From: Tibor Strausz [mailto:Tibor.Strausz@tridion.com]
> Sent: Dienstag, 20. August 2002 11:15
> To: Ant Users List (E-mail)
> Subject: target ifTrue
> 
> 
> 
> Hi i have the following and that works but i was wondering if 
> it was easy to
> add the ifTrue and ifFalse to the target task.
> 
> now:
> in build.xml
> <target name="test" if="runtest" depends="init">
>  do stuff
> </target>
> 
> <target name="init" description="Setup the environment">
>   <condition property="runtest">
>     <istrue value="${test}" />
>   </condition>
> </target>
> 
> in default.properties
> test=on
> 
> in my.properties
> test=off
> 
> if there was a ifTrue than there is no need for the init task 
> and because i
> have about 20 targets it will get large and ugly.
> 
> tibi
> 
> --
> To unsubscribe, e-mail:   
<mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message