Using the ANT build.number file
I was wondering how to keep track of how many builds have taken place, putting it together into a overall product version number with the Subversion Revision number.
It turns out that ANT actually keeps a record of builds itself using the Buildnumber task, all you have to do is produce a blank build.number file. If the build.number file is local to the build.xml you need no special attributes, ANT will update the build number for you.
<buildnumber/>
<echo message="ANT Build number ${build.number}" />
</target>
How good is that? Marvellous I think is the word you need.
Exporting a SVN Working Copy with ANT
Once you have installed the SVN task to Eclipse, you can begin to look at the possibilities. For example in a deployment scenario you could use ANT to export the HEAD revision so you have a clean set of files ready for moving by FTP or some other means.
There certainly isnt any VooDoo here, its all very straight forward.
<echo message="exporting to ${buildDir}" />
<property name="buildDir" value="c:/export/${projectName}" />
<svn username="username" password="password">
<export srcUrl="http://localhost/svn/testrepository" destPath="${buildDir}" revision="HEAD" />
</svn>
Installing SVNAnt into Eclipse
On my road of exploration for ANT, and the end goal of using it for deployment, I have had to tackle how to get files out of SVN ready for moving to a server. This means getting ANT to run the equivalent of an svn export from the command line.
This is possible using the command line client through ANT thus:
<arg line="co ${svn.projecturl} ${build.temp} -r ${svn.revision} --username ${svn.username} --password ${svn.password}"/>
</exec>
However there is a nicer way that doesn't involve installing the SVN command line client. Enter SvnAnt.
Using ANT from Eclipse
I have recently taken the plunge into ANT for use in deployment and doing some mundane tasks, and since I use Eclipse I have been playing with the integrated version that comes bundled.
There were a few things that are not very well documented (or I could not find) that took me a while to figure out, so I though I would share.

