Skip to content

Instantly share code, notes, and snippets.

@nileshk
Created March 8, 2013 20:51
Show Gist options
  • Save nileshk/5119771 to your computer and use it in GitHub Desktop.
Save nileshk/5119771 to your computer and use it in GitHub Desktop.
Get SVN revision number of last commit in Ant build
<exec executable="svn" spawn="false" dir="." outputproperty="revision.number">
<arg line="info"/>
<redirector>
<outputfilterchain>
<linecontainsregexp><regexp pattern="^Last\sChanged\sRev:\s[0-9]*$" /></linecontainsregexp>
<tokenfilter>
<replaceregex pattern="^Last\sChanged\sRev:\s([0-9]*)$" replace="\1" flags="g" />
</tokenfilter>
</outputfilterchain>
</redirector>
</exec>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment