Posts Tagged ‘svnant’

What you will need to get the ANT svn task to work is:

JDK 1.5/1.6 – You can get that here.
ANT – You can get that here.
SVN client – You can get that here. You will need to register for this.
SvnAnt zip file – You can get that here.

Here is what to do:

Install JDK if you haven’t done so already.
Install ANT (simply unzip the ANT zip file into an appropriate place) if you haven’t done so already.
Install SVN Client.
Install SvnAnt (simply unzip the SvnAnt zip file into an appropriate place).

To use the ANT svn task:

build.properties:
# -----------------------------------------------------------------------------
# build.properties
# This file is referenced by the sample build.xml file.
# -----------------------------------------------------------------------------

svnant.version=1.0.0

# —————————————————————————–
# all jar needed
# —————————————————————————–
lib.dir=C:/svnant-1.0.0/lib
svnant.jar=${lib.dir}/svnant.jar
svnClientAdapter.jar=${lib.dir}/svnClientAdapter.jar
svnjavahl.jar=${lib.dir}/svnjavahl.jar

svnant.latest.url=http://subclipse.tigris.org/svn/subclipse/trunk/svnant/
svnant.this.url=http://subclipse.tigris.org/svn/subclipse/tags/svnant/${svnant.version}/

svnant.repository.user=user1
svnant.repository.passwd=”passwordUser1″

build.xml:
<?xml version="1.0"?>

<project name="Update" basedir="." default="update">
 
  <!--  all properties are in build.properties -->
  <property file="build.properties" />
  <path id="project.classpath">
    <pathelement location="${svnjavahl.jar}" />
    <pathelement location="${svnant.jar}" />
    <pathelement location="${svnClientAdapter.jar}" />
  </path>
  <property name="project.svn.url" value="SVN_URL_HERE" />
 
  <taskdef resource="svntask.properties" classpathref="project.classpath"/>
 
  <target name="update">
    <svn>
      <checkout url="${project.svn.url}" revision="HEAD" destPath="." />
    </svn>
  </target>

</project>

You can get detailed documentation on svn ANT task here.