Check out resource from SVN use ant)

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.