How to get the SVN revision number for use in ANT
As part of my build and deploy process I wanted to get the revision number of the working copy and append it into the application so its visible. To do this you need to have already installed the SVNAnt task, (see my previous post) as its not a core ANT task.
Using the status task, we can pull out all of the properties of a file or directory, here I have chosen to use my application.cfm as its always present in a ColdFusion application.
Notice how we use the revisionProperty attribute to enter the variable we need, svn then applies the revision number to that variable for later use. Note that for this example my build.xml is local to the webroot and the application.cfm. This clearly isnt best practice, and I will comment later on this matter.