Requirement:
Run svn log -l 1
command and this will have an output like this.
------------------------------------------------------------------------ r2633 | name | 2012-11-07 17:28:20 +0530 (Wed, 07 Nov 2012) | 1 line My comment. ------------------------------------------------------------------------
I need to extract the revision number 2633 and assign this as a property. I would prefer to avoid ant-contrib.
What I tried:
<echo>Run svn log -l 1</echo>
<exec executable="svn" outputproperty="svn.output" failonerror="false">
<arg line="log -l 1"/>
</exec>
<echo message="Output was: ${svn.output}" />
This gets the above output inside the property ${svn.ouput} but am not sure how do I extract version from this.
Other option is to write the variable in file, but again how do I extract the version into a property?
Thanks in advance.