Update of /cvsroot/mocklib/gwtmocklib/bldfiles
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv23230/bldfiles
Added Files:
directory.properties build.xml ant.properties design.xml
Log Message:
first commit of gwtmocklib module.
--- NEW FILE: design.xml ---
<design>
<!-- See the documentation of the ant-contrib project to fill in the package design here
ant-contrib is at http://sourceforge.net/projects/ant-contrib. Currently, this
template is using a version from the CVS head, and the docs are up to date on the
CVS head, but not in the latest download yet as I have not asked for a new release
on ant-contrib yet(wanted to finish a few more things), but this is stable and works.
I just want to add one more feature-->
<!-- DO NOT MODIFY THE NEXT LINES -->
<package name="manifest" package="biz.xsoftware.manifest"
needdeclarations="true" subpackages="include" needdepends="false"/>
<package name="junit" package="junit" subpackages="include" needdeclarations="false"/>
<package name="mocklib" package="biz.xsoftware.mock" subpackages="include" needdeclarations="false"/>
<!-- should erase the following... -->
<package name="biz" package="biz" subpackages="include" needdepends="false"/>
<package name="com" package="com" subpackages="include" needdepends="false"/>
<package name="org" package="org" subpackages="include" needdepends="false"/>
<package name="net" package="net" subpackages="include" needdepends="false"/>
<!-- should use something like this instead on a per project basis -->
<package name="api" package="biz.xsoftware.api" subpackages="include"/>
<package name="testapi" package="biz.xsoftware.test" subpackages="include" depends="api"/>
<package name="impl" package="biz.xsoftware.impl" subpackages="include" depends="api"/>
</design>
--- NEW FILE: ant.properties ---
#-----------------------------------------------------------------------
# MANIFEST and JAR properties - Make sure you change these to your settings.
#-----------------------------------------------------------------------
name =gwtrpc
#used as the jar file name(ie. ${name}.jar)
#used as zip file name(ie. ${name}-version.jar)
#used as the directory staging name
#version info may be retrieved using java -jar ${name}.jar -version
webapp.enabled =true
#if set to true, will build a war file with all jar files in input/libinclude
#and will also contain all files from input/webroot
#and will also contain all the classes from input/javasrc
osgi.enabled =false
#if set to true, will build an osgi jar file with all the jar files from
#input/libinclude and all the classes from input/javasrc
imports =[bundle.emptystring]
exports =[bundle.emptystring]
impl.pattern =biz/**,com/**,net/**
#The packages to make private
build.source=5
manifest.mainclass = TOOLS.JAVA.Main
#The class that is run when java -jar xxxx.jar is run
manifest.title = Ant Build Template
manifest.vendor = http://sourceforge.net/projects/vmaster
manifest.builder = Dean Hiller
manifest.description = Put a project description in bldfiles/ant.properties
manifest.icon =
copyright = Copyright © 2000 Dean Hiller All Rights Reserved.
javadoc.title = Build Template
javadoc.bottom = If you would like a shared copyright, contact me at dea...@us...<br> \
<a href=http://sourceforge.net> \
<IMG src=http://sourceforge.net/sflogo.php?group_id=113040 width=210 height=62 border=0 alt=SourceForge Logo> \
</a>
#-----------------------------------------------------------------------
# Properties to run the program using the "run" target in build.xml(ie. build run)
# Just try ./build run to execute org.NO.MAIN.YET below(of course, that class
# doesn't exist, so I would suggest changing that.
#-----------------------------------------------------------------------
client.to.run = org.NO.MAIN.YET
#Class run when "build run" target is used
client.args =
#params to the java app for the run target to run the application
client.jvm.args = -enableassertions
#params to the JVM for the run target to run the application
###########################################################
# If you need JNI header files, uncomment the following property
# and put the classes that need to generate header files
# in this property(a comma delimted list)
##########################################################
#
#javah.classes=com.avaya.example.callinfo.mci.MCI
#
###########################################################
#If you need to use castor set 'xsd.start' to the name
#of your main xsd file, and uncomment the line
##########################################################
#
#xsd.start=yourName.xsd
#
--- NEW FILE: build.xml ---
<?xml version="1.0"?>
<!--
Run "ant -projecthelp" to view all the possible targets and descriptions.
-->
<project name="std_buildfile" default="all" basedir="..">
<!-- 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" />
<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 -->
<!--we can't do this if there are tool jars in the lib as we don't want tool jars in
the manifest classpath???? or do we? -->
<property name="full.lib.path" location="${lib}" />
<property name="jar.name" value="${name}.jar" />
<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>
<!-- directory that contains emma.jar and emma_ant.jar: -->
<property name="emma.dir" value="${tool.dir}/emma" />
<path id="emma.lib">
<fileset dir="${emma.dir}">
<include name="**/*.jar" />
</fileset>
</path>
<property name="findbugs.dir" value="${tool.dir}/findbugs" />
<path id="findbugs.lib">
<fileset dir="${findbugs.dir}/lib">
<include name="**/*.jar" />
</fileset>
</path>
<property name="checkstyle.dir" value="${tool.dir}/checkstyle" />
<property name="osgi.location" location="${tool.dir}/ant-osgi" />
<path id="osgi.ant.lib">
<fileset dir="${osgi.location}">
<include name="**/*.jar" />
</fileset>
</path>
<!--
***********************************************************************
PATH DEFINITIONS
***********************************************************************
-->
<path id="lib.include">
<fileset dir="${lib}">
<include 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="gwt">
<fileset dir="tools/gwt">
<include name="**/*.jar" />
</fileset>
</path>
<path id="classes.classpath">
<pathelement location="${build}" />
</path>
<path id="testall.classpath">
<fileset dir="${codecov.jar}" includes="**/*.jar" />
<!--pathelement location="${codecov.temp}"/-->
<path refid="tool.and.lib" />
<path refid="classes.classpath" />
</path>
<!--
***********************************************************************
INIT TASKS
***********************************************************************
-->
<target name="taskdefs">
<tstamp>
<format property="manifest.date" pattern="EE MMMM d yyyy, HH:mm:ss" locale="en" />
</tstamp>
<!-- 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 name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask" classpathref="junit.lib" />
<taskdef resource="net/sf/antcontrib/antlib.xml" classpathref="antcontrib.lib" />
<taskdef resource="emma_ant.properties" classpathref="emma.lib" />
<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpathref="findbugs.lib" />
<!-- for some reason, I can't use resource="checkstyletask.properties" as it fails here-->
<taskdef name="checkstyle" classname="com.puppycrawl.tools.checkstyle.CheckStyleTask">
<classpath>
<fileset dir="${checkstyle.dir}">
<include name="**/*.jar" />
</fileset>
</classpath>
</taskdef>
<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" />
</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="${lib}" />
<mkdir dir="${libexclude}" />
<mkdir dir="${native}" />
<mkdir dir="${schemas}" />
<mkdir dir="${jardist}" />
<!-- 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>
<!--
***********************************************************************
COMPILE TARGET
***********************************************************************
-->
<target name="compile" depends="create-src">
<mkdir dir="${build}" />
<pathconvert property="compile.classpath" pathsep=":">
<path refid="tool.and.lib" />
</pathconvert>
<echo message="Compiling files in ${javacode}" />
<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>
</javac>
<property name="gwt.module" value="com.google.gwt.sample.dynatable.DynaTable"/>
<!-- compile java to javascript here -->
<java failonerror="true" classname="com.google.gwt.dev.GWTCompiler" fork="true">
<classpath>
<pathelement path="${javacode}" />
<path refid="gwt" />
</classpath>
<arg value="-out" />
<arg value="output/gwt" />
<arg value="${gwt.module}" />
</java>
<!-- 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>
<!--
***********************************************************************
GWT SHELL
***********************************************************************
-->
<target name="gwtShell" depends="compile">
<echo message="HELLLLLLO"/>
<java failonerror="true" classname="com.google.gwt.dev.GWTShell" fork="true">
<classpath>
<pathelement path="${javacode}" />
<pathelement path="${build}"/>
<path refid="gwt" />
</classpath>
<arg value="-out" />
<arg value="output/gwt" />
<arg value="${gwt.module}/index.html" />
</java>
</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="${lib}">
<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}" />
<!-- 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}" />
<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}" />
<bundlemanifest file="${manifest}/MANIFEST.MF">
<attribute name="Bundle-Name" value="${name}" />
<attribute name="Bundle-SymbolicName" value="${name}" />
<attribute name="Bundle-Version" value="${realVersion}" />
<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="${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, nor war files probably -->
<!--attribute name="Main-Class" value="biz.xsoftware.manifest.ManifestInfo"/-->
<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>
<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="${lib}" includes="**" />
</copy>
</then>
<elseif>
<ispropertytrue property="webapp.enabled" />
<then>
<property name="run.war.target" value="true" />
</then>
</elseif>
<else>
<!-- Also, copy over all needed jars from ${lib} to ${jardist} -->
<copy todir="${jardist}">
<fileset dir="${lib}" includes="**" />
</copy>
</else>
</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}" basedir="${build}" manifest="${manifest}/MANIFEST.MF" />
<verifydesign jar="${jardist}/${jar.name}" design="bldfiles/design.xml" />
</target>
<!--
***********************************************************************
WAR TARGET
***********************************************************************
-->
<target name="war" depends="jar" if="run.war.target" description="Builds a war file">
<mkdir dir="${wardist}" />
<war destfile="${wardist}/${name}.war" webxml="${webroot}/WEB-INF/web.xml">
<lib dir="${lib}">
<include name="**/*.jar" />
</lib>
<classes dir="${build}" />
<fileset dir="${webroot}" />
<fileset dir="output/gwt/${gwt.module}"/>
</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>
<!--
***********************************************************************
INSTRUMENTATION TARGET
***********************************************************************
-->
<target name="instrumentation" depends="war">
<property name="emma.enabled" value="true" />
<mkdir dir="${codecov.temp}" />
<mkdir dir="${codecov.classes}" />
<mkdir dir="${codecov.jar}" />
<mkdir dir="${codecov.report}" />
<pathconvert property="instr.classpath" pathsep=":">
<path refid="classes.classpath" />
</pathconvert>
<echo message="instr.classpath=${instr.classpath}" />
<emma enabled="${emma.enabled}">
<instr instrpathref="classes.classpath" destdir="${codecov.classes}" metadatafile="${codecov.temp}/metadata.emma" merge="true" />
</emma>
<jar destfile="${codecov.jar}/${name}-instrumented.jar" duplicate="preserve" manifest="${manifest}/MANIFEST.MF">
<fileset dir="${codecov.classes}" includes="**" />
<fileset dir="${build}" includes="**" />
</jar>
</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>
<!--
***********************************************************************
TEST ALL TARGET
***********************************************************************
-->
<target name="testall" depends="instrumentation" 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" haltonfailure="yes" failureproperty="is.test.fail" dir="${basedir}" printsummary="withOutAndErr">
<classpath>
<path refid="testall.classpath" />
<path refid="emma.lib" />
</classpath>
<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}" />
<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" />
<!--autobuilds will not work without this while normal build will
because for some reason basedir was not being used property-->
<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>
<!--
***********************************************************************
FINDBUGS TARGET
***********************************************************************
-->
<target name="findbugs" depends="war" description="Runs findbugs against the code">
<mkdir dir="${findbugs.report}" />
<findbugs home="${findbugs.dir}" output="html" outputFile="${findbugs.report}/index.html">
<class location="${jardist}/${jar.name}" />
</findbugs>
</target>
<!--
***********************************************************************
CHECKSTYLE TARGET
***********************************************************************
-->
<target name="checkstyle" depends="compile" description="Runs checkstyle against the code">
<mkdir dir="${checkstyle.report}" />
<checkstyle config="${checkstyle.dir}/config.xml">
<classpath>
<path refid="tool.and.lib" />
<path refid="classes.classpath" />
</classpath>
<fileset dir="${javacode}" includes="**/*.java" />
<formatter type="plain" toFile="${checkstyle.report}/index.html" />
</checkstyle>
</target>
<!--
***********************************************************************
ALL TARGET
***********************************************************************
-->
<target name="all" depends="war,testall,checkstyle,findbugs,javadoc" description="compiles, runs tests, checkstyle, findbugs, and javadoc">
</target>
<!--
***********************************************************************
AUTOBUILD TARGET
***********************************************************************
-->
<target name="autobuild" depends="clean, all">
<cvs command="tag -R ${label}" failonerror="true" />
</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="${wardist}/${name}.war" />
</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">
</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>
--- NEW FILE: directory.properties ---
#----------------------------------------------------------------------
#DO NOT MAKE CHANGES TO THIS FILE, this file is overwriten
#every time build is run. To personalize make changes to
#ant.properties, dependencies.xml, and
#release.xml. All which are in the [basedir]/bldfiles directory
#----------------------------------------------------------------------
#-----------------------------------------------------------------------
# OUTPUT DIRECTORIES
#-----------------------------------------------------------------------
generated =output
manifest =${generated}/manifest
#will contain a generated manifest
build =${generated}/classes
#will contain all the *.class files after compile
#will contain all the *.jpg files from ${properties}
#will contain all the *.properties files from ${properties}
#will contain all the *.gif files from ${properties}
#will contain all the *.html files from ${properties}
#will contain all the *.* files from ${properties}
#will NOT contain *.html, *.htm, *.jpg, *.gif from ${javacode}
jardist =${generated}/jardist
#will contain a *.jar containing everything in ${build}
wardist =${generated}/wardist
#will contain a *.war containing everything in ${build} and ${webroot}
dist =${generated}/dist
#contains the release that gets released to the world
reports =${generated}/reports
codecov.report =${reports}/codecoverage
#contains the code coverage reports of what the unit tests
#covered
findbugs.report =${reports}/findbugs
checkstyle.report=${reports}/checkstyle
javadoc =${reports}/javadoc
#contains the javadoc of biz.xsoftware.api
allcodecov =${generated}/codecoverage
codecov.temp =${allcodecov}/misc
codecov.classes =${allcodecov}/instrumented-classes
#intermediate directory that contains instrumented classes to
#run testall against so a code coverage report can be spit out.
codecov.jar =${allcodecov}/instrumented-jar
junit.results =${generated}/test_results
#contains junit test results
staging =${generated}/staging
projstaging =${generated}/staging/${name}
#will contain all *.html generated by javadoc
#will contain all *.html from ${javacode} directory(such as package.html)
#will contain all *.jpg from ${javacode} directory
#will contain all *.gif from ${javacode} directory
rmi.stubs =${generated}/rmistubs
#contains all Remote*.class files copied from ${build}
#contains all *_stub.class files copied from ${build}
#contains all *_skel.class files copied from ${build}
#this directory is only created if RMI*.class exists
test.area =${generated}/tests
#This is sometimes created by JUnit tests to do temporary
#testing. It usually gets deleted afterwards.
gen.src =${generated}/src
#generated source code
#-----------------------------------------------------------------------
# INPUT DIRECTORIES - don't change these after the project is started.
#-----------------------------------------------------------------------
input =input
#contains all stuff that is an input into the build
config =bldfiles
#contains build.xml for the module, and any other build scripts
#plus build property files
javacode =${input}/javasrc
#Contains all *.java source files
#Contains all *.properties files that will go into the jar
#Contains all *.xml files that will go into the jar
#Contains all *.* that will go into the jar except doc_*.gif and doc_*.jpg
#Contains all *.html files needed by javadoc
#Contains all doc_*.jpg files needed by javadoc
#Contains all doc_*.gif files needed by javadoc
#Contains all *.* files needed by javadoc
webroot =${input}/webroot
#Contains all html, jsp, gif, jpg's, WEB-INF/web.xml, WEB-INF/faces-config.xml, etc. etc
lib =${input}/libinclude
#contains all *.jar needed to run the app and that need to be deployed with the app
#does not contain *.jars needed to compile the app(such as junit.jar)
libexclude =${input}/libexclude
#contains all the *.jar that are not needed to run the app. They are for testing or
#would already be deployed as services in the framework as in the case of an osgi logging
#service for example
native =${input}/native
#contains JNI C header file
schemas =${input}/schemas
#contains xsd schemas
#-----------------------------------------------------------------------
# MISCELLANEOUS
#-----------------------------------------------------------------------
junit.pattern1=**/Test*.class
#junit.pattern2=**/test/IntegTest*.class
javadoc.pattern=**/*.java
tool.dir=tools
package.list=${tool.dir}/package-list
build.sysclasspath=ignore
# Change this value and I call you a complete idiot(cp = classpath)
# ignore - trust build file to get the cp right
# first - concatenate build file cp AFTER build runners cp
# last - concatenate build runners cp AFTER build file cp
#output = build.log
#uncomment this to activate the logging
|