Antversion

Description

Stores the Apache Ant version (when used as task) or checks for a specific Ant version (when used as condition). Since Ant 1.7.0

Attribute Description Required (Task) Required (Condition)
atleast The version that this at least. The format is major.minor.point. No One of these.
exactly The version that this ant is exactly. The format is major.minor.point. No
property The name of the property to set. Yes No (ignored)

Examples

<antversion property="antversion"/>

Stores the current Ant version in the property antversion.

<antversion property="antversion" atleast="1.6"/>

Stores the Ant version in the property antversion if the current Ant version is 1.6.0 or higher. Otherwise the property remains unset.

<antversion property="ant-is-exact-7" exactly="1.7.0"/>

Sets the property ant-is-exact-7 if Ant 1.7.0 is running. Neither 1.6.5 nor 1.7.0 would match.

<condition property="Ant17isOnline">
  <and>
    <antversion exactly="1.7.0"/>
    <http url="http://ant.apache.org"/>
  </and>
</condition>

Sets Ant17isOnline if Ant 1.7.0 is running and can get a non-error-response from the Ant homepage.