在ant中使用cvs功能自动完成每日构建。
2004-07-23 01:13
495 查看
实现的主要功能是:自动从cvs中check out模块,然后编译,把编译后的class打成jar,再commit到cvs服务器的指定位置。
build.xml
ywzcpt/build.xml片断:
最后,在win2k中制定一个计划任务,就可以了。
build.xml
代码: |
<?xml version="1.0"?> <project name="gnt Auto build" basedir="." default="build"> <!-- The CVSROOT value --> <property name="cvsroot" value=":pserver:dhf:@192.168.0.200:D:/cvs_repository_z"/> <property name="cvs.password" value=""/> <property name="ywzcpt.dir" value="${basedir}/ywzcpt"/> <property name="ywzcpt.module.name" value="ywzcpt"/> <property name="zfyw.dir" value="${basedir}/zfyw"/> <property name="zfyw.module.name" value="zfyw"/> <property name="external.dir" value="${basedir}/external"/> <property name="external.module.name" value="external"/> <property name="cvs-op" value="co " /> <!-- Initializing --> <target name="init"> <tstamp> <format property="today" pattern="yyyy-MM-dd hh:mm:ss"/> </tstamp> <echo message="${today}" /> </target> <target name="prepare" depends="init" > <cvspass cvsroot="${cvsroot}" password="${cvs.password}" passfile="ant-cvs.cvspass"/> </target> <target name="external-check-out" depends="prepare"> <cvs cvsRoot="${cvsroot}" package="${external.module.name}" passfile="ant-cvs.cvspass"/> </target> <!-- Retrieve the ywzcpt module --> <target name="ywzcpt-check-out" depends="external-check-out"> <delete dir="${ywzcpt.module.name}"/> <cvs cvsRoot="${cvsroot}" package="${ywzcpt.module.name}" passfile="ant-cvs.cvspass"/> </target> <target name="zfyw-check-out" depends="external-check-out"> <delete dir="${zfyw.module.name}"/> <cvs cvsRoot="${cvsroot}" package="${zfyw.module.name}" passfile="ant-cvs.cvspass"/> </target> <!-- cvs checkout --> <target name="check-out"> <antcall target="external-check-out" /> <antcall target="ywzcpt-check-out" /> <antcall target="zfyw-check-out" /> </target> <!-- build XSP framework --> <target name="build"> <echo message="+=============================================+" /> <echo message="| Start Building GNT for compilation |" /> <echo message="+=============================================+" /> <antcall target="ywzcpt-build" /> <echo message="+=============================================+" /> <echo message="| End Building GNT for compilation |" /> <echo message="+=============================================+" /> </target> <target name="ywzcpt-build" depends="ywzcpt-check-out"> <echo message="+---------------------------------------------+" /> <echo message="| Start Building ywzcpt for compilation |" /> <echo message="+---------------------------------------------+" /> <ant antfile="build.xml" dir="${ywzcpt.module.name}" output="ywzcpt.log" /> <property name="ywzcpt.add" value="add ./build/log/*.log ./build/*.jar ./build/*.war"/> <property name="ywzcpt.commit" value="commit -m '${today}' ./build/log/*.log ./build/*.jar ./build/*.war"/> <ant antfile="build.xml" dir="${ywzcpt.module.name}" target="commit-build" /> <echo message="+---------------------------------------------+" /> <echo message="+ End Building ywzcpt for compilation |" /> <echo message="+---------------------------------------------+" /> </target> <target name="zfyw-build" depends="zfyw-check-out, ywzcpt-build"> <echo message="+---------------------------------------------+" /> <echo message="| Start Building ywzcpt for compilation |" /> <echo message="+---------------------------------------------+" /> <ant antfile="build.xml" dir="${zfyw.module.name}" output="zfyw.log" /> <property name="zfyw.add" value="add ./build/log/*.log ./build/*.jar ./build/*.war"/> <property name="zfyw.commit" value="commit -m '${today}' ./build/log/*.log ./build/*.jar ./build/*.war"/> <ant antfile="build.xml" dir="${zfyw.module.name}" target="commit-build" /> <echo message="+---------------------------------------------+" /> <echo message="+ End Building ywzcpt for compilation |" /> <echo message="+---------------------------------------------+" /> </target> <target name="clean" > <delete dir="${ywzcpt.module.name}"/> </target> </project> |
代码: |
主要实现commit功能 <target name="commit-build"> <cvs cvsRoot="${cvsroot}" passfile="${root.dir}/ant-cvs.cvspass" command="${ywzcpt.add}"/> <cvs cvsRoot="${cvsroot}" passfile="${root.dir}/ant-cvs.cvspass" command="${ywzcpt.commit}"/> </target> |
相关文章推荐
- 主题:在ant中使用cvs功能自动完成每日构建
- 自动构建工具Ant深入剖析(四) 使用CVS及自定义任务
- Atlas学习手记(4):使用AutoComplete Extender实现自动完成功能
- 使用Ant自动完成部署(1)
- 使用AutoComplete Extender实现自动完成功能
- asp.net ajax 使用AutoCompleteExtender开发自动完成功能
- 使用ANT,SVN,CruiseControl构建每日集成
- Atlas学习手记(4):使用AutoComplete Extender实现自动完成功能
- 使用HTML_QuickForm快速完成自动表单完成功能
- editplus配置自动完成功能 + 使用感想
- 【转】使用 jQuery(Ajax)/PHP/MySQL实现自动完成功能
- java 自动构建工具-Ant介绍(很多企业使用的)
- 使用ASP.NET Atlas AutoComplete Behavior或AutoComplete Extender实现自动完成功能(上) 【转自http://dflying.cnblogs.com】
- 使用ant实现svn管理得eclipse插件开发项目的日构建功能(ant1.7.1+svn1.6.3+eclipse3.4.2)
- 在dnn中使用 DNN Text Suggest Control实现自动完成功能
- Atlas学习手记(4):使用AutoComplete Extender实现自动完成功能
- 自动化每日构建(二)用Ant来完成java工程的每日构建
- asp.net ajax 使用AutoCompleteExtender开发自动完成功能
- MASM32编程使用自动完成功能
- 使用ant实现svn管理得eclipse插件开发项目的日构建功能(ant1.7.1+svn1.6.3+eclipse3.4.2)