<project name="JEDI" basedir="." default="buildAll">
<property name="srcdir" value="src" />
<property name="builddir" value="target" />
<property name="distdir" value="dist" />
<property name="axi2stagedir" value="axis2" />
<property name="xsdschemasdir" value="xsdschemas" />
<property name="javadocdir" value="javadoc" />
<property name="tpcl" location="../../TPCL" />
<property name="AXIS2_HOME" value="${tpcl}/axis2-1.3"/>
<property name="configdir" value="../Config"/>
<property name="utestdir" value="utest"/>
<property name="testdir" value="test"/>
<property name="instrumenteddir" value="${testdir}/instrumented"/>
<property name="reportsdir" value="${testdir}/reports"/>
<property name="testclassname" value="*" />
<path id="axis2.classpath">
<fileset dir="${AXIS2_HOME}/lib">
<include name="*.jar"/>
</fileset>
</path>
<path id="src.classpath">
<fileset dir="${tpcl}">
<include name="commons-collections.jar" />
<include name="commons-dbcp-1.1.jar" />
<include name="commons-pool-1.1.jar" />
<include name="jakarta-oro.jar" />
<include name="log4j-1.2.8.jar" />
<include name="jms.jar" />
<include name="tibrvj.jar" />
<include name="tibjms.jar" />
<include name="xalan.jar" />
<include name="xercesImpl.jar" />
<include name="xml-apis.jar" />
<include name="mail.jar" />
<include name="activation.jar" />
<include name="weblogic.jar" />
<include name="joda-time-1.5.2.jar" />
<include name="wls-api.jar" />
<include name="saxon9.jar" />
<include name="saxon9-dom.jar" />
<include name="saxon9-xpath.jar" />
<include name="mvel2-2.0.19.jar"/>
</fileset>
<fileset dir="${tpcl}">
<include name="castor-0.9.7-xml.jar"/>
</fileset>
</path>
<path id="test.classpath">
<fileset dir="${tpcl}/utest">
<include name="junit-4.6.jar" />
<include name="privateaccessor.jar" />
<include name="mock.jar" />
<include name="jmsSender.jar"/>
<include name="ojdbc14.jar"/>
</fileset>
</path>
<path id="cobertura.classpath">
<fileset dir="${tpcl}/utest/cobertura">
<include name="*.jar" />
</fileset>
<path refid="test.classpath"/>
<path refid="axis2.classpath"/>
</path>
<taskdef classpathref="cobertura.classpath" resource="tasks.properties"/>
<target name="cleanup">
<delete dir="${builddir}" />
<delete dir="${distdir}" />
<delete file="${axi2stagedir}/repository/services/ExceptionMessageService.aar"/>
<!-- clean up the test,report and instrumention dir -->
<delete dir="${testdir}" />
<!-- clean up the classes coverage log info-->
<delete file="cobertura.ser"/>
</target>
<target name="init" depends="cleanup">
<mkdir dir="${builddir}" />
<mkdir dir="${distdir}" />
</target>
<target name="inittest" depends="cleanup">
<mkdir dir="${testdir}" />
<mkdir dir="${instrumenteddir}" />
<mkdir dir="${reportsdir}/junitxml" />
<mkdir dir="${reportsdir}/junithtml" />
</target>
<target name="compile" depends="init">
<javac srcdir="${srcdir}" destdir="${builddir}" encoding="ISO-8859-1" debug="yes">
<classpath refid="src.classpath"/>
<classpath refid="axis2.classpath"/>
</javac>
<copy todir="${builddir}">
<fileset dir="${srcdir}">
<include name="**/*.xslt" />
<include name="**/*.xml" />
<include name="**/*.gif" />
<include name="**/*.jpg" />
<include name="**/*.aar" />
<include name="**/*.list" />
<include name="castor.properties" />
</fileset>
<fileset dir="${configdir}">
<include name="GEHLicense.dat" />
<include name="GALLicense.dat" />
</fileset>
</copy>
</target>
<target name="compiletestcode" depends="inittest,compile">
<javac srcdir="${utestdir}/java;" destdir="${testdir}" debug="yes" >
<classpath refid="src.classpath" />
<classpath refid="test.classpath" />
<classpath refid="axis2.classpath"/>
<classpath>
<pathelement location="${builddir}"/>
</classpath>
</javac>
<copy todir="resources">
<fileset dir="${utestdir}/resources">
<include name="**/*.xml" />
<include name="**/*.properties" />
<include name="**/*.sql" />
<include name="**/*.gif" />
</fileset>
</copy>
<copy todir="${builddir}">
<fileset dir="${UTGlobalEnvDir}">
<include name="GlobalEnvProperties.properties" />
</fileset>
<fileset dir="${utestdir}/resources">
<include name="GenericAuditLoggerEngineConfiguration.xml" />
<include name="InvalidGenericAuditLoggerEngineConfiguration_NoGlobalVariables.xml" />
<include name="InvalidGenericAuditLoggerEngineConfiguration_NoRVJMS.xml" />
<include name="GenericExceptionHandlerEngineConfiguration.xml" />
<include name="InvalidGenericExceptionHandlerEngineConfiguration_NoGlobalVariables.xml" />
<include name="InvalidGenericExceptionHandlerEngineConfiguration_NoRVJMS.xml" />
</fileset>
<fileset dir="${utestdir}/resources/InvalidLicense"/>
<fileset dir="${utestdir}/java">
<include name="**/*.xml" />
</fileset>
</copy>
</target>
<target name="buildJEDI" depends="compile">
<tstamp/>
<jar basedir="${builddir}" destfile="${distdir}/jedi.jar">
<include name="com/prft/jedi/**/*.class" />
<include name="com/prft/jedi/**/*.gif" />
<include name="com/prft/jedi/**/*.jpg" />
</jar>
</target>
<target name="buildTM" depends="compile">
<tstamp/>
<jar basedir="${builddir}" destfile="${distdir}/tm.jar">
<include name="com/prft/tm/**/*.class" />
<include name="com/prft/tm/**/*.xml" />
<include name="castor.properties" />
</jar>
</target>
<target name="buildGAL" depends="compile">
<tstamp/>
<jar basedir="${builddir}" destfile="${distdir}/gal.jar">
<include name="com/prft/gal/**/*.class" />
<include name="com/prft/gal/**/*.xml" />
<include name="com/prft/geh/common/**/*.class" />
<include name="com/prft/gal/xslt/*.xslt" />
<include name="castor.properties" />
</jar>
</target>
<target name="buildGEH" depends="compile">
<tstamp />
<jar basedir="${builddir}" destfile="${builddir}/com/prft/geh/soap/repository/services/ExceptionMessageService.aar">
<include name="com/prft/geh/jedi/engine/handler/impl/soap/ExceptionMessageService.class"/>
<metainf dir="${xsdschemasdir}/geh/soap">
<include name="**/*.xml"/>
<include name="**/*.wsdl"/>
</metainf>
</jar>
<jar basedir="${builddir}" destfile="${distdir}/geh.jar">
<include name="com/prft/geh/**/*.class" />
<include name="com/prft/geh/**/*.xml" />
<include name="com/prft/geh/**/*.aar" />
<include name="com/prft/geh/**/*.list" />
<include name="com/prft/gal/common/**/*.class" />
<exclude name="com/prft/geh/jedi/engine/handler/impl/soap/ExceptionMessageService.class"/>
<include name="castor.properties" />
</jar>
</target>
<target name="buildDocs">
<delete dir="${javadocdir}" />
<javadoc packagenames="com.prft.*" sourcepath="${srcdir}" destdir="${javadocdir}" package="true">
<classpath>
<pathelement location="${tpcl}/castor-0.9.7-xml.jar" />
<pathelement location="${tpcl}/commons-collections.jar" />
<pathelement location="${tpcl}/commons-dbcp-1.1.jar" />
<pathelement location="${tpcl}/commons-pool-1.1.jar" />
<pathelement location="${tpcl}/jakarta-oro.jar" />
<pathelement location="${tpcl}/log4j-1.2.8.jar" />
<pathelement location="${tpcl}/jms.jar" />
<pathelement location="${tpcl}/tibrvj.jar" />
<pathelement location="${tpcl}/xalan.jar" />
<pathelement location="${tpcl}/xercesImpl.jar" />
<pathelement location="${tpcl}/xml-apis.jar" />
<pathelement location="${tpcl}/mail.jar" />
<pathelement location="${tpcl}/activation.jar" />
<pathelement location="${tpcl}/weblogic.jar" />
<pathelement location="${tpcl}/joda-time-1.5.2.jar" />
</classpath>
<classpath refid="axis2.classpath"/>
</javadoc>
</target>
<!-- this part is for unit test and coverage -->
<target name="instrument" >
<cobertura-instrument todir="${instrumenteddir}">
<!--
The following line causes instrument to ignore any
source line containing a reference to log4j, for the
purposes of coverage reporting.
-->
<ignore regex="org.apache.log4j.*" />
<fileset dir="${builddir}">
</fileset>
</cobertura-instrument>
</target>
<target name="instrumentGEH" >
<cobertura-instrument todir="${instrumenteddir}">
<!--
The following line causes instrument to ignore any
source line containing a reference to log4j, for the
purposes of coverage reporting.
-->
<ignore regex="org.apache.log4j.*" />
<!--
This one using to know which will be show at coverage table
-->
<fileset dir="${builddir}">
<include name="com/prft/geh/**/*.class" />
<include name="com/prft/jedi/**/*.class"/>
<include name="com/zw/geh/util/bw/listener/**/*.class"/>
<exclude name="com/prft/geh/**/xmlimpl/**/*.class" />
<exclude name="com/prft/**/rv/**/*.class" />
<exclude name="com/prft/geh/**/mssql/*.class" />
<exclude name="com/prft/geh/**/db2/*.class" />
<exclude name="com/prft/geh/**/oracle/*.class" />
<exclude name="com/prft/geh/**/dto/*.class" />
<exclude name="com/prft/geh/**/configurator/**/*.class" />
<exclude name="com/prft/jedi/configurator/ui/*.class"/>
<exclude name="com/zw/geh/util/bw/listener/xmlimpl/**/*.class"/>
<exclude name="com/prft/jedi/**/xmlimpl/**/*.class"/>
<exclude name="com/prft/geh/jedi/engine/process/common/Rv*.class"/>
<exclude name="com/prft/jedi/exceptions/common/XPathProcessorException.class"/>
<exclude name="com/prft/jedi/exceptions/soap/manager/SoapManagerException.class"/>
<exclude name="com/prft/jedi/exceptions/mail/manager/MailReceiverException.class"/>
<exclude name="com/prft/jedi/jms/manager/JmsManagerConstants.class"/>
<exclude name="com/prft/jedi/exceptions/jms/managerr/JmsQueueConnectionException.class" />
</fileset>
</cobertura-instrument>
</target>
<target name="instrumentGAL" >
<cobertura-instrument todir="${instrumenteddir}">
<!--
The following line causes instrument to ignore any
source line containing a reference to log4j, for the
purposes of coverage reporting.
-->
<ignore regex="org.apache.log4j.*" />
<fileset dir="${builddir}">
<include name="com/prft/gal/**/*.class" />
<include name="com/prft/tm/**/*.class" />
<exclude name="com/prft/gal/**/xmlimpl/*.class" />
<exclude name="com/prft/gal/**/rv/*.class" />
<exclude name="com/prft/gal/**/mssql/*.class" />
<exclude name="com/prft/gal/**/db2/*.class" />
<exclude name="com/prft/gal/**/oracle/*.class" />
<exclude name="com/prft/gal/**/dto/*.class" />
<exclude name="com/prft/gal/**/configurator/*.class" />
<exclude name="com/prft/tm/common/castor/xmlbeans/trxdef/*.class" />
<exclude name="com/prft/tm/**/mssql/*.class" />
<exclude name="com/prft/tm/**/db2/*.class" />
<exclude name="com/prft/tm/**/oracle/*.class" />
<exclude name="com/prft/tm/**/dto/*.class" />
</fileset>
</cobertura-instrument>
</target>
<target name="testGEH" >
<junit dir="./" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
<!--
Note the classpath order: instrumented classes are before the
original (uninstrumented) classes. This is important.
-->
<classpath location="${instrumenteddir}" />
<classpath refid="src.classpath" />
<classpath refid="test.classpath" />
<classpath refid="axis2.classpath"/>
<syspropertyset>
<propertyref prefix="test-sys-prop."/>
<mapper from="test-sys-prop.*" to="*" type="glob"/>
</syspropertyset>
<classpath location="${builddir}" />
<classpath location="${testdir}" />
<!--
The instrumented classes reference classes used by the
Cobertura runtime, so Cobertura and its dependencies
must be on your classpath.
-->
<classpath refid="cobertura.classpath" />
<formatter type="brief" usefile="false"/>
<formatter type="xml" />
<test name="${testcase}" todir="${reportsdir}/junitxml" if="testcase" />
<batchtest todir="${reportsdir}/junitxml" unless="testcase">
<fileset dir="${utestdir}/java">
<include name="com/prft/geh/**/*Test.java" />
<include name="com/prft/jedi/**/*Test.java"/>
<include name="com/zw/geh/util/bw/listener/**/*Test.java" />
</fileset>
</batchtest>
</junit>
<junitreport todir="${reportsdir}/junitxml">
<fileset dir="${reportsdir}/junitxml">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${reportsdir}/junithtml" />
</junitreport>
</target>
<target name="testGAL" >
<junit dir="./" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
<!--
Note the classpath order: instrumented classes are before the
original (uninstrumented) classes. This is important.
-->
<classpath location="${instrumenteddir}" />
<classpath refid="src.classpath" />
<classpath refid="test.classpath" />
<classpath refid="axis2.classpath"/>
<syspropertyset>
<propertyref prefix="test-sys-prop."/>
<mapper from="test-sys-prop.*" to="*" type="glob"/>
</syspropertyset>
<classpath location="${builddir}" />
<classpath location="${testdir}" />
<!--
The instrumented classes reference classes used by the
Cobertura runtime, so Cobertura and its dependencies
must be on your classpath.
-->
<classpath refid="cobertura.classpath" />
<formatter type="brief" usefile="false"/>
<formatter type="xml" />
<test name="${testcase}" todir="${reportsdir}/junitxml" if="testcase" />
<batchtest todir="${reportsdir}/junitxml" unless="testcase">
<fileset dir="${utestdir}/java">
<include name="com/prft/gal/**/*Test.java" />
<!-- also include TM cases in GAL-->
<include name="com/prft/tm/**/*Test.java" />
</fileset>
</batchtest>
</junit>
<junitreport todir="${reportsdir}/junitxml">
<fileset dir="${reportsdir}/junitxml">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${reportsdir}/junithtml" />
</junitreport>
</target>
<target name="test" >
<junit dir="./" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
<!--
Note the classpath order: instrumented classes are before the
original (uninstrumented) classes. This is important.
-->
<classpath location="${instrumenteddir}" />
<classpath refid="src.classpath" />
<classpath refid="test.classpath" />
<classpath refid="axis2.classpath"/>
<syspropertyset>
<propertyref prefix="test-sys-prop."/>
<mapper from="test-sys-prop.*" to="*" type="glob"/>
</syspropertyset>
<classpath location="${builddir}" />
<classpath location="${testdir}" />
<!--
The instrumented classes reference classes used by the
Cobertura runtime, so Cobertura and its dependencies
must be on your classpath.
-->
<classpath refid="cobertura.classpath" />
<formatter type="brief" usefile="false"/>
<formatter type="xml" />
<test name="${testcase}" todir="${reportsdir}/junitxml" if="testcase" />
<batchtest todir="${reportsdir}/junitxml" unless="testcase">
<fileset dir="${utestdir}/java">
<include name="**/${testclassname}Test.java" />
</fileset>
</batchtest>
</junit>
<junitreport todir="${reportsdir}/junitxml">
<fileset dir="${reportsdir}/junitxml">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${reportsdir}/junithtml" />
</junitreport>
</target>
<target name="coverage-check">
<cobertura-check branchrate="34" totallinerate="100" />
</target>
<target name="coverage-report">
<!--
Generate an XML file containing the coverage data using
the "srcdir" attribute.
-->
<cobertura-report srcdir="${srcdir}" destdir="${reportsdir}/coveragexml" format="xml" />
</target>
<target name="coverage-gal-report">
<!--
Generate an XML file containing the coverage data using
the "srcdir" attribute.
-->
<cobertura-report destdir="${reportsdir}/gal/coveragexml" format="xml">
<fileset dir="${srcdir}">
<include name="com/prft/gal/**/*.java" />
<include name="com/prft/tm/**/*.java" />
</fileset>
</cobertura-report>
</target>
<target name="coverage-geh-report">
<!--
Generate an XML file containing the coverage data using
the "srcdir" attribute.
-->
<cobertura-report destdir="${reportsdir}/geh/coveragexml" format="xml">
<fileset dir="${srcdir}">
<include name="com/prft/geh/**/*.java" />
<include name="com/prft/jedi/**/*.java"/>
<include name="com/zw/geh/util/bw/listener/**/*.java"/>
</fileset>
</cobertura-report>
</target>
<target name="alternate-coverage-report">
<!--
Generate a series of HTML files containing the coverage
data in a user-readable form using nested source filesets.
-->
<cobertura-report destdir="${reportsdir}/coveragehtml">
<fileset dir="${srcdir}">
<include name="**/*.java" />
</fileset>
</cobertura-report>
</target>
<target name="alternate-gal-coverage-report">
<!--
Generate a series of HTML files containing the coverage
data in a user-readable form using nested source filesets.
-->
<cobertura-report destdir="${reportsdir}/gal/coveragehtml">
<fileset dir="${srcdir}">
<include name="com/prft/gal/**/*.java" />
<include name="com/prft/tm/**/*.java" />
</fileset>
</cobertura-report>
</target>
<target name="alternate-geh-coverage-report">
<!--
Generate a series of HTML files containing the coverage
data in a user-readable form using nested source filesets.
-->
<cobertura-report destdir="${reportsdir}/geh/coveragehtml">
<fileset dir="${srcdir}">
<include name="com/prft/geh/**/*.java" />
<include name="com/prft/jedi/**/*.java"/>
<include name="com/zw/geh/util/bw/listener/**/*.java"/>
</fileset>
</cobertura-report>
</target>
<target name="buildAll" depends="buildJEDI,buildGAL,buildTM,buildGEH"/>
<target name="cleanupJMS">
<echo message="cleanJMS"/>
<ant antfile="cleanupJMS/build-cleanupJMS.xml" target="cleanupJMS"/>
<echo message="clean up jms successful"/>
</target>
<target name="cleanupJMSForLocalMachine">
<echo message="cleanJMS"/>
<exec executable="/apps/tibco/ems/5.0/bin/cleanupJMSForUTLocal.sh" />
<echo message="clean up jms successful"/>
</target>
<target name="clean">
<antcall target="cleanupJMSForLocalMachine"/>
</target>
<target name="defineUSProp">
<property name="UTGlobalEnvDir" value="${utestdir}/resources/GlobalEnvironment/US"/>
</target>
<target name="coverageGEHUS" depends="cleanupJMSForLocalMachine, defineUSProp, compiletestcode, instrumentGEH, testGEH, coverage-geh-report, alternate-geh-coverage-report" description="Compile, instrument ourself, run the tests and generate JUnit and coverage reports.">
<antcall target="cleanupJMSForLocalMachine" />
</target>
<target name="allGEHUS" depends="coverageGEHUS, buildGEH, buildJEDI" />
<target name="coverageGALUS" depends="cleanupJMSForLocalMachine, defineUSProp, compiletestcode, instrumentGAL, testGAL, coverage-gal-report, alternate-gal-coverage-report" description="Compile, instrument ourself, run the tests and generate JUnit and coverage reports.">
<antcall target="cleanupJMSForLocalMachine" />
</target>
<target name="allGALUS" depends="coverageGALUS, buildGAL, buildTM, buildJEDI" />
</project>
<role rolename="tomcat"/>
<role rolename="manager"/>
<role rolename="admin"/>
<user username="hudson" password="hudson" roles="tomcat,manager,admin"/>
分享到:
相关推荐
《Ant build.xml详解——构建Java项目的关键》 Apache Ant,作为一个开源的自动化构建工具,是Java开发者不可或缺的利器。它的核心在于一个名为`build.xml`的配置文件,它定义了项目的构建过程,包括编译、测试、...
Apache Ant 是一个广泛使用的Java构建工具,它以XML格式定义构建脚本,即`build.xml`文件。这个文件包含了构建项目的整个流程,从编译源代码到生成最终的可执行或部署包。下面我们将深入探讨`build.xml`的使用以及...
Ant build.xml 文件详解 Ant 是一个项目管理工具,相比make命令,gnumake和nmake等编译工具,Ant克服了这些工具的缺陷。Ant 的优点包括跨平台性、操作简单、易于集成到开发环境中。Ant 的构建文件是 XML 格式的文件...
Ant是Apache组织提供的一款Java语言的构建工具,它的配置文件通常以`build.xml`为名,它是Ant工作的蓝图。这篇博客文章“ant build.xml例子”可能详细介绍了如何使用Ant来管理Java项目的构建过程。 `build.xml`文件...
《Ant build.xml构建详解》 在软件开发过程中,构建工具起着至关重要的作用,它能够自动化执行编译、测试、打包等任务。Apache Ant是Java领域广泛应用的一个构建工具,其核心在于一个名为`build.xml`的配置文件。...
经过几天学习,总结出ant build.xml的基本版,实现了: <!--初始化操作--> <!--拷贝操作--> <!--编译--> <!--war打包--> 执行顺序为: <!--project的default属性为build,所以本target...
《Ant的build.xml模板详解与应用》 在软件开发领域,构建工具是不可或缺的一部分,它帮助开发者自动化地完成编译、测试、打包等任务。Apache Ant作为Java领域的一款经典构建工具,以其灵活性和强大的功能深受广大...
Ant是基于XML的,它的核心在于`build.xml`文件,这个文件是项目的构建脚本,详细定义了构建过程中的各种任务和依赖关系。 标题“一个常用的ant的build.xml”暗示了我们讨论的是一个标准且常见的Ant构建配置文件。...
我的开发环境是Eclipse,ant.xml是放在项目下的ant(新建),也可以修改project的basedir.
"ant build.xml范例"指的是使用Ant工具时创建的构建配置文件build.xml,它是Ant工作的蓝图,定义了项目的构建过程。 1. **Ant的基本概念** - Ant是一个Java库和命令行工具,其任务是驱动构建过程。 - build.xml...
ANT Build.xml 自动编译
jmeter+ant 持续集成build.xml文件,直接使用ant命令执行jmeter脚本文件,得到图形测试报告
ANT Build.xml 自动编译
ant build.xml demo 供自己及好友学习,能很快上手
3. **build.xml文件详解**:`build.xml`是Ant的构建文件,其中包含了一系列的任务和目标。例如,你可以定义一个目标来启动JMeter,另一个目标来生成测试报告,甚至还有一个目标用来发送测试结果的邮件通知。在描述中...
"生成ANT所需要的Build.xml文件"这一主题,核心在于如何通过Python程序自动生成ANT的配置文件——build.xml。 首先,我们要理解ANT的build.xml文件。它是ANT的核心,包含了一系列的构建目标和任务。这些目标定义了...
Ant build.xml 详解 Ant 是一个基于 Java 语言的编译工具,它的主要功能是自动化项目的编译和构建过程。Ant 的出现是为了克服 make 和其他编译工具的缺陷,它具有跨平台性、操作简单、易于维护和书写、结构清晰等...
Ant_build.xml配置实例,Ant的详细配置,很实用