How to get the username of the last svn commit using ant?
ant, svn
Solution
So, here is example for "svnant":
<path id="devlibs.path">
<fileset dir="devlib" includes="**/*.jar" />
</path>
<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="devlibs.path" />
<svnSetting
id="svn.settings"
svnkit="false"
javahl="false"
username="${svn.username}"
password="${svn.password}" />
<target name="get-svn-author">
<svn refid="svn.settings">
<singleinfo target="${svn.repo.url}" property="author.result" request="author" />
</svn>
<echo message="Author of last commit: ${author.result}" />
</target>
You should put "svnant.jar" and "svnClientAdapter.jar" to path identified by "devlibs.path". And other libraries required by "javahl" or "svnkit" to your "${ANT_HOME}/lib". If you have SVN repository with 1.6 format, you could use "svnkit" (set to "true" in "svnSetting"-block). Because "svnkit" is a pure Java-toolkit it's best to use when you need cross-platform solution. If you already switched to 1.7, then I recommend to use SVN command line client ("svnSetting" configured for command line client in my example). Check this page (Slik SVN) for info about where to find and how to install different SVN command line clients.
Problem
I would like to use Ant to get the username of the latest commit of a svn repository. how can i do this as cross-platform as possible? thanks!