Antversion

Since Ant 1.7.0

Description

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

Attribute Description Required
Task Condition
atleast The version that this Ant is of at least. The format is major.minor.point. No Exactly one of these
exactly The version that this Ant is of exactly. The format is major.minor.point. No
property The name of the property to set. Yes Ignored

Examples

Store the current Ant version in the property antversion.

<antversion property="antversion"/>

Store 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="antversion" atleast="1.6"/>

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

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

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

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