Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: acaff92173
Fetching contributors…

Cannot retrieve contributors at this time

executable file 1073 lines (906 sloc) 42.112 kb
<?xml version="1.0"?>
<!--
This original file comes from http://buildtemplate.sourceforge.net
All the ant jars, emma, ant-contrib also come from the version
that buildtemplate currently has. buildtemplate is a quick start
for creating a java project.
Run "ant -projecthelp" to view all the possible targets and descriptions
-->
<project name="std_buildfile" default="testCheckin" basedir=".." xmlns:ivy="antlib:org.apache.ivy.ant">
<property name="version.filename" value="version.properties"/>
<property name="version.file.path" value="input/version/${version.filename}" />
<property environment="env"/>
<!-- Now allow any of the properties to be overridden -->
<property file="${user.home}/ant.properties" />
<property file="bldfiles/ant.properties" />
<property file="bldfiles/directory.properties" />
<property file="${version.file.path}"/>
<available property="makeExists" file="${native}/Makefile" />
<!--convert the lib file separators to this file system for later use in pathconvert
to put together the manifest file -->
<property name="full.lib.path" location="${jardist}" />
<property name="full.config.path" location="${projectPath}" />
<property name="jar.name" value="${name}.jar" />
<property name="war.file" value="${wardist}/${name}.war"/>
<property name="ivy.install.version" value="2.3.0-rc1"/>
<property name="ivy.jar.dir" value="${tool.dir}/ivy"/>
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy-${ivy.install.version}.jar"/>
<target name="install-ivy" description="--&gt; install ivy">
<path id="ivy.lib.path">
<fileset dir="${ivy.jar.dir}" includes="*.jar"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
</target>
<target name="resolve" depends="install-ivy">
<ivy:configure file="bldfiles/ivysettings.xml" />
<ivy:resolve file="bldfiles/ivy.xml"/>
</target>
<target name="retrieve" depends="resolve, create-src">
<ivy:retrieve pattern="${libinclude}/[conf]/[artifact]-[type]-[revision].[ext]" />
<ivy:deliver deliverpattern="${generated}/ivy/ivy-[module]-[revision].xml" />
</target>
<target name="publish" depends="all">
<ivy:publish resolver="local" forcedeliver="true">
<artifacts pattern="${input}/libinclude/[artifact].[ext]" />
</ivy:publish>
</target>
<description>
This is a generic build file template. All the customizable properties are
in ant.properties file. All the directories used by this template are in
directory.properties file.
</description>
<!--
***********************************************************************
TASK DEFINITIONS
***********************************************************************
-->
<property name="junit.location" location="${tool.dir}/ant-junit" />
<path id="junit.lib">
<pathelement path="${junit.location}/ant-junit.jar" />
<pathelement path="${junit.location}/junit.jar" />
</path>
<property name="antcontrib.location" location="${tool.dir}/ant-contrib" />
<path id="antcontrib.lib">
<fileset dir="${antcontrib.location}">
<include name="**/*.jar" />
</fileset>
</path>
<path id="antlr.lib">
<fileset dir="${tool.dir}/antlr">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${libinclude}/build">
<include name="**/*.jar"/>
</fileset>
</path>
<!-- directory that contains codecoverage jars -->
<property name="codecoverage.dir" value="${tool.dir}/codecoverage" />
<path id="codecoverage.classpath">
<fileset dir="${codecoverage.dir}">
<include name="**/*.jar" />
</fileset>
</path>
<property name="pmd.dir" value="${tool.dir}/pmd" />
<path id="pmd.lib">
<pathelement location="${build}"/>
<fileset dir="${pmd.dir}">
<include name="**/lib/*.jar"/>
</fileset>
<pathelement path="${junit.location}/ant-junit.jar" />
<pathelement path="${junit.location}/junit.jar" />
</path>
<property name="checkstyle.dir" value="${tool.dir}/checkstyle" />
<path id="checkstyle.lib">
<fileset dir="${checkstyle.dir}">
<include name="**/*.jar" />
</fileset>
</path>
<property name="osgi.location" location="${tool.dir}/ant-osgi" />
<path id="osgi.ant.lib">
<fileset dir="${osgi.location}">
<include name="**/*.jar" />
</fileset>
</path>
<property name="groovy.location" location="${tool.dir}/groovy" />
<path id="groovy.lib">
<fileset dir="${groovy.location}">
<include name="**/*.jar" />
</fileset>
</path>
<!--
***********************************************************************
PATH DEFINITIONS
***********************************************************************
-->
<path id="lib.include">
<fileset dir="${jardist}">
<include name="**/*.jar" />
<!-- Excluding the jar otherwise the tests are not getting passed-->
<exclude name="*.jar" />
</fileset>
</path>
<!-- all Third Party jars and tool jars this module needs to compile -->
<path id="lib.jars">
<path refid="lib.include" />
<fileset dir="${libexclude}">
<include name="**/*.jar" />
</fileset>
</path>
<!-- must keep junit jars separate for ease of creating classpath in manifest -->
<path id="tool.and.lib">
<path refid="lib.jars" />
<fileset dir="${junit.location}">
<include name="**/*.jar" />
</fileset>
</path>
<path id="classes.classpath">
<pathelement location="${build}" />
</path>
<path id="testall.classpath">
<path refid="tool.and.lib" />
<path refid="classes.classpath" />
<!-- codecoverage class path place here -->
<fileset dir="${codecoverage.dir}" includes="**/*.jar" />
</path>
<path id="codecoverage.all">
<path refid="testall.classpath" />
</path>
<!--
***********************************************************************
INIT TASKS
***********************************************************************
-->
<target name="taskdefs" depends = "install-ivy">
<tstamp>
<format property="manifest.date" pattern="EE MMMM d yyyy, HH:mm:ss" locale="en" />
</tstamp>
<echo message="BUILT AT=${manifest.date}"/>
<!-- Override this property to build official release -->
<property name="version" value="0.0.0" />
<echo message="***************************USING THIS ANT************************" />
<echo message="ant.home=${ant.home}" />
<echo message="*****************************************************************" />
<!--Just a convenient pathconvert to debug paths above by converting to string and printing -->
<pathconvert dirsep="/" pathsep=" " property="temp.somepath" refid="junit.lib" setonempty="true" />
<echo message="junit.lib=${temp.somepath}" />
<taskdef resource="net/sf/antcontrib/antlib.xml" classpathref="antcontrib.lib" />
<!--taskdef resource="emma_ant.properties" classpathref="emma.lib" /-->
<taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpathref="groovy.lib"/>
<!-- for some reason, I can't use resource="checkstyletask.properties" as it fails here-->
<taskdef name="checkstyle" classname="com.puppycrawl.tools.checkstyle.CheckStyleTask" classpathref="checkstyle.lib"/>
<taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="pmd.lib"/>
<taskdef name="bundleinfo" classname="org.knopflerfish.ant.taskdefs.bundle.BundleInfoTask" classpathref="osgi.ant.lib" />
<taskdef name="bundlemanifest" classname="org.knopflerfish.ant.taskdefs.bundle.BundleManifestTask" classpathref="osgi.ant.lib" />
<taskdef name="bundlehtml" classname="org.knopflerfish.ant.taskdefs.bundle.BundleHTMLExtractorTask" classpathref="osgi.ant.lib" />
<taskdef name="bundleobr" classname="org.knopflerfish.ant.taskdefs.bundle.OBRExtractorTask" classpathref="osgi.ant.lib" />
<!-- codecoverage taskdef statement -->
<taskdef classpathref="codecoverage.classpath" resource="tasks.properties" />
</target>
<!--
***********************************************************************
BEGIN TARGETS
***********************************************************************
-->
<!-- Just creates the input directories this build file uses if they are not
already created -->
<target name="create-src" depends="taskdefs">
<mkdir dir="${javacode}" />
<mkdir dir="${libinclude}" />
<mkdir dir="${libexclude}" />
<mkdir dir="${native}" />
<mkdir dir="${schemas}" />
<mkdir dir="${jardist}" />
<mkdir dir="${codecov.classes}" />
<!-- classpath for the jars needed to run application
Used in testall, test, and run targets-->
<path id="classpath.application">
<fileset dir="${jardist}">
<include name="**/*.jar" />
</fileset>
<pathelement path="${jardist}" />
</path>
</target>
<target name="generateparser" depends="retrieve">
<java classname="org.antlr.Tool" fork="true" failonerror="true">
<classpath >
<path refid="antlr.lib" />
</classpath>
<arg value="-verbose"/>
<arg value="-make"/>
<arg value="-report"/>
<arg value="-o"/>
<arg path="${gen.src}/com/alvazan/orm/parser/antlr"/>
<arg path="${schemas}/NoSql.g"/>
</java>
</target>
<!--
***********************************************************************
COMPILE TARGET
***********************************************************************
-->
<target name="compile" depends="generateparser">
<mkdir dir="${build}" />
<pathconvert property="compile.classpath" pathsep=":">
<path refid="tool.and.lib" />
</pathconvert>
<!--echo message="Compiling generated sources in ${gen.src}" />
<echo message="Putting the class files in ${build}" />
<echo message="classpath=${compile.classpath}" />
<javac srcdir="${gen.src}" destdir="${build}" deprecation="yes" debug="on">
<classpath>
<path refid="tool.and.lib" />
</classpath>
</javac-->
<echo message="Compiling files in ${javacode} and ${gen.src}" />
<echo message="Putting the class files in ${build}" />
<echo message="classpath=${compile.classpath}" />
<!-- Compile the java code from ${javacode} into ${build} -->
<javac srcdir="${javacode}" destdir="${build}" deprecation="yes" debug="on">
<classpath>
<path refid="tool.and.lib" />
</classpath>
<src path="${gen.src}"></src>
</javac>
<!-- copy all misc. files over(config.jaas, etc.) from the ${javacode} directory-->
<!-- Will not copy over *.jpg, *.gif, *.html for here(those are for javadoc)-->
<copy todir="${build}">
<fileset dir="${javacode}">
<exclude name="**/*.java" />
<exclude name="**/*.htm" />
<exclude name="**/*.html" />
<exclude name="**/doc_*.jpg" />
<exclude name="**/doc_*.gif" />
<exclude name="**/*.bak" />
<exclude name="**/*~" />
<exclude name="**/vssver*.*" />
<exclude name="**/.nbattrs" />
</fileset>
</copy>
<!-- convert any asian languages from UTF-8 to ascii so they can be used-->
<native2ascii encoding="UTF-8" src="${javacode}" dest="${build}" includes="**/*.utf8-properties" ext=".properties" />
<!--check for rmi stubs so if there are we will do the next target-->
<fileset dir="${build}" id="rmi.fileset">
<include name="**/RMI*.class" />
</fileset>
<pathconvert pathsep="\r\n" property="have.rmi.files" refid="rmi.fileset" setonempty="false" />
</target>
<!--
***********************************************************************
RMI TARGET - This target is automatically skipped if there are no RMI files
***********************************************************************
-->
<target name="rmi-stubs" depends="compile" if="have.rmi.files">
<echo message="******************RMI FILES TO COMPILE********************" />
<echo message="rmifiles=${have.rmi.files}" />
<echo message="**********************************************************" />
<mkdir dir="${rmi.stubs}" />
<rmic base="${build}" includes="**\RMI*.class" debug="yes">
<classpath>
<pathelement path="${build}" />
<fileset dir="${libinclude}">
<include name="**/*.jar" />
</fileset>
</classpath>
</rmic>
<copy todir="${rmi.stubs}">
<fileset dir="${build}" includes="**\Remote*.class" />
<fileset dir="${build}" includes="**\*_Stub.class" />
<fileset dir="${build}" includes="**\*_Skel.class" />
</copy>
</target>
<!--
***********************************************************************
OSGI specific stuff
***********************************************************************
-->
<target name="key1" if="exports" depends="compile">
<property name="export" value="Export-Package" />
</target>
<target name="key2" unless="exports" depends="key1">
<property name="export" value="No-Export-Package" />
</target>
<!--
***********************************************************************
MANIFEST TARGET
***********************************************************************
-->
<target name="manifest" depends="key2">
<mkdir dir="${manifest}" />
<mkdir dir="${build}"/>
<!-- convert cvs tag to osgi compatible version number -->
<propertyregex property="tmp10" input="${version}" regexp="-" replace="." defaultValue="${version}" />
<propertyregex property="realVersion" input="${tmp10}" regexp="r" replace="" defaultValue="${version}" />
<echo message="v=${realVersion}" />
<echo message="v2=${version}"/>
<copy file="${version.file.path}" todir="${build}"/>
<propertyfile file="${build}/${version.filename}">
<entry key="server.version" value="${realVersion}"/>
</propertyfile>
<property name="bundle.uuid" value="biz.xsoftware:${name}:${version}:all" />
<property name="ee.check.foundation" value="false" />
<property name="bundle.emptystring" value="[bundle.emptystring]" />
<!--generate classpath to add to manifest using all jars in lib and main jar-->
<pathconvert dirsep="/" pathsep="," property="manifest.classpath" refid="lib.include" setonempty="true">
<!--The map takes away the beginning of the path just leaving the jar file name -->
<map from="${full.lib.path}${file.separator}" to="" />
</pathconvert>
<property name="bundle.classpath" value=".,${manifest.classpath}" />
<echo message="bundle.classpath=${bundle.classpath}" />
<!-- the following is for osgi pojo's. You don't need to depend on osgi
to use it, but the manifest has to have some entries!!! -->
<bundleinfo exports="export.package" checkFoundationEE="${ee.check.foundation}">
<fileset dir="${build}" includes="${api.pattern}" />
</bundleinfo>
<bundleinfo activator="bundle.activator" imports="import.package" stdimports="${ignore.imports}" checkFoundationEE="${ee.check.foundation}">
<fileset dir="${build}" includes="${impl.pattern}" />
</bundleinfo>
<echo message="export=${export}" />
<propertyregex property="modifyVersion" input="${realVersion}" regexp="0.0.0" replace="${server.version} developer" defaultValue="${realVersion}" />
<bundlemanifest file="${manifest}/MANIFEST.MF">
<attribute name="Bundle-Name" value="${name}" />
<attribute name="Bundle-SymbolicName" value="${name}" />
<attribute name="Bundle-Version" value="${modifyVersion}" />
<attribute name="Bundle-Description" value="${manifest.description}" />
<attribute name="Bundle-Vendor" value="${manifest.vendor}" />
<attribute name="Bundle-DocURL" value="${manifest.vendor}" />
<attribute name="Bundle-ContactAddress" value="${manifest.vendor}" />
<attribute name="Service-Component" value="descriptors/metadata.xml" />
<attribute name="Bundle-Category" value="${bundle.emptystring}" />
<attribute name="Bundle-Config" value="${bundle.emptystring}" />
<attribute name="Bundle-Classpath" value="${bundle.classpath}" />
<attribute name="Export-Service" value="${bundle.emptystring}" />
<attribute name="Import-Service" value="${bundle.emptystring}" />
<attribute name="DynamicImport-Package" value="*" />
<attribute name="${export}" value="${exports}" />
<attribute name="Import-Package" value="${imports}" />
<attribute name="Bundle-UUID" value="${bundle.uuid}" />
<attribute name="Built-From" value="${manifest.builder}" />
<attribute name="Build-Date" value="${manifest.date}" />
<attribute name="Application-Icon" value="${manifest.icon}" />
<attribute name="Bundle-SubversionURL" value="${manifest.vendor}" />
<attribute name="Bundle-APIVendor" value="${manifest.vendor}" />
<attribute name="Built-By" value="${manifest.builder}" />
<!--can't do this with osgi, it tries to run main instead of the service -->
<!--attribute name="Main-Class" value="${manifest.mainclass}"/-->
<attribute name="Class-Path" value="${manifest.classpath}" />
<!--
<attribute name="Specification-Title" value="${spec.title}"/>
<attribute name="Specification-Version" value="${spec.version}"/>
<attribute name="Specification-Vendor" value="${spec.vendor}"/>
-->
<attribute name="Implementation-Title" value="${manifest.title}" />
<attribute name="Implementation-Version" value="${version} ${TODAY}" />
<attribute name="Implementation-Vendor" value="${manifest.vendor}" />
<!-- non-standard manifest attributes -->
<attribute name="SubMain-Class" value="${manifest.mainclass}" />
<attribute name="JarVersion" value="${version} ${TODAY}" />
<!--
<section name="common/class1.class">
<attribute name="Sealed" value="false"/>
</section>
-->
</bundlemanifest>
</target>
<target name="copyForJar" depends="manifest">
<echo message="osgi.enabled=${osgi.enabled}" />
<echo message="webapp.enabled=${webapp.enabled}" />
<if>
<equals arg1="true" arg2="${osgi.enabled}" />
<!--ispropertytrue property="osgi.enabled" /-->
<then>
<!-- copy all jars that need to be in this osgi bundle jar into the directory that will be jarred up-->
<copy todir="${build}">
<fileset dir="${libinclude}" includes="**" />
</copy>
</then>
<elseif>
<equals arg1="true" arg2="${webapp.enabled}" />
<!--ispropertytrue property="webapp.enabled" /-->
<then>
<property name="run.war.target" value="true" />
</then>
</elseif>
</if>
</target>
<!--
***********************************************************************
JAR TARGET
***********************************************************************
-->
<target name="jar" depends="copyForJar, make" description="Builds a jar file">
<!-- Create the distribution directory -->
<mkdir dir="${jardist}" />
<!-- Put all implementation classes from ${build} into the jar file -->
<jar jarfile="${jardist}/${jar.name}" manifest="${manifest}/MANIFEST.MF" >
<fileset dir="${build}" excludes="**/test/**">
<exclude name="**/test/**"/>
<exclude name="logback.xml"/>
</fileset>
<fileset dir="${javacode}" excludes="**/test/**" />
<fileset dir="${gen.src}" excludes="**/test/**" />
</jar>
</target>
<target name="verifydesign" depends="compile">
<verifydesign design="bldfiles/configDesign.xml" >
<path>
<fileset dir="${build}">
<include name="**/*.class"/>
</fileset>
</path>
</verifydesign>
</target>
<!--
***********************************************************************
WAR TARGET
***********************************************************************
-->
<target name="forprod">
<mkdir dir="${webstuff}/WEB-INF"/>
</target>
<target name="war" depends="jar" if="run.war.target" description="Builds a war file">
<mkdir dir="${webstuff}"/>
<copy todir="${webstuff}">
<fileset dir="${webroot}">
<exclude name="**/WEB-INF/lib/classes/**/*.*"/>
<exclude name="**/WEB-INF/lib/**/*.*"/>
<exclude name="WEB-INF/components.xml"/>
<exclude name="WEB-INF/web.xml"/>
</fileset>
</copy>
<echo message="vers=${realVersion}"/>
<move todir="${webstuff}/res${realVersion}">
<fileset dir="${webstuff}/res"/>
</move>
<mkdir dir="${wardist}" />
<war destfile="${war.file}" webxml="${webroot}/WEB-INF/web.xml" manifest="${manifest}/MANIFEST.MF">
<lib dir="${libinclude}">
<include name="**/*.jar"/>
</lib>
<classes dir="${build}" />
<fileset dir="${webstuff}">
</fileset>
</war>
</target>
<!--
================================================================================
Creates the distribution
================================================================================
-->
<target name="createdist" depends="war">
<mkdir dir="${dist}" />
<mkdir dir="${staging}" />
</target>
<!--
***********************************************************************
START APPLICATION TARGET
***********************************************************************
-->
<target name="run" depends="war">
<pathconvert property="application.classpath" pathsep=":">
<path refid="classpath.application" />
</pathconvert>
<echo message="Forking of the program...${client.to.run}" />
<echo message="classpath=${application.classpath}" />
<echo message="codebase=${basedir}\${rmi.stubs}" />
<echo message="jvmargs=${client.jvm.args}" />
<echo message="program args=${client.args}" />
<java classname="${client.to.run}" fork="yes" dir=".">
<jvmarg line="${client.jvm.args}" />
<arg line="${client.args}" />
<classpath>
<path refid="classpath.application" />
</classpath>
</java>
</target>
<!--
***********************************************************************
TEST TARGET
***********************************************************************
-->
<target name="test" depends="createdist">
<input message="Input test class name. (ie. org.awt.TestEdgeLayout):" addproperty="test" />
<echo message="looking for file named ${test}" />
<available classname="${test}" property="test.exists">
<classpath>
<path refid="classpath.application" />
</classpath>
</available>
<echo message="value=${test.exists}" />
<pathconvert property="search.classpath" pathsep=":">
<path refid="classpath.application" />
</pathconvert>
<fail unless="test.exists">
The test case '${test}.class' cannot be found in the classpath.
Check all files in the classpath and make sure the appropriate
class file exists. The classpath is=${search.classpath}
</fail>
<mkdir dir="${junit.results}" />
<pathconvert property="junit.classpath" pathsep=":">
<path refid="classpath.application" />
</pathconvert>
<echo message="About to run JUnit test(${test})..." />
<echo message="current directory=${basedir}" />
<echo message="classpath=${junit.classpath}" />
<junit fork="yes" haltonfailure="yes" dir="${basedir}">
<classpath>
<path refid="classpath.application" />
</classpath>
<jvmarg value="-Djar.name=${jardist}/${jar.name}" />
<jvmarg value="-Dversion=${version}" />
<formatter type="plain" usefile="false" />
<formatter type="xml" />
<test name="${test}" todir="${junit.results}" />
</junit>
</target>
<!--
***************************************************************************
Instrumentation Target
***************************************************************************
-->
<target name="instrument" depends="compile" description="instrument into the class files">
<cobertura-instrument todir="${codecov.classes}" datafile="${codecov.instrument.file}">
<ignore regex="org.apache.log4j.*" />
<fileset dir="${build}">
<exclude name="**/test/**/*.class"/>
</fileset>
</cobertura-instrument>
</target>
<target name="testall" depends="compile" description="Run ALL junit and abbot tests after compiling code">
<mkdir dir="${junit.results}" />
<pathconvert property="junit.classpath" pathsep=":">
<path refid="testall.classpath" />
</pathconvert>
<echo message="About to run JUnit tests..." />
<echo message="pattern1=${junit.pattern1}" />
<!--echo message="pattern2=${junit.pattern2}" /-->
<echo message="current directory=${basedir}" />
<echo message="classpath=${junit.classpath}" />
<!-- must be forked for instrumentation to work!!! -->
<junit fork="yes" dir="${basedir}" haltonfailure="yes" failureproperty="is.test.fail" printsummary="withOutAndErr">
<classpath>
<path refid="testall.classpath" />
</classpath>
<jvmarg value="-Djar.name=${jardist}/${jar.name}" />
<jvmarg value="-Dversion=${version}" />
<jvmarg value="-Dautobuild=true"/>
<formatter type="plain" usefile="false"/>
<formatter type="xml" />
<batchtest todir="${junit.results}">
<fileset dir="${build}">
<patternset>
<include name="biz/xsoftware/manifest/Test*.class" />
<include name="${junit.pattern1}" />
<!--include name="${junit.pattern2}" /-->
<exclude name="**/*$$*.class" />
</patternset>
</fileset>
</batchtest>
</junit>
<!-- not used because this is good for automated build but bad for developer.
Developer doesn't want to look through 100 test cases to see which one
is failing. To use this gain haltonfailure above needs to be off-->
<!-- after all tests are run, this makes the build fail-->
<fail if="is.test.fail" />
</target>
<!--
***********************************************************************
TEST ALL TARGET
***********************************************************************
-->
<target name="testallcoverage" depends="instrument" description="Run ALL junit and abbot tests after compiling code">
<mkdir dir="${junit.results}" />
<pathconvert property="junit.classpath" pathsep=":">
<path refid="classpath.application" />
</pathconvert>
<echo message="About to run JUnit tests..." />
<echo message="pattern1=${junit.pattern1}" />
<!--echo message="pattern2=${junit.pattern2}" /-->
<echo message="current directory=${basedir}" />
<echo message="classpath=${junit.classpath}" />
<!-- must be forked for instrumentation to work!!! -->
<junit fork="yes" dir="${basedir}" haltonfailure="yes" failureproperty="is.test.fail" printsummary="withOutAndErr">
<sysproperty key="net.sourceforge.cobertura.datafile" file="${codecov.instrument.file}" />
<classpath location="${codecov.classes}" />
<classpath>
<path refid="testall.classpath" />
<!--path refid="emma.lib" /-->
</classpath>
<classpath refid="codecoverage.all" />
<!--jvmarg value="-Demma.coverage.out.file=${codecov.temp}/coverage.emma" />
<jvmarg value="-Demma.coverage.out.merge=true" /-->
<jvmarg value="-Djar.name=${jardist}/${jar.name}" />
<jvmarg value="-Dversion=${version}" />
<jvmarg value="-Dautobuild=true"/>
<formatter type="plain" usefile="false"/>
<formatter type="xml" />
<batchtest todir="${junit.results}">
<fileset dir="${build}">
<patternset>
<include name="biz/xsoftware/manifest/Test*.class" />
<include name="${junit.pattern1}" />
<!--include name="${junit.pattern2}" /-->
<exclude name="**/*$$*.class" />
</patternset>
</fileset>
</batchtest>
</junit>
<!-- not used because this is good for automated build but bad for developer.
Developer doesn't want to look through 100 test cases to see which one
is failing. To use this gain haltonfailure above needs to be off-->
<!-- after all tests are run, this makes the build fail-->
<fail if="is.test.fail" />
<mkdir dir="${codecov.report}"/>
<cobertura-report destdir="${codecov.report}" datafile="${codecov.instrument.file}">
<fileset dir="${javacode}">
<include name="**/*.java" />
</fileset>
</cobertura-report>
<cobertura-check totallinerate="${totallinerate}" branchrate="0" totalbranchrate="0" datafile="${codecov.instrument.file}">
<regex pattern=".*" branchrate="0" linerate="0"/>
<regex pattern=".*" branchrate="0" linerate="0"/>
</cobertura-check>
<!--
<property name="report.tmp" location="${codecov.report}" />
<echo message="report=${report.tmp}" />
<emma enabled="${emma.enabled}">
<report sourcepath="${javacode}:${versioning.src}">
<fileset dir="${codecov.temp}">
<include name="*.emma" />
</fileset>
<txt outfile="${report.tmp}/coverage.txt" />
<html outfile="${report.tmp}/index.html" />
</report>
</emma>
-->
<!--delete dir="${codecov.temp}"/-->
</target>
<target name="webtestall" description="Start Proxy ; Run TestNG ; stop Proxy">
<parallel>
<antcall target="start-server"></antcall>
<sequential>
<echo taskname="waitfor" message="Wait for proxy server launch" />
<waitfor maxwait="2" maxwaitunit="minute" checkevery="100">
<http url="http://localhost:4444/selenium-server/driver/?cmd=testComplete"/>
</waitfor>
<antcall target="seleniumtests"></antcall>
<antcall target="stop-server"></antcall>
</sequential>
</parallel>
</target>
<target name="start-server">
<java jar="tools/selenium/selenium-server.jar" fork="true" spawn="true">
<arg line="-timeout 30"/>
</java>
</target>
<target name="stop-server">
<get taskname="selenium-shutdown"
src="http://localhost:4444/selenium-server/driver/?cmd=shutDown"
dest="result.txt" ignoreerrors="true" />
<echo taskname="selenium-shutdown" message="DGF Errors during shutdown are expected" />
</target>
<target name="seleniumtests" depends="jar,start-server" description="Run ALL junit and abbot tests after compiling code">
<mkdir dir="${junit.results}" />
<pathconvert property="junit.classpath" pathsep=":">
<path refid="classpath.application" />
</pathconvert>
<echo message="About to run JUnit tests..." />
<echo message="pattern1=${junit.pattern1}" />
<!--echo message="pattern2=${junit.pattern2}" /-->
<echo message="current directory=${basedir}" />
<echo message="classpath=${junit.classpath}" />
<!-- must be forked for instrumentation to work!!! -->
<junit fork="yes" dir="${basedir}" haltonfailure="yes" failureproperty="is.test.fail" printsummary="withOutAndErr">
<sysproperty key="net.sourceforge.cobertura.datafile" file="${codecov.instrument.file}" />
<classpath location="${codecov.classes}" />
<classpath>
<path refid="testall.classpath" />
<!--path refid="emma.lib" /-->
</classpath>
<classpath refid="codecoverage.all" />
<!--jvmarg value="-Demma.coverage.out.file=${codecov.temp}/coverage.emma" />
<jvmarg value="-Demma.coverage.out.merge=true" /-->
<jvmarg value="-Djar.name=${jardist}/${jar.name}" />
<jvmarg value="-Dversion=${version}" />
<jvmarg value="-Dautobuild=true"/>
<formatter type="plain" usefile="false" />
<formatter type="xml" />
<batchtest todir="${junit.results}">
<fileset dir="${build}">
<patternset>
<include name="**/WebTest*.class" />
<!--include name="${junit.pattern2}" /-->
<exclude name="**/*$$*.class" />
</patternset>
</fileset>
</batchtest>
</junit>
<!-- not used because this is good for automated build but bad for developer.
Developer doesn't want to look through 100 test cases to see which one
is failing. To use this gain haltonfailure above needs to be off-->
<!-- after all tests are run, this makes the build fail-->
<fail if="is.test.fail" />
<!--mkdir dir="${codecov.report}"/>
<cobertura-report destdir="${codecov.report}" datafile="${codecov.instrument.file}">
<fileset dir="${javacode}">
<include name="**/*.java" />
</fileset>
</cobertura-report>
<cobertura-check totallinerate="${totallinerate}" branchrate="0" totalbranchrate="0" datafile="${codecov.instrument.file}">
<regex pattern=".*" branchrate="0" linerate="0"/>
<regex pattern=".*" branchrate="0" linerate="0"/>
</cobertura-check-->
</target>
<!--
***********************************************************************
CHECKSTYLE TARGET
***********************************************************************
-->
<target name="checkstyle" depends="compile" description="Runs checkstyle against the code">
<mkdir dir="${reports}"/>
<echo message="MAX CHECKSTYLE ERRORS ALLOWED=${max.errors}"/>
<checkstyle config="bldfiles/configCheckstyle.xml" maxErrors="${max.errors}" maxWarnings="${max.errors}">
<classpath>
<path refid="tool.and.lib" />
<path refid="classes.classpath" />
</classpath>
<fileset dir="${javacode}" includes="**/*.java" />
<formatter type="plain" />
<formatter type="xml" toFile="${reports}/checkstyle_report.xml"/>
</checkstyle>
</target>
<!--
***********************************************************************
PMD TARGET
***********************************************************************
-->
<target name="pmd" depends="taskdefs">
<mkdir dir="${reports}"/>
<echo message="MAX PMD ERRORS ALLOWED=${pmd.maxerrors}"/>
<pathconvert dirsep="/" pathsep=" " property="temp.somepath1" refid="pmd.lib" setonempty="true" />
<echo message="pmd.lib=${temp.somepath1}" />
<pmd failuresPropertyName="pmd.numfailures" classpathref="pmd.lib" rulesetfiles="${full.config.path}/bldfiles/configPmd.xml">
<formatter type="text" toConsole="true"/>
<formatter type="html" toFile="${reports}/pmd_report.html"/>
<fileset dir="${javacode}" includes="**/*.java" />
</pmd>
<groovy>
<!-- The cdata section allows us to use greater than and less than signs in xml -->
<![CDATA[
def errors = properties["pmd.numfailures"]
def allowedErrors = properties["pmd.maxerrors"]
def intErrors=0
if(errors != null)
intErrors = Integer.parseInt(errors)
def intAllowedErrors = Integer.parseInt(allowedErrors);
println "errors="+intErrors+" allowed="+allowedErrors
if(errors!=null)
{
if( intErrors > intAllowedErrors) {
ant.fail(errors+" errors found in pmd, only "+allowedErrors+" are allowed")
}
}
else errors = 0
println errors+" errors found in pmd, with "+allowedErrors+" allowed before failing"
]]>
</groovy>
</target>
<!--
***********************************************************************
ALL TARGET
***********************************************************************
-->
<target name="all" depends="verifydesign, forprod, war, testall, checkstyle" description="">
</target>
<target name="testCheckin" depends="clean, all" description="This target should be run before checking in. It runs verifydesign, testall, checkstyle to make sure your code is good" />
<target name="universe" depends="all, javadoc" description="Runs all targets including javadoc as well as 'all' target" />
<!--
***********************************************************************
AUTOBUILD TARGET
***********************************************************************
-->
<target name="tag" depends="clean, universe">
<replaceregexp file="${version.file.path}" match="version=(.*)" replace="version=${realVersion}" flags="g" byline="true"/>
<cvs command="commit -m Change-version-number ${version.file.path}" failonerror="true"/>
<cvs command="tag -R ${version}" failonerror="true" />
</target>
<target name="autobuild" depends="tag">
<ant antfile="bldfiles/autobuild.xml" target="autobuild"/>
</target>
<target name="autobuild2" depends="tag">
<ant antfile="bldfiles/autobuild.xml" target="autobuild2"/>
</target>
<!--
***********************************************************************
JAVAH TARGET - Creates JNI C header files if needed
***********************************************************************
-->
<target name="javah" depends="compile" if="javah.classes">
<javah class="${javah.classes}" destdir="${native}">
<classpath refid="build.classpath" />
</javah>
</target>
<!--
***********************************************************************
Runs make on the C++/C code if a Makefile exists in the proper directory
***********************************************************************
-->
<target name="make" depends="javah" if="makeExists">
<echo message="make in ${native}" />
<exec executable="make" dir="${native}" />
</target>
<target name="tomcatTasks">
<fail unless="tomcat.home" message="PLEASE make sure you have a ${user.home}/ant.properties file with the property tomcat.home set" />
<fail unless="tomcat.username" message="PLEASE make sure you have a ${user.home}/ant.properties file with the property tomcat.username set" />
<fail unless="tomcat.password" message="PLEASE make sure you have a ${user.home}/ant.properties file with the property tomcat.password set" />
<fail unless="tomcat.url" message="PLEASE make sure you have a ${user.home}/ant.properties file with the property tomcat.url set" />
<property name="tomcat.manager.url" value="${tomcat.url}/manager" />
<path id="tomcat.classpath">
<fileset dir="${tomcat.home}/server/lib/">
<include name="catalina-ant.jar" />
</fileset>
</path>
<!--Just a convenient pathconvert to debug paths above by converting to string and printing -->
<pathconvert dirsep="/" pathsep=" " property="temp.tomcat" refid="tomcat.classpath" setonempty="true" />
<echo message="tomcat ant task jars=${temp.tomcat}" />
<taskdef resource="org/apache/catalina/ant/antlib.xml" classpathref="tomcat.classpath" />
</target>
<target name="deploy" description="Install application in Tomcat" depends="tomcatTasks, war">
<deploy url="${tomcat.manager.url}" username="${tomcat.username}" password="${tomcat.password}" path="/${name}" war="${war.file}" />
</target>
<target name="undeploy" description="Remove application in Tomcat" depends="tomcatTasks">
<undeploy url="${tomcat.manager.url}" username="${tomcat.username}" password="${tomcat.password}" path="/${name}" />
</target>
<target name="redeploy" description="Reload application in Tomcat" depends="war, undeploy, deploy">
<!--reload url="${tomcat.manager.url}" username="${tomcat.username}" password="${tomcat.password}" path="/${name}" /-->
</target>
<target name="start" description="Start Tomcat application" depends="tomcatTasks">
<start url="${tomcat.manager.url}" username="${tomcat.username}" password="${tomcat.password}" path="/${name}" />
</target>
<target name="stop" description="Stop Tomcat application" depends="tomcatTasks">
<stop url="${tomcat.manager.url}" username="${tomcat.username}" password="${tomcat.password}" path="/${name}" />
</target>
<target name="tomcatInfo" description="List Tomcat applications" depends="tomcatTasks">
<list url="${tomcat.manager.url}" username="${tomcat.username}" password="${tomcat.password}" />
<roles url="${tomcat.manager.url}" username="${tomcat.username}" password="${tomcat.password}" />
<resources url="${tomcat.manager.url}" username="${tomcat.username}" password="${tomcat.password}" />
<sessions url="${tomcat.manager.url}" username="${tomcat.username}" password="${tomcat.password}" path="/${name}" />
</target>
<!--
***********************************************************************
JAVADOC TARGET
***********************************************************************
-->
<target name="javadoc" description="Generate JavaDoc">
<mkdir dir="${javadoc}" />
<!-- copy all package.html files, img's etc for javadoc -->
<copy todir="${javadoc}">
<fileset dir="${javacode}" excludes="**/*.java" />
</copy>
<echo message="package lists in=${package.list}" />
<javadoc sourcepath="${javacode}" destdir="${javadoc}" author="true" version="true" use="true" public="yes" overview="${javacode}/overview.html" windowtitle="${javadoc.title} ${version}" doctitle="${javadoc.title} ${version}" Verbose="true">
<!-- classpath needed to link up to third_party libs without 100's of warnings -->
<classpath>
<path refid="tool.and.lib" />
</classpath>
<fileset dir="${javacode}">
<include name="${javadoc.pattern}" />
</fileset>
<doctitle>
<![CDATA[<h1>${javadoc.title} ${version}</h1>]]></doctitle>
<bottom>
<![CDATA[<i>${copyright}</i>
<br>${javadoc.bottom}]]></bottom>
<link offline="true" href="http://java.sun.com/j2se/1.4.2/docs/api" packagelistLoc="${package.list}/jdk" />
<link offline="true" href="http://www.junit.org/junit/javadoc/3.8.1" packagelistLoc="${package.list}/junit" />
</javadoc>
</target>
<!--
***********************************************************************
CLEAN TARGET
***********************************************************************
-->
<target name="clean" depends="create-src" description="Clean all generated files">
<!-- Delete everything in the ${generated} directory tree -->
<delete dir="${generated}" />
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.