Platinum Solutions Corporate Website


Ant

SVN and Ant

During some improvements to one of my projects, we needed to report better version information. What we had was the usual manifest.mf with a configurable specification and implementation version. That approach didn't prove to be much help for things like a customer calling with an issue, and we needed to track down the specific build they had. After some discussion, we decided to change our implementation version number to match the SVN revision number at the time of build.

If you're using Ant, you should know about Ant-Contrib

If you are using Ant, you owe it to yourself to check out Ant-contrib, a great collection of really useful tasks that make writing highly functional Ant scripts a snap.

For example, there's a <if> task that lets you write in conditional logic, like this:

<if>
<equals arg1="${target}" arg2="windows" />
<then>
<antcall target="build-windows"/>
</then>
<else>
<antcall target="build-solaris"/>
</else>
</if>

As you can see, the <if> task supports <else> conditions, and also supports <elseif>.  It can test on any condition that Ant's built-in <condition> task can, such as equality, the availability of a property, whether file(s) are up to date, even if a document is available via an http request.