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>

<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="set.up.my.properties"
        depends="set.server.type.conditional,
                         set.server.type.a.props,
                         set.server.type.b.props">
</target>
<target name="set.server.type.is.property">
    <property name="server.type.is.${server.type}" value="true"/>
</target>
<target name="set.server.type.a.props" if="server.type.is.a">
  <property ....
  <property ....
  <property ....
<target/>
<target name="set.server.type.b.props" if="server.type.is.b">
  <property ....
  <property ....
  <property ....
<target/>

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 'x.is.y'.




Reply via email to