分类: WINDOWS
2009-06-18 15:35:58
xml version='1.0' encoding='gb2312'?> 2<cruisecontrol> 3 <project name="projectName"> 4 5 6 <listeners> 7 8 <currentbuildstatuslistener file="logs/${project.name}/status.txt"/> 9 listeners> 10 11 12 <bootstrappers> 13 14 <svnbootstrapper localWorkingCopy="projects/${project.name}" /> 15 bootstrappers> 16 17 18 19 <modificationset quietperiod="300"> 20 <svn localWorkingCopy="projects/${project.name}"/> 21 modificationset> 22 23 24 <schedule interval="60"> 25 <ant anthome="apache-ant-1.7.0" buildfile="projects/${project.name}/build.xml"/> 26 schedule> 27 28 29 <log> 30 31 <merge dir="projects/${project.name}/test-reports"/> 32 log> 33 34 35 <publishers> 36 37 38 40 41 46 <htmlemail 47 charset="UTF-8" 48 mailhost="test163.com" 49 defaultsuffix="@xxx.com" 50 username="xxx@163.com" 51 password="xxx" 52 returnname="CruiseControl" 53 returnaddress="xxx@163.com" 54 subjectprefix="构建日志" 55 xsldir="webapps/cruisecontrol/xsl" 56 css="webapps/cruisecontrol/css/cruisecontrol.css"> 57 <always address="xxx@xxx.com.cn"/> 58 <failure address="xxx@xxx,yyy@yyy.com.cn"/> 59 60 htmlemail> 61 62 publishers> 63 64 project> 65cruisecontrol> |
...............
项目工程下的build.xml说明: xml version="1.0" encoding="UTF-8" ?> 2 3 4<project default="CI" name="xxx" basedir="."> 5 6 7 8 <property file="build.properties"/> 9 10 11 12 13 <property name="projectName_CN" value="xxx"/> 14 15 <property name="projectFolder" value="${projcet.path}/${projcet.name}"/> 16 17 18 <property name="sourceFolder" value="${projectFolder}/src/main/java"/> 19 20 <property name="configFolder" value="${projectFolder}/src/main/config"/> 21 22 <property name="testFolder" value="${projectFolder}/src/test/java"/> 23 24 <property name="libFolder" value="${projectFolder}/WebRoot/WEB-INF/lib"/> 25 26 <property name="classFolder" value="${projectFolder}/WebRoot/WEB-INF/classes"/> 27 28 29 <property name="reportFolder" value="${projectFolder}/test-reports"/> 30 31 <property name="reportFileName" value="junit-noframes.html"/> 32 33 34 35 36 <property name="warFile" value="${projectFolder}/${projcet.name}.war"/> 37 38 <property name="webFile" value="${projectFolder}/WebRoot/WEB-INF/web.xml"/> 39 40 <property name="warSource" value="${projectFolder}/target/classes"/> 41 42 43 44 45 <path id="compilePath"> 46 47 <pathelement path="${classFolder}" /> 48 49 <path refid="libPath" /> 50 path> 51 52 53 <path id="jUnitPath"> 54 55 <pathelement path="${classFolder}" /> 56 57 <path refid="libPath" /> 58 path> 59 60 61 <path id="libPath"> 62 63 <fileset dir="${libFolder}"> 64 <include name="**/*.jar" /> 65 fileset> 66 path> 67 68 69 70 71 <target name="CI" depends="init,compile,test,makewar,deploy-catalina" description="持续集成"/> 72 73 74 <target name="init" description="初始化"> 75 76 <echo>正在删除编译程序目录echo> 77 <delete dir="${classFolder}" /> 78 <echo>正在创建编译程序目录echo> 79 <mkdir dir="${classFolder}" /> 80 81 <echo>正在删除单元测试报告目录echo> 82 <delete dir="${reportFolder}" /> 83 <echo>正在创建单元测试报告目录echo> 84 <mkdir dir="${reportFolder}" /> 85 target> 86 87 88 <target name="compile" depends="init" description="编译"> 89 <echo>编译源程序echo> 90 91 <javac classpathref="compilePath" fork="true" memorymaximumsize="128m" 92 destdir="${classFolder}" debug="true" deprecation="false" 93 failonerror="false" verbose="false"> 94 95 <src path="${sourceFolder}" /> 96 97 <src path="${testFolder}" /> 98 99 <src path="${configFolder}" /> 100 101 <include name="**/*.java" /> 102 javac> 103 <copy todir="${classFolder}"> 104 <fileset dir="${configFolder}"> 105 <include name="**/*.*"/> 106 fileset> 107 <fileset dir="${sourceFolder}"> 108 <include name="**/*.xml"/> 109 fileset> 110 copy> 111 target> 112 113 114 <target name="test" description="执行单元测试"> 115 <echo>运行单元测试用例echo> 116 117 <junit printsummary="true"> 118 <classpath refid="jUnitPath" /> 119 120 <formatter type="xml"/> 121 122 <batchtest todir="${reportFolder}"> 123 124 <fileset dir="${classFolder}"> 125 126 <include name="**/*Test.class"/> 127 fileset> 128 batchtest> 129 junit> 130 131 <echo>生成单元测试报告echo> 132 133 <junitreport todir="${reportFolder}" description="生成单元测试报告"> 134 <fileset dir="${reportFolder}"> 135 136 <include name="TEST-*.xml" /> 137 fileset> 138 139 <report format="frames" todir="${reportFolder}" /> 140 junitreport> 141 target> 142 143 144 <target name="makewar" depends="" description="发布WAR文件"> 145 <echo>打包成war文件echo> 146 <war destfile="${warFile}" webxml="${webFile}"> 147 148 <fileset dir="${projectFolder}/WebRoot" excludes="WEB-INF/web.xml,WEB-INF/classes/**/*Test.class"/> 149 war> 150 target> |
|
|