Get the current SVN revision number in from Ant
Another minor Problem I struggled with the last couple times I was updating one of my build scripts was resolving the current SVN revision number from within ant. Google points out a few solutions, but most of them require optional SVN tasks or do an exec. Someone (sorry, I would put a link if I could remember) came up with the simple solution of using the stored SVN information from the filesystem. So:
<loadfile property="svn.revision" srcFile="./.svn/entries">
<filterchain>
<headfilter lines="1" skip="3"/>
<deletecharacters chars="\n"/>
</filterchain>
</loadfile>
loads the current revision number into a property called svn.revision. I use this with svn 1.4 and 1.5 repositories and it works just fine.
No comments yet.