`
abalone
  • 浏览: 126511 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

build xml

    博客分类:
  • CC
阅读更多
<?xml version="1.0" encoding="UTF-8"?>
<!--
*************************************************************
Create Description:

Date        : 
Author      : 
Email       : 
Description :
This Ant script is used to execute daily build task of GMBPD.
For additional information, refer to Daily build process_JohnXiao.vsd
*************************************************************
-->


<project name="root">

<!-- this block is the configuration for CVS -->
<property name="cvs.root" value=":pserver:wanwanwa@lion.chn.hp.com:/external/Repo2" />
<property name="cvs.password" value="cssc_new" />
<property name="cvs.file" value=".cvspass" />

<!-- this block is the dailybuild base directory on gmbpdserver -->
<property name="ftproot.dir" value="/export/home/ftproot" />
<property name="dailybuild.dir" value="${ftproot.dir}/dailybuild" />

<!-- this block is the directory structure for CVS -->
<property name="cvs.gmbpd.rootdir" value="${dailybuild.dir}/cvsdir" />
<property name="cvs.gmbpd.basedir" value="${cvs.gmbpd.rootdir}/GMBPD" />
<property name="package.src" value="GMBPD/src" />
<property name="package.testdata" value="GMBPD/docs/test/TestData/Release2" />
<property name="cvs.src.dir" value="${cvs.gmbpd.rootdir}/${package.src}" />
<property name="cvs.lib.dir" value="${cvs.src.dir}/lib" />
<property name="cvs.java.dir" value="${cvs.src.dir}/java" />
<property name="cvs.test.dir" value="${cvs.src.dir}/test" />
<property name="cvs.deploy.dir" value="${cvs.src.dir}/deploy" />
<property name="cvs.configuration.dir" value="${cvs.deploy.dir}/configuration" />
<property name="cvs.db.script.dir" value="${cvs.deploy.dir}/DB/script" />
<property name="cvs.db.procedure.dir" value="${cvs.deploy.dir}/DB/procedure" />
<property name="cvs.web.dir" value="${cvs.src.dir}/web" />
<property name="cvs.images.dir" value="${cvs.web.dir}/images" />
<property name="cvs.js.dir" value="${cvs.web.dir}/js" />
<property name="cvs.jsp.dir" value="${cvs.web.dir}/jsp" />
<property name="cvs.conf.dir" value="${cvs.web.dir}/conf" />
<property name="cvs.tlds.dir" value="${cvs.web.dir}/tlds" />
<property name="cvs.help.dir" value="${cvs.src.dir}/help" />
<property name="cvs.help.enus.dir" value="${cvs.help.dir}/en_US" />
<property name="onlinehelp.name" value="BPD_Help_Screens_11062005_ForRelease.tar" />

<!-- this block is the directory of jar package for unit-test of common module -->
<property name="package.utlib" value="GMBPD/build/utlib" />
<property name="cvs.utlib.dir" value="${cvs.gmbpd.rootdir}/${package.utlib}" />

<!-- this block is the directory structure for CVS dailybuild -->
<property name="cvs.dailybuild.dir" value="${cvs.gmbpd.basedir}/build/dailybuild" />
<property name="cvs.war.dir" value="${cvs.dailybuild.dir}/war" />
<property name="cvs.report.dir" value="${cvs.dailybuild.dir}/report" />
<property name="cvs.junitreport.dir" value="${cvs.dailybuild.dir}/JunitReport" />
<property name="cvs.pmdreport.dir" value="${cvs.dailybuild.dir}/pmdReport" />
<property name="cvs.bugreport.dir" value="${cvs.dailybuild.dir}/bugReport" />

<!-- this block is the directory structure for integration -->
<property name="cvs.integration.dir" value="${cvs.gmbpd.basedir}/report_integration" />
<property name="package.integration" value="GMBPD/report_integration" />
<property name="cvs.lib.integration.dir" value="${cvs.integration.dir}/lib" />
<property name="cvs.java.integration.dir" value="${cvs.integration.dir}/java" />
<property name="cvs.test.integration.dir" value="${cvs.integration.dir}/test" />
<property name="cvs.web.integration.dir" value="${cvs.integration.dir}/web" />
<property name="cvs.images.integration.dir" value="${cvs.web.integration.dir}/images" />
<property name="cvs.js.integration.dir" value="${cvs.web.integration.dir}/js" />
<property name="cvs.jsp.integration.dir" value="${cvs.web.integration.dir}/jsp" />
<property name="cvs.conf.integration.dir" value="${cvs.web.integration.dir}/conf" />
<property name="cvs.tlds.integration.dir" value="${cvs.web.integration.dir}/tlds" />
<property name="cvs.conf.integration.r2.tag" value="GMBPD_TAG_INTEGRATION_20060120201220" />
<property name="cvs.integration.r2.tag" value="GMBPD_TAG_INTEGRATION_20060223181521" />

<!-- this block is the directory structure for project GMBPD -->
<property name="gmbpd.rootdir" value="${dailybuild.dir}/project/GMBPD" />
<property name="gmbpd.src.dir" value="${gmbpd.rootdir}/src" />
<property name="gmbpd.images.dir" value="${gmbpd.rootdir}/images" />
<property name="gmbpd.js.dir" value="${gmbpd.rootdir}/js" />
<property name="gmbpd.jsp.dir" value="${gmbpd.rootdir}/jsp" />
<property name="gmbpd.webinf.dir" value="${gmbpd.rootdir}/WEB-INF" />
<property name="gmbpd.classes.dir" value="${gmbpd.webinf.dir}/classes" />
<property name="gmbpd.conf.dir" value="${gmbpd.webinf.dir}/conf" />
<property name="gmbpd.tlds.dir" value="${gmbpd.webinf.dir}/tlds" />
<property name="gmbpd.lib.dir" value="${gmbpd.webinf.dir}/lib" />
<!-- JSP precompile  -->
<property name="gmbpd.jspsrc.dir" value="${gmbpd.rootdir}/jspsrc" />
<property name="gmbpd.jspservlet.dir" value="${gmbpd.classes.dir}/jsp_servlet" />

<!-- this block is the directory structure for build script -->
<property name="buildscript.basedir" value="${dailybuild.dir}/script" />
<property name="buildscript.findbug.dir" value="${buildscript.basedir}/findBug" />
<property name="buildscript.pmd.dir" value="${buildscript.basedir}/PMD" />
<property name="buildscript.junit.dir" value="${buildscript.basedir}/junit" />
<property name="buildscript.junit.xml.dir" value="${buildscript.junit.dir}/xml" />
<property name="buildscript.junit.report.dir" value="${buildscript.junit.dir}/report" />
<property name="buildscript.ftp.dir" value="${buildscript.basedir}/ftpGMBPD" />

<!-- this block is the directory structure for deploy -->
<property name="deploy.basedir" value="${dailybuild.dir}/deploy" />
<property name="deploy.dir" value="${deploy.basedir}/GMBPD" />
<property name="deploy.conf.dir" value="${deploy.dir}/conf" />
<property name="deploy.lib.dir" value="${deploy.dir}/lib" />
<property name="deploy.log.dir" value="${deploy.dir}/log" />
<property name="deploy.server.dir" value="${deploy.dir}/server" />

<!-- this block is the directory structure for release -->
<property name="release.rootdir" value="${dailybuild.dir}/release" />
<property name="release.basedir" value="${release.rootdir}/gmbpd_release" />

<property name="release.webserver.dir" value="${release.basedir}/For_webserver" />
<property name="release.contain.web.dir" value="${release.webserver.dir}/contain" />
<property name="release.help.web.dir" value="${release.contain.web.dir}/gmbpd_help" />
<property name="release.enus.help.web.dir" value="${release.help.web.dir}/en_US" />

<property name="release.apserver.dir" value="${release.basedir}/For_apserver" />
<property name="release.contain.ap.dir" value="${release.apserver.dir}/contain" />
<property name="release.conf.ap.dir" value="${release.contain.ap.dir}/conf" />
<property name="release.lib.ap.dir" value="${release.contain.ap.dir}/lib" />
<property name="release.log.ap.dir" value="${release.contain.ap.dir}/log" />
<property name="release.server.ap.dir" value="${release.contain.ap.dir}/server" />

<property name="release.dbserver.dir" value="${release.basedir}/For_dbserver" />
<property name="release.contain.db.dir" value="${release.dbserver.dir}/contain" />
<property name="release.sql.db.dir" value="${release.contain.db.dir}/sql" />

<!-- this block is the directory structure for source code -->
<property name="source.rootdir" value="${dailybuild.dir}/source" />
<property name="source.basedir" value="${source.rootdir}/GMBPD" />
<property name="source.conf.dir" value="${source.basedir}/conf" />
<property name="source.lib.dir" value="${source.basedir}/lib" />
<property name="source.help.dir" value="${source.basedir}/help" />
<property name="source.sql.dir" value="${source.basedir}/sql" />
<property name="source.project.dir" value="${source.basedir}/project" />

<!-- this block is the directory for backup war package on gmbpdserver -->

<property name="backup.gmbpd.dir" value="${ftproot.dir}/GMBPDBACKUP" />
<property name="backup.deploy.dir" value="${backup.gmbpd.dir}/deploypackage" />
<property name="backup.release.dir" value="${backup.gmbpd.dir}/releasepackage" />
<property name="backup.src.dir" value="${backup.gmbpd.dir}/srcpackage" />

<!-- this block is the install directory of some software -->
<property name="install.basedir" value="/export/home/opt" />
<property name="install.findbug.dir" value="${install.basedir}/findbugs-0.9.1" />
<property name="install.pmd.lib.dir" value="${install.basedir}/pmd-3.2/lib" />
<property name="install.ant.lib.dir" value="${install.basedir}/ant-1.6.5/lib" />
<property name="install.j2sdk.lib.dir" value="${install.basedir}/j2sdk142_08/lib" />
<property name="install.weblogic.lib.dir" value="/export/home/opt/bea/weblogic81/server/lib" />

<!-- this block is the backup directory of gmbpd-app -->
<property name="remote.backup.dir" value="GMBPDBACKUP" />
<property name="remote.war.dir" value="${remote.backup.dir}/deploypackage" />
<property name="remote.release.dir" value="${remote.backup.dir}/releasepackage" />
<property name="remote.src.dir" value="${remote.backup.dir}/srcpackage" />

<!-- this block is the directory about weblogic deploy -->
<property name="wbdeploy.cluster.name.6001" value="server6001" />
<property name="wbdeploy.cluster.name.7021" value="gmbpdServer" />
<property name="wbdeploy.cluster.name.8001" value="server8001" />
<property name="wbdeploy.cluster.name.9001" value="server9001" />
<property name="wbdeploy.cluster.name.9999" value="server9999" />
<property name="wbdeploy.gmbpd-app.ip" value="16.157.129.20" />
<property name="wbdeploy.admin.addr" value="16.157.129.20" />
<property name="wbdeploy.admin.port.6001" value="6001" />
<property name="wbdeploy.admin.port.7001" value="7001" />
<property name="wbdeploy.admin.port.8001" value="8001" />
<property name="wbdeploy.admin.port.9001" value="9001" />
<property name="wbdeploy.admin.port.9999" value="9999" />
<property name="wbdeploy.admin.username" value="weblogic" />
<property name="wbdeploy.admin.password" value="weblogic" />
<property name="wbdeploy.war.name" value="GMBPD" />
<property name="wbdeploy.basedir" value="/export/home/weblogic" />
<property name="wbdeploy.server.dir" value="${wbdeploy.basedir}/BPD_HOME/server" />
<property name="wbdeploy.server.bob.dir" value="${wbdeploy.basedir}/BPD_HOME_BOB/server" />

<!-- this block is the mail list for weblogic deploy -->
<property name="lion.chn.hp.com" value="16.157.128.105" />
<property name="lead.maillist" value="lzhang@hp.com, guangcai.wang@hp.com, jerry.ho@hp.com" />
<property name="alltest.maillist" value="liang.chen4@hp.com, alex.wan@hp.com, xuhui.wu@hp.com, zhenhua.xu@hp.com, yun.zhou@hp.com, ming.liu2@hp.com, jianzhong.sun@hp.com" />
<property name="cut.maillist" value="xionghua.wang@hp.com, xinrong.wei@hp.com, michael-liu@hp.com" />
<property name="self.mailaddr" value="alex.wan@hp.com" />

<!-- common classpath -->
<path id="classpath.common">
<fileset dir="${install.ant.lib.dir}">
<include name="*.jar" />
</fileset>
<fileset dir="${install.j2sdk.lib.dir}">
<include name="*.jar" />
</fileset>
<fileset dir="${cvs.lib.dir}">
<include name="*.jar" />
</fileset>
<fileset dir="${cvs.lib.integration.dir}">
<include name="*.jar" />
</fileset>
<fileset dir="${cvs.utlib.dir}">
<include name="*.jar" />
</fileset>
<fileset dir="${install.pmd.lib.dir}">
<include name="*.jar" />
</fileset>
<fileset dir="${gmbpd.classes.dir}">
<include name="**/*.class" />
</fileset>
<pathelement path="${gmbpd.classes.dir}" />
</path>

<!-- junit test classpath -->
<path id="classpath.junit">
<fileset dir="${cvs.utlib.dir}">
<include name="*.jar" />
</fileset>
<fileset dir="${gmbpd.lib.dir}">
<include name="*.jar" />
</fileset>
<pathelement path="${install.ant.lib.dir}/clover.jar" />
<pathelement path="${gmbpd.classes.dir}" />
<pathelement path="${cvs.conf.dir}" />
</path>

<!-- jsp pre-compile classpath -->
<path id="classpath.jsp.precompile">
<pathelement location="${install.j2sdk.lib.dir}/tools.jar" />
<pathelement location="${install.ant.lib.dir}/ant.jar" />
<pathelement location="${install.ant.lib.dir}/jasper-runtime.jar" />
<pathelement location="${install.ant.lib.dir}/jasper-compiler.jar" />
<pathelement location="${install.ant.lib.dir}/xercesImpl.jar" />
<pathelement location="${install.ant.lib.dir}/xml-apis.jar" />
<pathelement location="${cvs.lib.dir}/servlet_2_3.jar" />
</path>

<!-- jsp pre-compile classpath2 -->
<path id="classpath2.jsp.precompile">
<pathelement location="${gmbpd.classes.dir}" />
<fileset dir="${gmbpd.lib.dir}">
<include name="*.jar" />
</fileset>
<pathelement location="${gmbpd.lib.dir}/struts.jar" />
<pathelement location="${install.weblogic.lib.dir}/weblogic.jar" />
<pathelement location="${install.j2sdk.lib.dir}/tools.jar" />
<pathelement location="${install.ant.lib.dir}/ant.jar" />
<pathelement location="${install.ant.lib.dir}/jasper-runtime.jar" />
<pathelement location="${install.ant.lib.dir}/jasper-compiler.jar" />
<pathelement location="${install.ant.lib.dir}/xercesImpl.jar" />
<pathelement location="${install.ant.lib.dir}/xml-apis.jar" />
<pathelement location="${cvs.lib.dir}/servlet_2_3.jar" />
</path>

<!-- ********************************************************************* -->
<!-- below are the targets defined by JohnXiao -->

<target name="init">
<mkdir dir="${gmbpd.rootdir}" />
<mkdir dir="${gmbpd.webinf.dir}" />
<mkdir dir="${gmbpd.src.dir}" />
<mkdir dir="${gmbpd.classes.dir}" />
<mkdir dir="${gmbpd.conf.dir}" />
<mkdir dir="${gmbpd.tlds.dir}" />
<mkdir dir="${gmbpd.lib.dir}" />
<mkdir dir="${gmbpd.images.dir}" />
<mkdir dir="${gmbpd.js.dir}" />
<mkdir dir="${gmbpd.jsp.dir}" />
</target>

<!-- clean environment -->
<target name="clean">
<echo message="start clean" />
<delete file="buildFail.txt" />
<delete file="build.properties" />
<delete dir="${cvs.src.dir}" />
<delete dir="${cvs.integration.dir}" />
<delete dir="${cvs.utlib.dir}" />
<delete dir="${gmbpd.rootdir}" />
<delete file="${buildscript.ftp.dir}/*.*" />
<delete dir="${buildscript.junit.xml.dir}" />
<delete dir="${buildscript.junit.report.dir}" />
<mkdir dir="${buildscript.junit.xml.dir}" />
<mkdir dir="${buildscript.junit.report.dir}" />
<delete dir="${release.rootdir}" />
<mkdir dir="${release.rootdir}" />
<delete dir="${source.rootdir}" />
<mkdir dir="${source.rootdir}" />
</target>

<!-- clean environment except cvs directory -->
<target name="cleannocvs">
<echo message="start clean" />
<delete file="buildFail.txt" />
<!-- <delete file="build.properties"/> -->
<!-- <delete dir="${cvs.src.dir}"/> -->
<delete dir="${gmbpd.rootdir}" />
<delete file="${buildscript.ftp.dir}/*.*" />
<delete dir="${buildscript.junit.xml.dir}" />
<delete dir="${buildscript.junit.report.dir}" />
<mkdir dir="${buildscript.junit.xml.dir}" />
<mkdir dir="${buildscript.junit.report.dir}" />
<delete dir="${release.rootdir}" />
<mkdir dir="${release.rootdir}" />
<delete dir="${source.rootdir}" />
<mkdir dir="${source.rootdir}" />
</target>

<!-- login to CVS server -->
<target name="login">
<cvspass cvsroot="${cvs.root}" password="${cvs.password}" passfile="${cvs.file}" />
</target>

<!-- check out some packages of GMBPD project from cvs server -->
<target name="checkout">
<cvs command="checkout" cvsroot="${cvs.root}" dest="${cvs.gmbpd.rootdir}" package="${package.src}" passfile="${cvs.file}" />
<cvs command="checkout" cvsroot="${cvs.root}" dest="${cvs.gmbpd.rootdir}" package="${package.utlib}" passfile="${cvs.file}" />
<cvs command="checkout" cvsroot="${cvs.root}" dest="${cvs.gmbpd.rootdir}" package="${package.integration}" passfile="${cvs.file}" />
</target>

<!-- update the latest source code from cvs server -->
<target name="update">
<cvs cvsroot="${cvs.root}" dest="${cvs.src.dir}" command="update -A -d -C" passfile="${cvs.file}" />
<cvs cvsroot="${cvs.root}" dest="${cvs.utlib.dir}" command="update -A -d -C" passfile="${cvs.file}" />
<cvs cvsroot="${cvs.root}" dest="${cvs.integration.dir}" command="update -A -d -C" passfile="${cvs.file}" />
</target>

<!-- update the src package to CVS src with tag name -->
<target name="update.tag">
<loadproperties srcfile="build.properties" />
<cvs cvsroot="${cvs.root}" command="update -r ${tag.name}" dest="${cvs.src.dir}" passfile=".cvspass" />
<cvs cvsroot="${cvs.root}" command="update -r ${tag.name}" dest="${cvs.utlib.dir}" passfile=".cvspass" />
<cvs cvsroot="${cvs.root}" command="update -r ${tag.name}" dest="${cvs.integration.dir}" passfile="${cvs.file}" />
</target>

<target name="update.r2">
<cvs cvsroot="${cvs.root}" command="update -d -C -r ${cvs.integration.r2.tag}" dest="${cvs.integration.dir}" passfile=".cvspass" />
</target>

<!-- update the two r2 file for r2 build-->
<target name="update.web.xml.tag">
<cvs cvsroot="${cvs.root}" command="update -d -C -r ${cvs.conf.integration.r2.tag} web.xml" dest="${cvs.conf.integration.dir}" passfile=".cvspass" />
<cvs cvsroot="${cvs.root}" command="update -d -C -r ${cvs.conf.integration.r2.tag} struts-config.xml" dest="${cvs.conf.integration.dir}" passfile=".cvspass" />
</target>

<!-- copy xml_lock.xml to ${cvs.gmbpd.rootdir} -->
<target name="copy.lock">
<copy todir="${cvs.gmbpd.rootdir}" file="build_lock.xml" />
</target>

<!-- delete xml_lock.xml from ${cvs.gmbpd.rootdir} -->
<target name="delete.lock">
<delete file="${cvs.gmbpd.rootdir}/build_lock.xml" />
<delete file="${cvs.gmbpd.rootdir}/${cvs.file}" />
</target>

<!-- create tag name according to current time for the current version -->
<target name="create.tag.name">
<tstamp>
<format property="current_time" pattern="yyyyMMddHHmmss" locale="en" />
</tstamp>
<!-- GMBPD_TAG_YYYYMMDDhhmmss -->
<property name="tag.name" value="GMBPD_TAG_INTEGRATION_${current_time}" />
<echo file="build.properties">tag.name=${tag.name}</echo>
</target>

<!-- add the specified tag for the current source in the CVS server. -->
<target name="tag">
<loadproperties srcfile="build.properties" />
<cvs command="rtag ${tag.name}" cvsroot="${cvs.root}" package="${package.src}" passfile="${cvs.file}" failonerror="true" />
<cvs command="rtag ${tag.name}" cvsroot="${cvs.root}" package="${package.integration}" passfile="${cvs.file}" failonerror="true" />
<cvs command="rtag ${tag.name}" cvsroot="${cvs.root}" package="${package.utlib}" passfile="${cvs.file}" failonerror="true" />
<cvs command="rtag ${tag.name}" cvsroot="${cvs.root}" package="${package.testdata}" passfile="${cvs.file}" failonerror="true" />
</target>

<!-- copy files from the cvs work folder to project folder -->
<target name="synch">
<copy todir="${gmbpd.src.dir}" preservelastmodified="true" includeemptydirs="yes">
<fileset dir="${cvs.java.dir}">
<include name="**" />
<exclude name="**/CVS/**" />
<exclude name="com/gm/bpd/countermeasure/**" />
</fileset>
</copy>

<copy todir="${gmbpd.src.dir}" preservelastmodified="true" includeemptydirs="yes">
<fileset dir="${cvs.java.integration.dir}">
<include name="**" />
<exclude name="**/CVS/**" />
</fileset>
</copy>

<copy todir="${gmbpd.tlds.dir}" preservelastmodified="true" includeemptydirs="no">
<fileset dir="${cvs.tlds.dir}" includes="*.tld" />
</copy>

<copy todir="${gmbpd.tlds.dir}" preservelastmodified="true" includeemptydirs="no">
<fileset dir="${cvs.tlds.integration.dir}" includes="*.tld" />
</copy>

<copy todir="${gmbpd.lib.dir}" preservelastmodified="true" includeemptydirs="no">
<fileset dir="${cvs.lib.dir}" includes="*.jar,*.zip" />
</copy>

<copy todir="${gmbpd.lib.dir}" preservelastmodified="true" includeemptydirs="no">
<fileset dir="${cvs.lib.integration.dir}/" includes="*.jar,*.zip" />
</copy>

<copy todir="${gmbpd.jsp.dir}" preservelastmodified="true" includeemptydirs="yes">
<fileset dir="${cvs.jsp.dir}">
<include name="**" />
<exclude name="cm/**" />
<exclude name="**/CVS/**" />
</fileset>
</copy>

<copy todir="${gmbpd.jsp.dir}" preservelastmodified="true" includeemptydirs="yes">
<fileset dir="${cvs.jsp.integration.dir}">
<include name="**" />
<exclude name="**/CVS/**" />
</fileset>
</copy>

<copy todir="${gmbpd.images.dir}" preservelastmodified="true" includeemptydirs="no">
<fileset dir="${cvs.images.dir}" includes="**/*.*" />
</copy>

<copy todir="${gmbpd.images.dir}" preservelastmodified="true" includeemptydirs="no">
<fileset dir="${cvs.images.integration.dir}" includes="**/*.*" />
</copy>

<copy todir="${gmbpd.js.dir}" preservelastmodified="true" includeemptydirs="no">
<fileset dir="${cvs.js.dir}" includes="**/*.*" />
</copy>

<copy todir="${gmbpd.js.dir}" preservelastmodified="true" includeemptydirs="no">
<fileset dir="${cvs.js.integration.dir}" includes="**/*.*" />
</copy>

<mkdir dir="${gmbpd.classes.dir}" />

<!-- weblogic.xml and BPDLoggerProperties.xml will be copied from ${cvs.configuration.dir}   -->
<!-- web.xml and struts-config.xml will be copied from ${cvs.conf.integration.dir}   -->
<copy todir="${gmbpd.conf.dir}" preservelastmodified="true" includeemptydirs="no">
<fileset dir="${cvs.conf.dir}" includes="*.xml" excludes="web.xml, weblogic.xml, BPDLoggerProperties.xml, struts-config.xml" />
</copy>

<copy todir="${gmbpd.conf.dir}" preservelastmodified="true" includeemptydirs="no">
<fileset dir="${cvs.conf.integration.dir}" includes="*.xml" excludes="web.xml" />
</copy>

<copy todir="${gmbpd.webinf.dir}" file="${cvs.conf.integration.dir}/web.xml" />

<!-- weblogic.xml: add context path "gmbpd"   -->
<copy tofile="${gmbpd.webinf.dir}/weblogic.xml" file="${cvs.configuration.dir}/weblogic.deploy.xml" />

<!-- copy 2 files to the project directory for connecting db in the condition of configing connection pool etc.  -->
<delete file="${gmbpd.src.dir}/com/gm/bpd/common/http/ServletBootStrap.java" />
<copy tofile="${gmbpd.src.dir}/com/gm/bpd/common/http/ServletBootStrap.java" file="${cvs.configuration.dir}/ServletBootStrap.deploy.java" />
<delete file="${gmbpd.src.dir}/com/gm/bpd/common/transaction/Session.java" />
<copy tofile="${gmbpd.src.dir}/com/gm/bpd/common/transaction/Session.java" file="${cvs.configuration.dir}/Session.deploy.java" />
</target>

<!-- copy test files from the cvs work folder to project folder -->
<target name="synch.test">
<copy todir="${gmbpd.src.dir}" preservelastmodified="true" includeemptydirs="yes">
<fileset dir="${cvs.test.dir}">
<include name="**/*.xml" />
<include name="**/test/*.java" />
</fileset>
</copy>
<copy todir="${gmbpd.src.dir}" preservelastmodified="true" includeemptydirs="yes">
<fileset dir="${cvs.test.integration.dir}">
<include name="**" />
<exclude name="**/CVS/**" />
</fileset>
</copy>
</target>

<!-- compile the java source codes retrieved from the server -->
<target name="compile">
<javac classpathref="classpath.common" destdir="${gmbpd.classes.dir}" srcdir="${gmbpd.src.dir}" deprecation="no" debug="true" debuglevel="lines,vars,source" failonerror="false">
<include name="com/gm/bpd/admin/**/*.java" />
</javac>

<javac classpathref="classpath.common" destdir="${gmbpd.classes.dir}" srcdir="${gmbpd.src.dir}" deprecation="no" debug="true" debuglevel="lines,vars,source" failonerror="false">
<include name="com/gm/bpd/attribute/**/*.java" />
</javac>

<javac classpathref="classpath.common" destdir="${gmbpd.classes.dir}" srcdir="${gmbpd.src.dir}" deprecation="no" debug="true" debuglevel="lines,vars,source" failonerror="false">
<include name="com/gm/bpd/common/**/*.java" />
</javac>

<javac classpathref="classpath.common" destdir="${gmbpd.classes.dir}" srcdir="${gmbpd.src.dir}" deprecation="no" debug="true" debuglevel="lines,vars,source" failonerror="false">
<include name="com/gm/bpd/datacollection/**/*.java" />
</javac>

<javac classpathref="classpath.common" destdir="${gmbpd.classes.dir}" srcdir="${gmbpd.src.dir}" deprecation="no" debug="true" debuglevel="lines,vars,source" failonerror="false">
<include name="com/gm/bpd/metric/**/*.java" />
</javac>

<javac classpathref="classpath.common" destdir="${gmbpd.classes.dir}" srcdir="${gmbpd.src.dir}" deprecation="no" debug="true" debuglevel="lines,vars,source" failonerror="false">
<include name="com/gm/bpd/scorecard/**/*.java" />
</javac>

<javac classpathref="classpath.common" destdir="${gmbpd.classes.dir}" srcdir="${gmbpd.src.dir}" deprecation="no" debug="true" debuglevel="lines,vars,source" failonerror="false">
<include name="com/gm/bpd/scorecardview/**/*.java" />
</javac>

<javac classpathref="classpath.common" destdir="${gmbpd.classes.dir}" srcdir="${gmbpd.src.dir}" deprecation="no" debug="true" debuglevel="lines,vars,source" failonerror="false">
<include name="com/gm/bpd/target/**/*.java" />
</javac>
</target>

<!-- create compile excel report according to build log "log2excel.jar" -->
<target name="compile.report">
<loadproperties srcfile="build.properties" />
<java classname="com.hp.flashdragon.excel.CreateXlsLog" classpathref="classpath.common">
<arg value="${tag.name}" />
<arg value="${buildscript.basedir}/log/build.log" />
</java>
<copy file="${buildscript.basedir}/${tag.name}.xls" todir="${cvs.report.dir}" />
<delete file="${buildscript.basedir}/${tag.name}.xls" />
</target>

<!-- clear nohup.out in all domains -->
<target name="clear.nohup">
<telnet userid="weblogic" password="bpd@hp" server="${wbdeploy.gmbpd-app.ip}">
<read timeout="5" string="$" />
<write echo="false">/export/home/weblogic/bea/user_projects/clearnohup.sh</write>
<read timeout="5" string="$" />
</telnet>
</target>

<!-- create the deploy directory -->
<target name="deploy.init">
<mkdir dir="${deploy.conf.dir}" />
<mkdir dir="${deploy.lib.dir}" />
<mkdir dir="${deploy.log.dir}" />
<mkdir dir="${deploy.server.dir}" />
<antcall target="clear.nohup" />
</target>

<!-- insert servlet and servlet-mapping information to web.xml -->
<target name="insert.servlet.info">
<java classname="com.hp.xml.webxml.InsertWebXML" classpath="${install.ant.lib.dir}/insertWebXML.jar">
<arg value="${gmbpd.jsp.dir}" />
<arg value="${gmbpd.webinf.dir}/web.xml" />
</java>
</target>

<!-- create deploy war folder tree -->
<target name="deploy.war.tree">
<loadproperties srcfile="build.properties" />
<delete dir="${deploy.dir}" />

<!-- create the deploy folder tree -->
<antcall target="deploy.init" />

<!-- copy conf files to deploy directory:  5 files -->
<copy todir="${deploy.conf.dir}" preservelastmodified="true" includeemptydirs="yes">
<fileset dir="${cvs.conf.dir}/" includes="*.properties" excludes="bpdserver.properties" />
</copy>
<copy tofile="${deploy.conf.dir}/BPDLoggerProperties.xml" file="${cvs.configuration.dir}/BPDLoggerProperties.deploy.xml" />
<copy todir="${deploy.conf.dir}" file="${cvs.conf.integration.dir}/bpdserver.properties" />

<!-- copy lib files to lib directory: 1 files -->
<copy todir="${deploy.lib.dir}" file="${cvs.lib.dir}/ojdbc14.jar" />

<!-- generate war package -->
<war file="${deploy.server.dir}/GMBPD.war" webxml="${gmbpd.webinf.dir}/web.xml">
<!-- configuration files -->
<webinf dir="${gmbpd.webinf.dir}">
<include name="weblogic.xml" />
<include name="conf/*.xml" />
<include name="tlds/*.tld" />
</webinf>
<!-- classes and jar libraries. -->
<classes dir="${gmbpd.classes.dir}">
<include name="com/gm/bpd/**/*.class" />
<exclude name="com/gm/bpd/common/dao/ObjectPool.class" />
<exclude name="com/gm/bpd/common/dao/DatabaseManager.class" />
<exclude name="com/gm/bpd/**/test/*.class" />
<!-- JSP pre-compile -->
<include name="jsp_servlet/**/*.class" />
</classes>
<lib dir="${gmbpd.lib.dir}">
<include name="*.jar" />
<exclude name="dbunit-2.1.jar" />
<exclude name="junit.jar" />
<exclude name="ojdbc14.jar" />
</lib>
<!-- js,css, java script and images files -->
<fileset dir="${gmbpd.rootdir}">
<include name="js/*.css" />
<include name="js/*.js" />
<include name="images/**/*.*" />
<include name="images/*.*" />
<exclude name="images/*.db" />
<exclude name="images/**/*.db" />
</fileset>
</war>
</target>

<!-- update log directory in BPD_HOME_BOB/conf/BPDLoggerProperties.xml  -->
<target name="update.log.dir">
<java classname="com.hp.UpdateLoggerDir" classpath="${install.ant.lib.dir}/updateLoggerDir.jar">
<arg value="${deploy.conf.dir}/BPDLoggerProperties.xml" />
</java>
</target>

<!-- disable notification -->
<target name="update.notification">
<java classname="com.hp.UpdateNotification" classpath="${install.ant.lib.dir}/updateNotification.jar">
<arg value="${deploy.conf.dir}/bpdserver.properties" />
</java>
</target>

<!-- create release folder tree -->
<target name="copy.release.3package">
<loadproperties srcfile="build.properties" />
<!-- copy release_notes.txt -->
<copy todir="${release.basedir}" file="${cvs.deploy.dir}/release_notes.txt" />

<!-- start: create tar package for web server... -->
<!--
            <copy todir="${release.enus.help.web.dir}" preservelastmodified="true" includeemptydirs="yes">
                 <fileset dir="${cvs.help.enus.dir}">
                     <include name="**"/>
                     <exclude name="**/CVS/**"/>
                </fileset>
            </copy>

            <tar tarfile="${release.webserver.dir}/gmbpd.tar" basedir="${release.contain.web.dir}"/>

            <delete dir="${release.contain.web.dir}"/>
         -->

<copy tofile="${release.webserver.dir}/gmbpd.tar" file="${cvs.help.enus.dir}/${onlinehelp.name}" />

<!-- end: create tar package for web server -->

<copy todir="${release.conf.ap.dir}" preservelastmodified="true" includeemptydirs="yes">
<fileset dir="${cvs.conf.dir}">
<include name="ApplicationResources.properties" />
<include name="LogMessageFile.properties" />
</fileset>
</copy>
<copy tofile="${release.conf.ap.dir}/bpdserver.properties" file="${cvs.configuration.dir}/bpdserver.release.properties" />
<copy tofile="${release.conf.ap.dir}/BPDLoggerProperties.xml" file="${cvs.configuration.dir}/BPDLoggerProperties.release.xml" />
<copy tofile="${release.conf.ap.dir}/ldap.properties" file="${cvs.configuration.dir}/ldap.release.properties" />

<copy todir="${release.lib.ap.dir}" file="${cvs.lib.dir}/ojdbc14.jar" />
<mkdir dir="${release.log.ap.dir}" />

<copy todir="${release.server.ap.dir}" file="${deploy.server.dir}/GMBPD.war" />

<tar tarfile="${release.apserver.dir}/gmbpd.tar" basedir="${release.contain.ap.dir}" />

<delete dir="${release.contain.ap.dir}" />
<!-- end: create tar package for ap server -->

<copy todir="${release.sql.db.dir}" preservelastmodified="true" includeemptydirs="yes">
<fileset dir="${cvs.db.script.dir}">
<include name="*.sql" />
<include name="*.dmp" />
</fileset>
<fileset dir="${cvs.db.procedure.dir}">
<include name="*.*" />
</fileset>
</copy>

<tar tarfile="${release.dbserver.dir}/gmbpd.tar" basedir="${release.contain.db.dir}" />

<delete dir="${release.contain.db.dir}" />
<!-- end: create tar package for db server -->

</target>

<!-- copy release source code to ${source.dir} -->
<target name="copy.release.src">
<!-- copy conf source code -->
<copy todir="${source.conf.dir}" preservelastmodified="true" includeemptydirs="yes">
<fileset dir="${cvs.conf.dir}">
<include name="ApplicationResources.properties" />
<include name="LogMessageFile.properties" />
</fileset>
</copy>
<copy tofile="${source.conf.dir}/bpdserver.properties" file="${cvs.configuration.dir}/bpdserver.release.properties" />
<copy tofile="${source.conf.dir}/BPDLoggerProperties.xml" file="${cvs.configuration.dir}/BPDLoggerProperties.release.xml" />
<copy tofile="${source.conf.dir}/ldap.properties" file="${cvs.configuration.dir}/ldap.release.properties" />
<!-- copy ojdbc14.jar to lib folder -->
<copy todir="${source.lib.dir}" file="${cvs.lib.dir}/ojdbc14.jar" />
<!-- copy help source code -->
<copy todir="${source.help.dir}" file="${cvs.help.enus.dir}/${onlinehelp.name}" />
<!-- copy db script -->
<copy todir="${source.sql.dir}" preservelastmodified="true" includeemptydirs="yes">
<fileset dir="${cvs.db.script.dir}">
<include name="*.sql" />
<include name="*.dmp" />
</fileset>
<fileset dir="${cvs.db.procedure.dir}">
<include name="*.*" />
</fileset>
</copy>
<!-- copy project source code -->
<copy todir="${source.project.dir}" preservelastmodified="true" includeemptydirs="yes">
<fileset dir="${gmbpd.rootdir}">
<include name="**" />
<exclude name="src/com/gm/bpd/common/dao/ObjectPool.java" />
<exclude name="src/com/gm/bpd/common/dao/DatabaseManager.java" />
<exclude name="WEB-INF/classes/**" />
<exclude name="WEB-INF/lib/dbunit-2.1.jar" />
<exclude name="WEB-INF/lib/junit.jar" />
<exclude name="WEB-INF/lib/ojdbc14.jar" />
<exclude name="WEB-INF/struts-*.xml" />
<exclude name="WEB-INF/tiles-*.xml" />
<exclude name="WEB-INF/validation-*.xml" />
<exclude name="WEB-INF/web.xml" />
</fileset>
</copy>
<!-- copy project source code -->
<copy todir="${source.project.dir}/WEB-INF" file="${cvs.conf.integration.dir}/web.xml" />
</target>

<!-- back up release source code -->
<target name="backup.release.src" depends="copy.release.src">
<loadproperties srcfile="build.properties" />
<!-- <tar tarfile="${buildscript.ftp.dir}/${tag.name}_src.tar" basedir="${source.rootdir}"/> -->
<exec dir="/usr/sbin" executable="tar" output="run.log">
<arg line="-cvf ${buildscript.ftp.dir}/${tag.name}_src.tar -C ${source.rootdir} ." />
</exec>
<copy todir="${backup.src.dir}" file="${buildscript.ftp.dir}/${tag.name}_src.tar" />
<antcall target="ftp.src.gmbpd-app" />
<delete file="${buildscript.ftp.dir}/${tag.name}_src.tar" />
</target>

<target name="backup.deploy">
<loadproperties srcfile="build.properties" />
<tar tarfile="${buildscript.ftp.dir}/${tag.name}_deploy.tar" basedir="${deploy.dir}" />
<copy todir="${backup.deploy.dir}" file="${buildscript.ftp.dir}/${tag.name}_deploy.tar" />
<antcall target="ftp.deploy.gmbpd-app" />
<delete file="${buildscript.ftp.dir}/${tag.name}_deploy.tar" />
</target>

<!-- back up release folder tree  -->
<target name="backup.release" depends="copy.release.3package">
<loadproperties srcfile="build.properties" />
<tar tarfile="${buildscript.ftp.dir}/${tag.name}_release.tar" basedir="${release.rootdir}" />
<copy todir="${backup.release.dir}" file="${buildscript.ftp.dir}/${tag.name}_release.tar" />
<antcall target="ftp.release.gmbpd-app" />
<delete file="${buildscript.ftp.dir}/${tag.name}_release.tar" />
</target>

<!-- ftp ${tag.name}_src.tar to gmbpd-app server -->
<target name="ftp.src.gmbpd-app">
<ftp server="${wbdeploy.gmbpd-app.ip}" passive="yes" userid="weblogic" password="bpd@hp" action="put" remotedir="${remote.src.dir}" ignoreNoncriticalErrors="yes">
<fileset dir="${buildscript.ftp.dir}">
<include name="*.tar" />
</fileset>
</ftp>
</target>

<!-- ftp ${tag.name}_release.tar to gmbpd-app server -->
<target name="ftp.release.gmbpd-app">
<ftp server="${wbdeploy.gmbpd-app.ip}" passive="yes" userid="weblogic" password="bpd@hp" action="put" remotedir="${remote.release.dir}" ignoreNoncriticalErrors="yes">
<fileset dir="${buildscript.ftp.dir}">
<include name="*.tar" />
</fileset>
</ftp>
</target>

<!-- ftp ${tag.name}_deploy.tar to gmbpd-app server -->
<target name="ftp.deploy.gmbpd-app">
<loadproperties srcfile="build.properties" />
<ftp server="${wbdeploy.gmbpd-app.ip}" passive="yes" userid="weblogic" password="bpd@hp" action="put" remotedir="${remote.war.dir}" ignoreNoncriticalErrors="yes">
<fileset dir="${buildscript.ftp.dir}">
<include name="*.tar" />
</fileset>
</ftp>
</target>

<!-- ftp GMBPD folder tree to gmbpd-app server -->
<target name="ftp.gmbpd.gmbpd-app">
<ftp server="${wbdeploy.gmbpd-app.ip}" passive="yes" userid="weblogic" password="bpd@hp" action="put" remotedir="${wbdeploy.basedir}/BPD_HOME/conf" ignoreNoncriticalErrors="yes">
<fileset dir="${deploy.conf.dir}">
<include name="*.*" />
</fileset>
</ftp>

<ftp server="${wbdeploy.gmbpd-app.ip}" passive="yes" userid="weblogic" password="bpd@hp" action="put" remotedir="${wbdeploy.basedir}/BPD_HOME/log" ignoreNoncriticalErrors="yes">
<fileset dir="${deploy.log.dir}">
<include name="*.*" />
</fileset>
</ftp>

<ftp server="${wbdeploy.gmbpd-app.ip}" passive="yes" userid="weblogic" password="bpd@hp" action="put" remotedir="${wbdeploy.basedir}/BPD_HOME/lib" ignoreNoncriticalErrors="yes">
<fileset dir="${deploy.lib.dir}">
<include name="*.*" />
</fileset>
</ftp>

<ftp server="${wbdeploy.gmbpd-app.ip}" passive="yes" userid="weblogic" password="bpd@hp" action="put" remotedir="${wbdeploy.basedir}/BPD_HOME/server" ignoreNoncriticalErrors="yes">
<fileset dir="${deploy.server.dir}">
<include name="*.war" />
</fileset>
</ftp>
</target>

<!-- ftp GMBPD folder tree to bob folder of gmbpd-app server -->
<target name="ftp.gmbpd.gmbpd-app.bob">
<ftp server="${wbdeploy.gmbpd-app.ip}" passive="yes" userid="weblogic" password="bpd@hp" action="put" remotedir="${wbdeploy.basedir}/BPD_HOME_BOB/conf" ignoreNoncriticalErrors="yes">
<fileset dir="${deploy.conf.dir}">
<include name="*.*" />
</fileset>
</ftp>

<ftp server="${wbdeploy.gmbpd-app.ip}" passive="yes" userid="weblogic" password="bpd@hp" action="put" remotedir="${wbdeploy.basedir}/BPD_HOME_BOB/log" ignoreNoncriticalErrors="yes">
<fileset dir="${deploy.log.dir}">
<include name="*.*" />
</fileset>
</ftp>

<ftp server="${wbdeploy.gmbpd-app.ip}" passive="yes" userid="weblogic" password="bpd@hp" action="put" remotedir="${wbdeploy.basedir}/BPD_HOME_BOB/lib" ignoreNoncriticalErrors="yes">
<fileset dir="${deploy.lib.dir}">
<include name="*.*" />
</fileset>
</ftp>

<ftp server="${wbdeploy.gmbpd-app.ip}" passive="yes" userid="weblogic" password="bpd@hp" action="put" remotedir="${wbdeploy.basedir}/BPD_HOME_BOB/server" ignoreNoncriticalErrors="yes">
<fileset dir="${deploy.server.dir}">
<include name="*.war" />
</fileset>
</ftp>
</target>

<!-- mail compile report to team when compile fail -->
<target name="fail.mail">
<loadproperties srcfile="build.properties" />
<mail mailhost="${lion.chn.hp.com}" from="${self.mailaddr}" subject="[R2 Daily Build]Build Failed" tolist="${self.mailaddr}" Messagemimetype="text/html" message="hi, All CUT related,&lt;br&gt;&lt;br&gt;
            Daily build &lt;font color=&#34;red&#34;&gt;fail&lt;/font&gt;ed.&lt;br&gt;&lt;br&gt;
            Plz refer to the error report in the attachment, correct these compile errors ASAP.&lt;br&gt;
            Next build will start at &lt;font color=&#34;red&#34;&gt;next o'clock&lt;/font&gt;. Plz check in your code in time.&lt;br&gt;&lt;br&gt;
            Best Regards,&lt;br&gt;&lt;br&gt;
            WanBin(Ext: 3431)" files="${cvs.report.dir}/${tag.name}.xls" />
</target>

<!-- mail compile and junit report to team when compile succeed -->
<target name="succeed.junit.pmd.mail">
<loadproperties srcfile="build.properties" />
<mail mailhost="${lion.chn.hp.com}" from="${self.mailaddr}" subject="[Daily Build]Succeed, plz update 'CVS:\GMBPD\src' with tag ${tag.name}" tolist="${cut.mailaddr}" cclist="${lead.mailaddr}" Messagemimetype="text/html" message="hi, All CUT Related,&lt;br&gt;&lt;br&gt;
            Daily build &lt;font color=&#34;red&#34;&gt;succeed&lt;/font&gt;ed.&lt;br&gt;&lt;br&gt;
            Plz update directory &#34;CVS:\GMBPD\src&#34; with tag &#34;&lt;font color=&#34;red&#34;&gt;${tag.name}&lt;/font&gt;&#34;.&lt;br&gt;
            As for how to update from CVS, plz refer to appendix1 or 2 of &#34;CVS:\GMBPD\docs\general\projectGuidelines\CUT\GDCC_GMPBD_Daily_Build_Process.doc&#34;. &lt;br&gt;&lt;br&gt;
            &lt;font color=&#34;blue&#34;&gt; Attachments:&lt;/font&gt;&lt;br&gt;
            1. ${tag.name}.xls is the compile report which has been added into &#34;CVS:\GMBPD\build\dailybuild\report&#34;.&lt;br&gt;
            2. ${tag.name}_Junit.zip is the junit report which has been added into &#34;CVS:\GMBPD\build\dailybuild\JunitReport&#34;.&lt;br&gt;
            3. ${tag.name}_pmd.xml is PMD report.&lt;br&gt;
            (PMD is a tool which scan static java source code to find bugs.)&lt;br&gt;
            Furthermore, PMD report has been added into &#34;CVS:\GMBPD\build\dailybuild\pmdReport&#34;.&lt;br&gt;
            4. pmd-report.xslt is the XSLT file for transform PMD report from XML to HTML.&lt;br&gt;
            You can save both 3 and 4 in same place, then open 2.&lt;br&gt;
            Or you can update &#34;CVS:\GMBPD\build\dailybuild\pmdReport&#34; and directly open 3 in CVS.&lt;br&gt;&lt;br&gt;
            Best Regards,&lt;br&gt;&lt;br&gt;
            WanBin(Ext: 3431)" files="${cvs.report.dir}/${tag.name}.xls, ${cvs.junitreport.dir}/${tag.name}_Junit.zip,
                ${cvs.pmdreport.dir}/${tag.name}_pmd.xml, ${cvs.pmdreport.dir}/pmd-report.xslt" />
</target>

<!-- mail compile and junit report to team when compile succeed -->
<target name="succeed.junit.mail">
<loadproperties srcfile="build.properties" />
<mail mailhost="${lion.chn.hp.com}" from="${self.mailaddr}" subject="[Daily Build]Succeed, plz update 'CVS:\GMBPD\src' with tag ${tag.name}" tolist="PDL-GDCC-GMBPD@hp.com" Messagemimetype="text/html" message="hi, All CUT Related,&lt;br&gt;&lt;br&gt;
            Daily build &lt;font color=&#34;red&#34;&gt;succeed&lt;/font&gt;ed.&lt;br&gt;&lt;br&gt;
            Plz update directory &#34;CVS:\GMBPD\src&#34; with tag &#34;&lt;font color=&#34;red&#34;&gt;${tag.name}&lt;/font&gt;&#34;.&lt;br&gt;
            As for how to update from CVS, plz refer to appendix1 or 2 of &#34;CVS:\GMBPD\docs\general\projectGuidelines\CUT\GDCC_GMPBD_Daily_Build_Process.doc&#34;. &lt;br&gt;&lt;br&gt;
            &lt;font color=&#34;blue&#34;&gt; Attachments:&lt;/font&gt;&lt;br&gt;
            1. ${tag.name}.xls is the compile report which has been added into &#34;CVS:\GMBPD\build\dailybuild\report&#34;.&lt;br&gt;
            2. ${tag.name}_Junit.zip is the junit report which has been added into &#34;CVS:\GMBPD\build\dailybuild\JunitReport&#34;.&lt;br&gt;&lt;br&gt;
            Best Regards,&lt;br&gt;&lt;br&gt;
            WanBin(Ext: 3431)" files="${cvs.report.dir}/${tag.name}.xls, ${cvs.junitreport.dir}/${tag.name}_Junit.zip" />
</target>
<target name="self.juit.mail">
<loadproperties srcfile="build.properties" />
<mail mailhost="${lion.chn.hp.com}" from="${self.mailaddr}" subject="[Release Build]Succeed, plz update 'CVS:\GMBPD\src' with tag ${tag.name}" tolist="${self.mailaddr}" Messagemimetype="text/html" message="1. ${tag.name}.xls is the compile report which has been added into &#34;CVS:\GMBPD\build\dailybuild\report&#34;.&lt;br&gt;
            2. ${tag.name}_Junit.zip is the junit report which has been added into &#34;CVS:\GMBPD\build\dailybuild\JunitReport&#34;.&lt;br&gt;&lt;br&gt;" files="${cvs.report.dir}/${tag.name}.xls, ${cvs.junitreport.dir}/${tag.name}_Junit.zip" />
</target>

<!-- mail compile report to team when compile succeed -->
<target name="succeed.mail">
<loadproperties srcfile="build.properties" />
<mail mailhost="${lion.chn.hp.com}" from="${self.mailaddr}" subject="[R2 Daily Build]Succeed, plz update 'CVS:\GMBPD\src' with tag ${tag.name}" tolist="PDL-GDCC-GMBPD@hp.com" Messagemimetype="text/html" message="hi, All CUT Related,&lt;br&gt;&lt;br&gt;
            Daily build &lt;font color=&#34;red&#34;&gt;succeed&lt;/font&gt;ed.&lt;br&gt;&lt;br&gt;
            Plz update directory &#34;CVS:\GMBPD\src&#34; with tag &#34;&lt;font color=&#34;red&#34;&gt;${tag.name}&lt;/font&gt;&#34;.&lt;br&gt;
            As for how to update from CVS, plz refer to appendix1 or 2 of &#34;CVS:\GMBPD\docs\general\projectGuidelines\CUT\GDCC_GMPBD_Daily_Build_Process.doc&#34;. &lt;br&gt;&lt;br&gt;
            &lt;font color=&#34;blue&#34;&gt; Attachments:&lt;/font&gt;&lt;br&gt;
            1. ${tag.name}.xls is the compile report which has been added into &#34;CVS:\GMBPD\build\dailybuild\report&#34;.&lt;br&gt;&lt;br&gt;
            Best Regards,&lt;br&gt;&lt;br&gt;
            WanBin(Ext: 3431)" files="${cvs.report.dir}/${tag.name}.xls" />
</target>

<!-- mail junit report to team when compile succeed -->
<target name="junit.mail">
<loadproperties srcfile="build.properties" />
<mail mailhost="${lion.chn.hp.com}" from="${self.mailaddr}" subject="[R2 Build]Junit report: ${tag.name}" tolist="PDL-GDCC-GMBPD@hp.com" Messagemimetype="text/html" message="hi, All CUT Related,&lt;br&gt;&lt;br&gt;
            Junit &lt;font color=&#34;red&#34;&gt;succeed&lt;/font&gt;ed.&lt;br&gt;&lt;br&gt;
            &lt;font color=&#34;blue&#34;&gt; Attachments:&lt;/font&gt;&lt;br&gt;
            1. ${tag.name}_Junit.zip is the junit report which has been added into &#34;CVS:\GMBPD\build\dailybuild\JunitReport&#34;.&lt;br&gt;&lt;br&gt;Best Regards,&lt;br&gt;&lt;br&gt;
            WanBin(Ext: 3431)" files="${cvs.junitreport.dir}/${tag.name}_Junit.zip" />
</target>

<!-- mail compile report to self -->
<target name="self.mail">
<loadproperties srcfile="build.properties" />
<mail mailhost="${lion.chn.hp.com}" from="${self.mailaddr}" subject="[R2 Release Build]Build finished, tag is ${tag.name}" tolist="${self.mailaddr}" cclist="${lead.maillist}" Messagemimetype="text/html" message="BPD R2 release build.&lt;br&gt;&lt;br&gt;" files="${cvs.report.dir}/${tag.name}.xls" />
</target>

<!-- mail junit report to self when junit report's create fail -->
<target name="junit.fail.mail">
<mail mailhost="${lion.chn.hp.com}" from="${self.mailaddr}" subject="[Junit Report] fail" tolist="${self.mailaddr}" Messagemimetype="text/html" message="hi, WanBin&lt;br&gt;&lt;br&gt;
            Junit report has not been created successfully.&lt;br&gt;&lt;br&gt;
            WanBin(Ext: 3431)" />
</target>

<!-- mail to the whole test team when start to deploy -->
<target name="mail.predeploy">
<loadproperties srcfile="build.properties" />
<mail mailhost="${lion.chn.hp.com}" from="${self.mailaddr}" subject="[R2 Build]I will re-deploy GMBPD" tolist="PDL-GDCC-GMBPD@hp.com" Messagemimetype="text/html" message="hi, All  Related,&lt;br&gt;&lt;br&gt;
            I am preparing to re-deploy GMBPD system on weblogic. In this period, you can NOT access GMBPD system.&lt;br&gt;
            The whole procedure will last about 10 minutes.&lt;br&gt;
            I will notify you if the deploy finish. Be patient.&lt;br&gt;&lt;br&gt;
            WanBin(Ext: 3431)" />
</target>

<!-- mail to the whole test team when deploy end -->
<!-- &lt;font color=&#34;red&#34;&gt; Do NOT try other links.&lt;/font&gt; -->
<target name="mail.deployend">
<loadproperties srcfile="build.properties" />
<mail mailhost="${lion.chn.hp.com}" from="${self.mailaddr}" subject="[R2 Build]Ver:${tag.name}" tolist="PDL-GDCC-GMBPD@hp.com" cclist="${lead.maillist}" Messagemimetype="text/html" message="hi, All,&lt;br&gt;&lt;br&gt;
            I have deployed the latest war package of &#34;${tag.name}&#34; on gmbpd-app.&lt;br&gt;
            You can access it with link &lt;A href=&#34;#&#34;&gt;http://16.157.10.1:9086/gmbpd/&lt;&#47;A&gt;.&lt;br&gt;
            If you can not access it, plz contact to me. &lt;br&gt;&lt;br&gt;
            Any problem, plz let me know ASAP.&lt;br&gt;&lt;br&gt;
            WanBin(Ext: 3431)" />
</target>

<!-- clean  buildSucceed.txt -->
<target name="clean.succeedfile">
<delete file="${buildscript.basedir}/buildSucceed.txt" />
</target>

<!-- insert a xslt comment in ${tag.name}_pmd.xml -->
<target name="insert.xslt">
<loadproperties srcfile="build.properties" />
<java classname="com.hp.xml.xslt.InsertXSLT" classpath="${install.ant.lib.dir}/insertXSLT.jar">
<arg value="${cvs.pmdreport.dir}/${tag.name}_pmd.xml" />
</java>
</target>

<!-- pmd scan static source code to find bugs -->
<taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" />
<target name="pmd">
<taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="classpath.common" />
<loadproperties srcfile="build.properties" />
<property name="pmdReport.name" value="${tag.name}_pmd.xml" />
<pmd rulesetfiles="${buildscript.pmd.dir}/PMD_RuleSet_GMBPD.xml" shortFilenames="true">
<formatter type="xml" toFile="${cvs.pmdreport.dir}/${pmdReport.name}" />
<fileset dir="${gmbpd.src.dir}/com/gm">
<include name="**/*.java" />
</fileset>
</pmd>
<antcall target="insert.xslt" />
</target>

<!-- findbugs scan source code dynamically to find bugs -->
<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" />
<target name="findbugs">
<loadproperties srcfile="build.properties" />
<property name="bugReport.name" value="${tag.name}_bug.text" />
<findbugs home="${install.findbug.dir}" output="text" outputFile="${cvs.bugreport.dir}/${bugReport.name}" quietErrors="true" includeFilter="${buildscript.findbug.dir}/filterFile.xml">
<auxClasspath path="${gmbpd.lib.dir}" />
<sourcePath path="${gmbpd.src.dir}" />
<class location="${gmbpd.classes.dir}" />
</findbugs>
</target>

<!-- copy back 3 files to connect bpd-ut database -->
<target name="ut.db.prepare">
<!-- copy back 3 files to the project directory   -->
<delete file="${gmbpd.src.dir}/com/gm/bpd/common/http/ServletBootStrap.java" />
<copy todir="${gmbpd.src.dir}/com/gm/bpd/common/http" file="${cvs.java.dir}/com/gm/bpd/common/http/ServletBootStrap.java" />
<delete file="${gmbpd.src.dir}/com/gm/bpd/common/transaction/Session.java" />
<copy todir="${gmbpd.src.dir}/com/gm/bpd/common/transaction" file="${cvs.java.dir}/com/gm/bpd/common/transaction/Session.java" />
<delete file="${gmbpd.src.dir}/com/gm/bpd/common/test/DAOTestUtil.java" />
<copy tofile="${gmbpd.src.dir}/com/gm/bpd/common/test/DAOTestUtil.java" file="${cvs.configuration.dir}/DAOTestUtil.junit.java" />

<!-- compile these 3 files  -->
<delete file="${gmbpd.classes.dir}/com/gm/bpd/common/http/ServletBootStrap.class" />
<delete file="${gmbpd.classes.dir}/com/gm/bpd/common/transaction/Session.class" />
<delete file="${gmbpd.classes.dir}/com/gm/bpd/common/test/DAOTestUtil.class" />
<javac classpathref="classpath.common" destdir="${gmbpd.classes.dir}" srcdir="${gmbpd.src.dir}" deprecation="no" debug="true" debuglevel="lines,vars,source" failonerror="false">
<include name="com/gm/bpd/common/http/ServletBootStrap.java" />
<include name="com/gm/bpd/common/transaction/Session.java" />
<include name="com/gm/bpd/common/test/DAOTestUtil.java" />
</javac>
</target>

<!-- make prepare for ut test -->
<target name="ut.prepare">
<antcall target="ut.db.prepare" />

<!-- copy the dataset xml   -->
<copy todir="${gmbpd.classes.dir}" preservelastmodified="true" includeemptydirs="yes">
<fileset dir="${gmbpd.src.dir}">
<include name="**/test/**/*.xml" />
</fileset>
</copy>

<copy todir="${gmbpd.classes.dir}" preservelastmodified="true" includeemptydirs="yes">
<fileset dir="${cvs.conf.dir}">
<include name="*.properties" />
</fileset>
</copy>

<copy tofile="${gmbpd.classes.dir}/strutstest.properties" file="${cvs.configuration.dir}/strutstest.junit.properties" />
<copy tofile="${gmbpd.classes.dir}/BPDLoggerProperties.xml" file="${cvs.configuration.dir}/BPDLoggerProperties.junit.xml" />

<!--  copy some files for unit test of common module   -->
<copy tofile="${gmbpd.rootdir}/web_test.xml" file="${cvs.configuration.dir}/web_test.junit.xml" />
<copy todir="${gmbpd.webinf.dir}" preservelastmodified="true" includeemptydirs="yes">
<fileset dir="${gmbpd.conf.dir}">
<include name="*.xml" />
<exclude name="struts-config.xml" />
</fileset>
</copy>
<copy tofile="${gmbpd.webinf.dir}/struts-config.xml" file="${cvs.configuration.dir}/struts-config.junit.xml" />
</target>

<!-- junit and junit report -->
<target name="unit.test" depends="ut.prepare">
<junit printsummary="on" showoutput="yes" fork="yes">
<classpath refid="classpath.junit" />
<formatter type="brief" usefile="false" />
<formatter type="xml" />
<batchtest todir="${buildscript.junit.xml.dir}">
<fileset dir="${gmbpd.classes.dir}">
<include name="**/test/*Test*.class" />
<exclude name="**/test/*$*.class" />
<exclude name="com/gm/bpd/common/test/BPDTestCase.class" />
<exclude name="com/gm/bpd/common/test/DAOTestUtil.class" />
</fileset>
</batchtest>
</junit>
<antcall target="junit.report" />
</target>

<!-- generate junit report -->
<target name="junit.report">
<junitreport todir="${buildscript.junit.report.dir}">
<fileset dir="${buildscript.junit.xml.dir}">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${buildscript.junit.report.dir}" />
</junitreport>
</target>

<!-- compress junit report to a zip file -->
<target name="zip.ut.report">
<loadproperties srcfile="build.properties" />
<zip zipfile="${cvs.junitreport.dir}/${tag.name}_Junit.zip" basedir="${buildscript.junit.report.dir}" />
</target>

<!-- undeploy war on port 6001 of gmpbd-app -->
<target name="undeploy.6001">
<antcall target="undeploy.app">
<param name="app.name" value="${wbdeploy.war.name}" />
<param name="app.src" location="${wbdeploy.server.dir}/${wbdeploy.war.name}.war" />
<param name="app.target" value="${wbdeploy.cluster.name.6001}" />
<param name="admin.url" value="http://${wbdeploy.admin.addr}:${wbdeploy.admin.port.6001}" />
</antcall>
</target>

<!-- deploy war on port 6001 of gmpbd-app -->
<target name="deploy.6001">
<antcall target="deploy.app">
<param name="app.name" value="${wbdeploy.war.name}" />
<param name="app.src" location="${wbdeploy.server.dir}/${wbdeploy.war.name}.war" />
<param name="app.target" value="${wbdeploy.cluster.name.6001}" />
<param name="admin.url" value="http://${wbdeploy.admin.addr}:${wbdeploy.admin.port.6001}" />
</antcall>
</target>

<!-- undeploy war on port 7001 of gmpbd-app -->
<target name="undeploy.7001">
<antcall target="undeploy.app">
<param name="app.name" value="${wbdeploy.war.name}" />
<param name="app.src" location="${wbdeploy.server.bob.dir}/${wbdeploy.war.name}.war" />
<param name="app.target" value="${wbdeploy.cluster.name.7021}" />
<param name="admin.url" value="http://${wbdeploy.admin.addr}:${wbdeploy.admin.port.7001}" />
</antcall>
</target>

<!-- deploy war on port 7001 of gmpbd-app -->
<target name="deploy.7001">
<antcall target="deploy.app">
<param name="app.name" value="${wbdeploy.war.name}" />
<param name="app.src" location="${wbdeploy.server.bob.dir}/${wbdeploy.war.name}.war" />
<param name="app.target" value="${wbdeploy.cluster.name.7021}" />
<param name="admin.url" value="http://${wbdeploy.admin.addr}:${wbdeploy.admin.port.7001}" />
</antcall>
</target>

<!-- undeploy war on port 8001 of gmpbd-app -->
<target name="undeploy.8001">
<antcall target="undeploy.app">
<param name="app.name" value="${wbdeploy.war.name}" />
<param name="app.src" location="${wbdeploy.server.dir}/${wbdeploy.war.name}.war" />
<param name="app.target" value="${wbdeploy.cluster.name.8001}" />
<param name="admin.url" value="http://${wbdeploy.admin.addr}:${wbdeploy.admin.port.8001}" />
</antcall>
</target>

<!-- deploy war on port 8001 of gmpbd-app -->
<target name="deploy.8001">
<antcall target="deploy.app">
<param name="app.name" value="${wbdeploy.war.name}" />
<param name="app.src" location="${wbdeploy.server.dir}/${wbdeploy.war.name}.war" />
<param name="app.target" value="${wbdeploy.cluster.name.8001}" />
<param name="admin.url" value="http://${wbdeploy.admin.addr}:${wbdeploy.admin.port.8001}" />
</antcall>
</target>

<!-- undeploy war on port 9001 of gmpbd-app -->
<target name="undeploy.9001">
<antcall target="undeploy.app">
<param name="app.name" value="${wbdeploy.war.name}" />
<param name="app.src" location="${wbdeploy.server.bob.dir}/${wbdeploy.war.name}.war" />
<param name="app.target" value="${wbdeploy.cluster.name.9001}" />
<param name="admin.url" value="http://${wbdeploy.admin.addr}:${wbdeploy.admin.port.9001}" />
</antcall>
</target>



<!-- deploy war on port 9001 of gmpbd-app -->
<target name="deploy.9001">
<antcall target="deploy.app">
<param name="app.name" value="${wbdeploy.war.name}" />
<param name="app.src" location="${wbdeploy.server.bob.dir}/${wbdeploy.war.name}.war" />
<param name="app.target" value="${wbdeploy.cluster.name.9001}" />
<param name="admin.url" value="http://${wbdeploy.admin.addr}:${wbdeploy.admin.port.9001}" />
</antcall>
</target>

<!-- undeploy war on port 9999 of gmpbd-app -->
<target name="undeploy.9999">
<antcall target="undeploy.app">
<param name="app.name" value="${wbdeploy.war.name}" />
<param name="app.src" location="${wbdeploy.server.bob.dir}/${wbdeploy.war.name}.war" />
<param name="app.target" value="${wbdeploy.cluster.name.9999}" />
<param name="admin.url" value="http://${wbdeploy.admin.addr}:${wbdeploy.admin.port.9999}" />
</antcall>
</target>

<!-- deploy war on port 9999 of gmpbd-app -->
<target name="deploy.9999">
<antcall target="deploy.app">
<param name="app.name" value="${wbdeploy.war.name}" />
<param name="app.src" location="${wbdeploy.server.bob.dir}/${wbdeploy.war.name}.war" />
<param name="app.target" value="${wbdeploy.cluster.name.9999}" />
<param name="admin.url" value="http://${wbdeploy.admin.addr}:${wbdeploy.admin.port.9999}" />
</antcall>
</target>

<!-- undeploy war -->
<target name="undeploy.app">
<java classname="weblogic.Deployer" fork="false" failonerror="false" classpath="${install.weblogic.lib.dir}/weblogic.jar">
<arg value="-adminurl" />
<arg value="${admin.url}" />
<arg value="-username" />
<arg value="${wbdeploy.admin.username}" />
<arg value="-password" />
<arg value="${wbdeploy.admin.password}" />
<arg value="-name" />
<arg value="${app.name}" />
<arg value="-source" />
<arg value="${app.src}" />
<arg value="-targets" />
<arg value="${app.target}" />
<arg value="-undeploy" />
</java>
</target>

<!-- deploy war -->
<target name="deploy.app">
<echo message="${admin.url}" />
<java classname="weblogic.Deployer" fork="false" failonerror="false" classpath="${install.weblogic.lib.dir}/weblogic.jar">
<arg value="-adminurl" />
<arg value="${admin.url}" />
<arg value="-username" />
<arg value="${wbdeploy.admin.username}" />
<arg value="-password" />
<arg value="${wbdeploy.admin.password}" />
<arg value="-name" />
<arg value="${app.name}" />
<arg value="-source" />
<arg value="${app.src}" />
<arg value="-targets" />
<arg value="${app.target}" />
<arg value="-deploy" />
</java>
</target>

<!-- pre compile jsp  -->
<taskdef name="wlappc" classname="weblogic.ant.taskdefs.j2ee.Appc" classpath="${install.weblogic.lib.dir}/weblogic.jar" />
<target name="jsp.precompile">
<wlappc source="${gmbpd.rootdir}" keepgenerated="true" verbose="true" idl="true" idlOverWrite="true" classpathref="classpath2.jsp.precompile">
</wlappc>
<antcall target="insert.servlet.info" />
</target>

<!-- transform jsp to java files  -->
<target name="jspc">
<echo>begin pre-compile all jsp pages...</echo>
<delete dir="${gmbpd.jspsrc.dir}" />
<delete dir="${gmbpd.jspservlet.dir}" />
<mkdir dir="${gmbpd.jspsrc.dir}" />
<mkdir dir="${gmbpd.jspservlet.dir}" />
<jspc classpathref="classpath.jsp.precompile" srcdir="${gmbpd.jsp.dir}" destdir="${gmbpd.jspsrc.dir}" package="com.gm.bpd" compiler="jasper" webxml="${gmbpd.webinf.dir}/web_jsp.xml">
<include name="*.jsp" />
<include name="common/**" />
<include name="header/**" />
<include name="home/**" />
<include name="tree/**" />
<include name="attribute/**" />
<include name="scorecard/**" />
<include name="metric/**" />
<include name="admin/**" />
<include name="target/**" />
<include name="dc/**" />
</jspc>
<echo>The web jsp was generated. </echo>
</target>

<!-- compile java files tranformed from jsp files  -->
<target name="compile.jsp">
<javac srcdir="${gmbpd.jspsrc.dir}" destdir="${gmbpd.jspservlet.dir}" debug="on" fork="yes" memoryMaximumSize="120000k">
<classpath>
<pathelement location="${gmbpd.classes.dir}" />
<fileset dir="${gmbpd.lib.dir}">
<include name="*.jar" />
</fileset>
<pathelement location="${install.j2sdk.lib.dir}/tools.jar" />
<pathelement location="${install.ant.lib.dir}/ant.jar" />
<pathelement location="${install.ant.lib.dir}/jasper-runtime.jar" />
<pathelement location="${install.ant.lib.dir}/jasper-compiler.jar" />
<pathelement location="${install.ant.lib.dir}/xercesImpl.jar" />
<pathelement location="${install.ant.lib.dir}/xml-apis.jar" />
<pathelement location="${cvs.lib.dir}/servlet_2_3.jar" />
</classpath>
<include name="**" />
</javac>
</target>

<!-- test cover rate with clover -->
<taskdef resource="clovertasks" />
<target name="with.clover">
<clover-setup initString="mycoverage.db" />
</target>

<target name="clover.xml" depends="with.clover">
<clover-report>
<current outfile="coverage.xml">
<format type="xml" />
</current>
</clover-report>
</target>

</project>
分享到:
评论
1 楼 minma_yuyang 2009-01-04  
能不能简单点,我才入门,

相关推荐

Global site tag (gtag.js) - Google Analytics