build.xml for CVS
<?xml version="1.0"?>
<project name="Example Remote Build for CVS" default="checkout" basedir=".">
<property name="local_root" value="local_project_root"/>
<property name="remote_cvsroot" value=":pserver:builder@server_ip:/cvsroot" />
<target name="checkout">
<cvspass cvsroot=":pserver:builder@server_ip:/cvsroot" password="builder"/>
<echo message="Checking out the required sources from CVS"/>
<cvs cvsroot="${remote_cvsroot}" quiet="true" command="checkout -P dir/project_name" dest="${local_root}" compression="true" />
</target>
</project>
build.xml for SVN
when we want to use ant checkout code from SVN, we need svnant tool which SVN supported.
For more information, please refer to the following links.
http://subclipse.tigris.org/svnant/svn.html
<?xml version="1.0"?>
<project name="Example Remote Build" default="checkout" basedir=".">
<property name="ant_home_lib" value="...../apache-ant-1.9.3/lib"/>
<property name="local_root" value="local_project_root/"/>
<!-- the following jar is needed to SVN -->
<path id="svnant.classpath">
<pathelement location="${ant_home_lib}/svnant.jar"/>
<pathelement location="${ant_home_lib}/svnkit.jar"/>
<pathelement location="${ant_home_lib}/svnClientAdapter.jar"/>
<pathelement location="${ant_home_lib}/svnjavahl.jar"/>
<pathelement location="${ant_home_lib}/*.jar"/>
</path>
<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="svnant.classpath" />
<svnSetting
svnkit="false"
javahl="false"
username="name"
password="pwd"
id="svn.settings"/>
<target name="checkout">
<svn refid="svn.settings" >
<checkout url="http://ip/repos/prject_name/trunk/" destPath="${local_root}" revision="HEAD"/>
</svn>
</target>
</project>
----
This blog provides Ant build scripts for checkout sources from CVS and SVN repositories, including configuration of properties, targets, and commands.
1148

被折叠的 条评论
为什么被折叠?



