為了使用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>