为了使用Ant构建面向持续集成的开发过程,使各种Ant脚本可以作为模块根据需要动态增加
1、为了让不同的用户使用相同的Ant脚本,将CVS的用户信息保存在cvsuser.properties中
2、为了让不同的项目可以复用Ant脚本,将项目信息保存在project.properties中。
cvsuser.properties
- ##
#
## - #
cvsuser = cvsusername - #
cvspass = cvspass - #
cvs.repository = :pserver:${cvsuser}:${cvspass}@127.0.0.1:/cvsdata - #
- ciroot = ../CI
checkout.dir = ${ciroot}/CheckOut
project.properties
- ##
#
## - #
project.name=webservice
build.xml
- <?xml version="1.0"?>
- <project name="AntCVS" basedir="." default="checkOut">
- <!-- ============================ -->
- <!-- === Properties setting === -->
- <!-- ============================ -->
- <!-- Load system specific properties -->
- <property file="custom.properties" />
- <!-- Load default properties -->
- <property file="build.properties" />
- <!-- Load project properties -->
- <property file="project.properties" />
- <!-- Load cvsuser properties -->
- <property file="cvsuser.properties" />
- <!-- =================================
- target: checkOut
- ================================= -->
- <target name="checkOut" depends="" description="CheckOut webservice sources ">
- <mkdir dir="${checkout.dir}" />
- <cvs cvsRoot="${cvs.repository}" package="${project.name}" dest="${checkout.dir}" />
- </target>
- <!-- =================================
- target: clean
- ================================= -->
- <target name="clean" depends="" description="">
- <delete dir="${checkout.dir}" />
- </target>
- </project>