Technical topics (hopefully) explained in plain language.

Friday, December 5, 2008

How do you verify your Ant version?

In my last post, I mentioned that "SecureInputHandler" was only added as of Ant 1.7.1.

But how do you make your buildfile require a particular version of Ant??

You can do it this way. It works, but its inelegant.

You can also do it this way:

<property name="ant.min-version" value="1.7.1" /> 
<target name="verify-ant">
<fail message="Ant version is '${ant.version}'. Must have ant version ${ant.min-version}+">
<condition>
<not><antversion atleast="${ant.min-version}" /></not>
</condition>
</fail>
</target>

No comments:

Blogger Syntax Highliter