Hi,

First of all, thanks, Antoine for getting out the beta today.

I felt the need for a <antversion> condition today.  I am aware
of the different techniques used - i.e., using the ant.version
property or using <available> and checking for a classname
that is unique to a particular release of Ant.  <available> usually
works ok for major releases, but for minor ones, it may not
always.

My situation is this:
I want to do the following if Ant runtime version is <= 1.6.1:

        <exec dir="${build.war}" executable="jar">
            <arg line="-cf ${build.ear}/${application.name}.war *"/>
        </exec>

I want to do the following if Ant runtime version is > 1.6.1 (including beta
releases)
        <jar jarfile="${build.ear}/${application.name}.war"
            basedir="${build.war}" roundup="false"/>

Currently I am doing something like this:
    <condition property="no.roundup.support">
        <or>
            <equals arg1="${ant.version}" arg2="1.6"/>
            <contains string="${ant.version}" substring="1.6.1"/>
            <contains string="${ant.version}" substring="1.5"/>
            <contains string="${ant.version}" substring="1.4"/>
..and so on...
        </or>
    </condition>

    <target name="exec_jar_war" if="no.roundup.support">
        <exec dir="${build.war}" executable="jar">
            <arg line="-cf ${build.ear}/${application.name}.war *"/>
        </exec>
    </target>

    <target name="rounddown_jar_war" unless="no.roundup.support">
        <jar jarfile="${build.ear}/${application.name}.war"
            basedir="${build.war}" roundup="false"/>
    </target>

    <target name="jar_war" depends="exec_jar_war,rounddown_jar_war"/>

Is there a reliable built-in way (or a more elegant way) of achieving this?

Cheers,
Magesh

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to