Quantcast
Channel: Eureka! » Ant
Viewing all articles
Browse latest Browse all 26

Apache Ant – Get the SVN revision number by exec task

$
0
0

In Apache Ant, we can use the <exec> task to execute shell command in Ant script. Previously i have shown you how to integrate Apache Ant with SVN.

 

If you only want to do some simple SVN actions, you can consider using the <exec> task. The build.xml below is a simple example to get the current SVN version number.

<project name="ant-exec-example" default="svnversion" basedir=".">
  <target name="svnversion">
    <exec executable="svnversion" outputproperty="svnversion" />
    <echo message="SVN Version: ${svnversion}"/>
  </target>
</project>

 

Try it out.

svnversion:
     [echo] SVN Version: 1178M

BUILD SUCCESSFUL
Total time: 1 second

 

Done =)

Reference: Apache Ant – <exec>


Filed under: Ant, SVN Tagged: Ant, Subversion, SVN

Viewing all articles
Browse latest Browse all 26

Trending Articles