Using the svn tool svnant, you can easily use ant to detect code from SVN. The main code is as follows:
<Project name = "check out from SVN use ant" default = "checkout">
<! -- Define the svn URL and the local directory to be checked out -->
<Property file = "build. properties"/>
<Path id = "ant. classpath">
<Pathelement location = "$ {ant_home}/lib/svnant. Jar"/>
<Pathelement location = "$ {ant_home}/lib/svnclientadapter. Jar"/>
<Pathelement location = "$ {ant_home}/lib/svnjavahl. Jar"/>
</Path>
<! -- Define the svn task -->
<Taskdef name = "SVN" classname = "org. Tigris. subversion. svnant. svntask">
<Classpath refID = "ant. classpath"/>
</Taskdef>
<! -- Prepare for the checking out: Clean the directory -->
<Target name = "prepare" Description = "Prepare the dirs for the task">
<Delete dir = "$ {local. dir}"/>
<Mkdir dir = "$ {local. dir}"/>
</Target>
<! -- Check out the scource from the svn -->
<Target name = "checkout" depends = "prepare">
<SVN javahl = "true" username = "" Password = "">
<Checkout url = "$ {SVN. url}" destpath = "$ {local. dir}"/>
</SVN>
</Target>
</Project>
SVN. url = SVN: // 9.186.57.111/Ariadne/main/IP-Client
Local. dir = C:/svntest
A simple example (including svnant.zip) can be downloaded from http://download.csdn.net/source/534499.
For more help visit: http://subclipse.tigris.org/svnant.html
In addition, the svn address and local address to be checked are defined in the configuration file.