ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Colin Sampaleanu <>
Subject RE: a few enhancements for ant 1.4B2
Date Mon, 27 Aug 2001 16:42:21 GMT
At 09:41 AM 26/08/2001 +0100, you wrote:
> > -----Original Message-----
> > 1* <target>, modified "if" and "unless" attributes
> >
> > the value of the if an unless can be a property name (as it
> > is right now
> > in ant) or a property name/value, i.e:
> >
> >     <target name="tomcatDeploy" if="server.type=tomcat">
> >
> > this target will only be executed if "server.type" is defined and and
> > its value is "tomcat"
>What about:
><target name="serverDeploy" if="server.type">
>         <antcall target="${server.type}Deploy"/>
><target name="tomcatDeploy"/>
><target name="weblogicDeploy"/>
><target name="resinDeploy"/>
The main problem as far as I am concerned is that using antcall you can do 
some work, but you can not set properties that stick. So for example if I 
want to set 10 properties based on server.type, I have to do something 
like, somewhere in my dependency chain:

<target name=""
<target name="">
     <property name="${server.type}" value="true"/>
<target name="set.server.type.a.props" if="">
   <property ....
   <property ....
   <property ....
<target name="set.server.type.b.props" if="">
   <property ....
   <property ....
   <property ....

It would be simpler if the "if" could simply test the value directory, 
instead of having to go indirect like this. I wouldn't need a special 
target just to map the idea of property 'x' == 'y' to a new property ''.

View raw message