Subversion and Ant Integration with SVNAnt

I have been using Apache’s Ant in place of Phing to run build tasks for a while, mainly due to the fact that there are many more tasks available and also that Ant is based on Java, something I am taking an interest in at the moment.

One of the more interesting aspects of moving to Ant is the somewhat patchy documentation on the installation of SVNAnt - an Ant task that provides an interface to Subversion. To serve as a bit of a recipe, I will set out the steps required to get SVNAnt working…

If you are using Linux (like I am) or MacOS, you’ll more than likely need the JavaHL which is a Java Native Interface to subversion. There’s some info here on how to get it for your OS; if you are lucky you may be able to get it through package management depending on your flavour of Linux. With Fedora 8 I just ran this:

$ yum install subversion-javahl

Nice and easy for once! Anyway, onward with the instructions…

Firstly, check out the latest source code for SVNAnt from tigris.org - you may be prompted for a user name (use ‘guest’) followed by a password (use ‘none’). Then move into the ’svnant’ directory.

$ sudo svn co http://subclipse.tigris.org/svn/subclipse/trunk/svnant/ svnant

$ cd svnant

Next, edit the build.properties.example file - remove all the ‘#s’ to uncomment the code, and add the following line at the bottom:

targetJvm = 1.6

The targetJvm obviously depends on which version JVM you happen to be using.

Next, run the installer to build the required files.

$ ant makeDistrib

This should create all the library files you need in order to get up and running with SVNAnt. The library files are located in a zip file (in my case svnant-1.1.0.zip in the build/ directory. If you unzip the file, you’ll find a small collection of ready to go samples to have a play with.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blogmarks
  • co.mments
  • del.icio.us
  • digg
  • Fark
  • Furl
  • Reddit
  • Spurl
  • TailRank
  • YahooMyWeb

About this entry