-<!-- PROPERTIES -->
-
-<target name="echoUserPropertiesFileFound" if="user.properties.found">
- <echo>Using properties file ${user.property.file}</echo>
-</target>
-
-<target name="echoUserPropertiesFileNotFound" unless="user.properties.found">
- <echo>Properties file ${user.property.file} not found, reverting to defaults</echo>
-</target>
-
-
-<property name="project.home" value=".."/>
-<property name="build.dir" value="${project.home}/build"/>
-<property name="lib.dir" value="${project.home}/lib"/>
-<property environment="env"/>
-
-<target name="download.dep">
- <if>
- <isset property="proxyhost"/>
- <then>
- <setproxy proxyhost="${proxyhost}" proxyport="${proxyport}"/>
- </then>
- </if>
- <if>
- <isset property="artifact"/>
- <then>
- <echo>Getting dependence ${group}/${artifact}/${version}</echo>
- <dependencies verbose="true" fileSetId="my.deps">
- <dependency group="${group}" artifact="${artifact}" version="${version}"/>
- </dependencies>
- <copy todir="${download.dir}" flatten="yes">
- <fileset refid="my.deps"/>
- </copy>
- </then>
- <else>
- <echo>Getting dependence ${group}/${version}</echo>
- <dependencies verbose="true" fileSetId="my.deps">
- <dependency group="${group}" version="${version}"/>
- </dependencies>
- <copy todir="${download.dir}" flatten="yes">
- <fileset refid="my.deps"/>
- </copy>
- </else>
- </if>
-</target>
-
-<!-- LOG4j -->
-<target name="log4j.d">
- <antcall target="download.dep">
- <param name="group" value="log4j"/>
- <param name="version" value="1.2.9"/>
- </antcall>
-</target>
-
-<target name="commons-beanutils.d">
- <antcall target="download.dep">
- <param name="group" value="commons-beanutils"/>
- <param name="version" value="1.7.0"/>
- </antcall>
-</target>
-
-<target name="commons-collections.d">
- <antcall target="download.dep">
- <param name="group" value="commons-collections"/>
- <param name="version" value="3.1"/>
- </antcall>
-</target>
-
-
-<target name="commons-logging.d">
- <antcall target="download.dep">
- <param name="group" value="commons-logging"/>
- <param name="artifact" value="commons-logging"/>
- <param name="version" value="1.0.2"/>
- </antcall>
-</target>
-
-<target name="commons-codec.d">
- <antcall target="download.dep">
- <param name="group" value="commons-codec"/>
- <param name="version" value="1.3"/>
- </antcall>
-</target>
-
-<target name="commons-email.d">
- <antcall target="download.dep">
- <param name="group" value="commons-email"/>
- <param name="version" value="1.0"/>
- </antcall>
-</target>
-
-<target name="servletapi.d">
- <antcall target="download.dep">
- <param name="group" value="servletapi"/>
- <param name="version" value="2.4"/>
- </antcall>
-</target>
-
-<target name="jstl.d">
- <antcall target="download.dep">
- <param name="group" value="jstl"/>
- <param name="version" value="1.1.2"/>
- </antcall>
- <antcall target="download.dep">
- <param name="group" value="taglibs"/>
- <param name="artifact" value="standard"/>
- <param name="version" value="1.1.2"/>
- </antcall>
-</target>
-
-
-
-<target name="quartz.d">
- <antcall target="download.dep">
- <param name="group" value="quartz"/>
- <param name="version" value="1.5.1"/>
- </antcall>
-</target>
-
-
-
-<target name="logging.d" depends="log4j.d,commons-logging.d">
-</target>
-
-<target name="dom4j.d">
- <antcall target="download.dep">
- <param name="group" value="dom4j"/>
- <param name="version" value="1.6"/>
- </antcall>
- <antcall target="download.dep">
- <param name="group" value="jaxen"/>
- <param name="version" value="1.1-beta-4"/>
- </antcall>
-</target>
-
-<target name="jfreechart.d">
- <copy todir="${download.dir}">
- <fileset dir="${special.lib.dir}/jfreechart-1.0.1">
- <include name="*.jar"/>
- </fileset>
- </copy>
-</target>
-
-<target name="ehcache.d">
- <antcall target="download.dep">
- <param name="group" value="ehcache"/>
- <param name="version" value="1.1"/>
- </antcall>
-</target>
-
-<target name="xerces.d">
- <antcall target="download.dep">
- <param name="group" value="xerces"/>
- <param name="version" value="2.4.0"/>
- </antcall>
-</target>
-
-<target name="oro.d">
- <antcall target="download.dep">
- <param name="group" value="oro"/>
- <param name="version" value="2.0.6"/>
- </antcall>
-</target>
-
-<target name="cglib.d">
- <antcall target="download.dep">
- <param name="group" value="cglib"/>
- <param name="version" value="2.1"/>
- </antcall>
-</target>
-
-<target name="hibernate.d" depends="cglib.d,oro.d">
- <antcall target="download.dep">
- <param name="group" value="hibernate"/>
- <param name="version" value="3.0.5"/>
- </antcall>
-</target>
-
-<target name="hibernate.standalone.d" depends="hibernate.d">
- <copy todir="${download.dir}">
- <fileset dir="${special.lib.dir}/hibernate">
- <include name="*.jar"/>
- </fileset>
- </copy>
-</target>
-
-<target name="spring.d">
- <antcall target="download.dep">
- <param name="group" value="springframework"/>
- <param name="artifact" value="spring"/>
- <param name="version" value="1.2.5"/>
- </antcall>
-</target>
-
-<target name="activation.d">
- <copy todir="${download.dir}">
- <fileset dir="${special.lib.dir}/jaf-1.0.2">
- <include name="*.jar"/>
- </fileset>
- </copy>
-</target>
-
-<target name="mail.d" depends="activation.d">
- <copy todir="${download.dir}">
- <fileset dir="${special.lib.dir}/javamail-1.3.3_01">
- <include name="*.jar"/>
- </fileset>
- </copy>
-</target>
-
-
-
-<target name="httpclient.d">
- <antcall target="download.dep">
- <param name="group" value="commons-httpclient"/>
- <param name="version" value="3.0"/>
- </antcall>
-</target>
-
-<target name="jtidy.d">
- <antcall target="download.dep">
- <param name="group" value="jtidy"/>
- <param name="version" value="4aug2000r7-dev"/>
- </antcall>
-</target>
-
-<property name="support.dist.dir" value="${lib.dir}/wamblee/support"/>
-<target name="wamblee.support.d">
- <copy todir="${download.dir}">
- <fileset dir="${support.dist.dir}">
- <include name="wamblee-support.jar"/>
- </fileset>
- </copy>
-</target>
-<target name="wamblee.support.test.d">
- <copy todir="${download.dir}">
- <fileset dir="${support.dist.dir}">
- <include name="wamblee-support-test.jar"/>
- </fileset>
- </copy>
-</target>
-
-
-<target name="junit.d">
- <antcall target="download.dep">
- <param name="group" value="junit"/>
- <param name="version" value="3.8.1"/>
- </antcall>
- <copy todir="${download.dir}">
- <fileset dir="${special.lib.dir}/test">
- <include name="*.jar"/>
- </fileset>
- </copy>
-</target>
-
-<target name="emma.d">
- <antcall target="download.dep">
- <param name="group" value="emma"/>
- <param name="artifact" value="emma"/>
- <param name="version" value="2.0.5312"/>
- </antcall>
- <antcall target="download.dep">
- <param name="group" value="emma"/>
- <param name="artifact" value="emma_ant"/>
- <param name="version" value="2.0.5312"/>
- </antcall>
-</target>
-
-<target name="jmock.d">
- <antcall target="download.dep">
- <param name="group" value="jmock"/>
- <param name="artifact" value="jmock"/>
- <param name="version" value="1.0.1"/>
- </antcall>
- <antcall target="download.dep">
- <param name="group" value="jmock"/>
- <param name="artifact" value="jmock-cglib"/>
- <param name="version" value="1.0.1"/>
- </antcall>
-</target>
-
-<target name="dbunit.d">
- <antcall target="download.dep">
- <param name="group" value="dbunit"/>
- <param name="version" value="2.1"/>
- </antcall>
-</target>
-
-
-<target name="antlr.d">
- <antcall target="download.dep">
- <param name="group" value="antlr"/>
- <param name="version" value="2.7.2"/>
- </antcall>
-</target>
-
-<target name="checkstyle.d" depends="antlr.d,commons-beanutils.d,commons-logging.d,commons-collections.d">
- <antcall target="download.dep">
- <param name="group" value="checkstyle"/>
- <param name="version" value="4.1"/>
- </antcall>
-</target>
-
-<!-- common test dependencies for all test code -->
-<target name="test.d" depends="junit.d,jmock.d,dbunit.d,emma.d">
-</target>
-
-<!-- downloaded dependencies for ant tasks -->
-<target name="ant.d" depends="checkstyle.d">
-</target>
-
-
-
- <target name="import_header" unless="build_header_included">
-
- <property name="ant.lib.dir" value="${build.dir}/lib/ant"/>
- <property name="test.lib.dir" value="lib/test"/>
- <property name="special.lib.dir" value="${build.dir}/lib/special"/>
- <property name="ant.downloaded.lib.dir" value="${build.dir}/lib/ant/downloaded"/>
-
-
- <!-- ========================================================================================
- Ant task defs
- ======================================================================================== -->
-
- <!-- ant-contrib integration -->
- <property name="ant.contrib.home" value="${ant.lib.dir}/ant-contrib-1.0b2"/>
- <taskdef resource="net/sf/antcontrib/antlib.xml">
- <classpath>
- <pathelement location="${ant.contrib.home}/ant-contrib.jar" />
- </classpath>
- </taskdef>
-
- <!-- taskdef for ant-dependencies task -->
- <taskdef name="dependencies" classpath="${ant.lib.dir}/ant-dependencies.jar"
- classname="org.apache.tools.ant.taskdefs.optional.dependencies.Dependencies"/>
-
- <!-- Emma integration -->
- <if>
- <available file="${test.lib.dir}"/>
- <then>
- <path id="emma.lib">
- <fileset dir="${test.lib.dir}" includes="emma*.jar"/>
- </path>
- <taskdef resource="emma_ant.properties" classpathref="emma.lib" />
- <property name="emma.enabled" value="false"/>
- </then>
- </if>
-
- <!-- checkstyle -->
- <property name="checkstyle.home" value="${ant.downloaded.lib.dir}"/>
- <taskdef resource="checkstyletask.properties">
- <classpath>
- <fileset dir="${checkstyle.home}">
- <include name="*.jar"/>
- </fileset>
- </classpath>
- </taskdef>
- <property name="checkstyle.rules" value="style.xml"/>
- <property name="checkstyle.test.rules" value="test-style.xml"/>
-
-
- <!-- jalopy -->
- <!-- TMP download this dependence as well
- <property name="jalopy.home" value="${lib.dir}/jalopy-ant-0.6.2"/>
- <property name="jalopy.rules" value="${build.dir}/formatting-rules.xml"/>
- <taskdef name="jalopy"
- classname="de.hunsicker.jalopy.plugin.ant.AntPlugin">
- <classpath>
- <fileset dir="${jalopy.home}">
- <include name="*.jar" />
- </fileset>
- </classpath>
- </taskdef>
- -->
-
- <!-- simian integration -->
- <!-- TMP download this dependence as well
- <property name="simian.home" value="${lib.dir}/simian"/>
- <taskdef resource="simiantask.properties" classpath="${simian.home}/simian.jar"/>
- -->
-
- <!-- macker integration -->
- <!-- TMP download this dependence as well
- <property name="macker.home" value="${lib.dir}/macker-0.4.2"/>
- <path id="macker.path">
- <fileset dir="${macker.home}">
- <include name="**/*.jar"/>
- </fileset>
- </path>
- <taskdef name="macker"
- classname="net.innig.macker.ant.MackerAntTask"
- classpathref="macker.path"/>
-
- -->
-
- <!-- ========================================================================================
- Locate user properties to (optionally) override defaults
- ======================================================================================== -->
-
- <!--
- Give user a chance to override without editing this file
- (and without typing -D each time they run it).
-
- The following properties must be defined in this file:
- - jcoverage.home: root of the jcoverage installation.
- - jalopy.home: root of the jalopy installation.
- -->
- <property name="user.property.file" value="${user.home}/wamblee.properties"/>
- <available file="${user.property.file}" property="user.properties.found"/>
- <property file="${user.property.file}"/>
-
- <antcall target="echoUserPropertiesFileFound"/>
- <antcall target="echoUserPropertiesFileNotFound"/>
-
- <!-- project properties defaults, can be overriden in the user's properties file -->
-
- <!-- The project.home property can also be overriden in a build.xml
- in case the source is in a subdirectory and not necessarily
- in the top-level directory -->
-
-
- <if>
- <isset property="webroot.dir"/>
- <then>
- <property name="external.lib.dir" value="${webroot.dir}/WEB-INF/lib"/>
- </then>
- <else>
- <property name="external.lib.dir" value="lib/external"/>
- </else>
- </if>
-
- <property name="build.properties.dir" value="${project.home}" />
- <property name="build.properties.name" value="build.properties" />
-
- <mkdir dir="${external.lib.dir}"/>
- <mkdir dir="${test.lib.dir}"/>
-
- <property name="conf.dir" value="conf"/>
- <property name="log4j.properties.dir" value="${conf.dir}/properties"/>
-
- <!-- Compilation properties -->
- <property name="javac.debug" value="true"/>
- <property name="javac.debug.level" value="lines,vars,source"/>
- <property name="javac.source" value="1.5"/>
-
- <!-- ========================================================================================
- Standard path definitions to be used with all projects
- ======================================================================================= -->
- <property name="xmlschemas.dir" value="${conf.dir}/schemas"/>
- <path id="xmlschemas.path">
- <pathelement location="${xmlschemas.dir}"/>
- </path>
-
- <!-- ========================================================================================
- Path definitions for external libraries.
- ======================================================================================== -->
-
- <!-- Ignore system classpath! -->
- <property name="build.sysclasspath" value="ignore" />
-
- <!-- JUnit -->
- <property name="junit.halt.on.failure" value="false"/>
- <property name="unitreport" value="cl-unit.xml"/>
-
- <!-- DocCheck path -->
- <property name="doccheck.home" value="${ant.lib.dir}/doccheck1.2b2/doccheck.jar"/>
- <path id="doccheck.path">
- <pathelement location="${doccheck.home}"/>
- </path>
-
- <!-- PdfDoclet path -->
- <property name="pdfdoclet.home" value="${ant.lib.dir}/pdfdoclet-1.0.2-all.jar"/>
- <path id="pdfdoclet.path">
- <pathelement location="${pdfdoclet.home}"/>
- </path>
-
- <!-- Hibernate paths -->
- <!-- name of the file in the source directory containing
- the names of hibernate files to look at in the correct order -->
- <property name="hibernate.home" value="${lib.dir}/hibernate-3.0"/>
- <path id="hibernate.basic.path">
- <fileset dir="${hibernate.home}">
- <include name="*.jar"/>
- </fileset>
- <path refid="xerces.path"/>
- <path refid="dom4j.path"/>
- </path>
- <path id="hibernate.appserver.path">
- <path refid="hibernate.basic.path"/>
- <fileset dir="${hibernate.home}/appserver">
- <include name="*.jar"/>
- </fileset>
- </path>
- <path id="hibernate.standalone.path">
- <path refid="hibernate.basic.path"/>
- <fileset dir="${hibernate.home}/standalone">
- <include name="*.jar"/>
- </fileset>
- </path>
-
- <!-- Commented the inclusion of a system-wide path in the user's environment into a
- classpath. System wide classpaths should not be used. -->
- <!-- property name="classpath_id" value="build.path" / -->
- <!-- property name="classpath" refid="${classpath_id}"/ -->
- <property name="classpath" value=""/>
-
-
- <!-- ========================================================================================
- Database settings
- ======================================================================================== -->
- <property name="database" value="Derby"/>
-
-
-
- <!-- ========================================================================================
- Information
- ======================================================================================== -->
- <echo level="debug" message="project.home=${project.home}"/>
- <echo level="debug" message="project.libs=${project.libs}"/>
- <echo level="debug" message="classpath=${classpath}"/>
-
-
- <!-- ========================================================================================
- Included marker
- ======================================================================================== -->
- <property name="build_header_included" value="true" />
-</target>
-
-<!-- =================================================================
- Sets up the directory definitions for the module
- ================================================================= -->
-<target name="init_directory_properties" depends="import_header">
- <!-- Set module properties for this build -->
-
- <property name="module.home" value="." />
-
- <!-- Replace the dash by a / to create a relative directory
- from a module name -->
- <propertyregex property="module.reldir"
- input="${module.name}"
- regexp="-"
- replace="/"
- global="true"
- defaultValue="${module.name}"/>
- <!-- property name="module.build.dir"
- value="${build.dir}/${module.reldir}" / -->
- <property name="module.build.dir" value="build"/>
- <property name="module.api.forrest.dir" value="${forrest.build.site.dir}/api/${module.name}" />
- <if>
- <isset property="webroot.dir"/>
- <then>
- <property name="module.classes.dir" value="${webroot.dir}/WEB-INF/classes" />
- </then>
- <else>
- <property name="module.classes.dir" value="${module.build.dir}/bin" />
- </else>
- </if>
-
- <property name="module.testclasses.dir" value="${module.build.dir}/testbin" />
- <!-- Directory where generated SQL will be put by the schema export-->
- <property name="module.sql.dir" value="${module.build.dir}/sql" />
-
-
- <property name="module.jcovclasses.dir"
- value="${module.build.dir}/testjcov" />
- <property name="module.jars.dir" value="${module.build.dir}/jars" />
- <property name="module.jar.file"
- value="${module.jars.dir}/${module.jar.name}" />
- <property name="module.source.dir" value="${module.home}/src" />
- <property name="module.forrest.src.dir" value="${module.home}/xdocs" />
- <property name="module.ejbsource.dir" value="${module.home}/ejbsrc" />
- <property name="module.test.dir" value="${module.home}/test" />
- <property name="module.testjar.name"
- value="${module.name}-test.jar" />
- <property name="module.testresourcesjar.name"
- value="${module.name}-test-resources.jar" />
- <property name="module.resource.dir"
- value="${module.home}/resources" />
- <property name="module.testresource.dir"
- value="${module.resource.dir}/test" />
- <property name="module.testoutput.dir"
- value="${module.resource.dir}/testoutput"/>
- <property name="module.report.dir"
- value="${module.build.dir}/testresults" />
- <property name="module.emmareport.dir"
- value="${module.report.dir}/html/emma"/>
- <property name="module.docbase.dir"
- value="${module.build.dir}/docs" />
- <property name="module.javadoc.dir"
- value="${module.docbase.dir}/api" />
- <property name="module.javadocjar.name"
- value="${module.name}-doc.jar" />
- <property name="module.testjavadocjar.name"
- value="${module.name}-test-doc.jar" />
- <property name="module.testjavadoc.dir"
- value="${module.docbase.dir}/testapi" />
- <property name="module.pdfdoc.dir"
- value="${module.docbase.dir}/pdf" />
- <property name="module.doccheck.dir"
- value="${module.docbase.dir}/doccheck" />
- <property name="module.checkstyle.dir"
- value="${module.docbase.dir}/checkstyle" />
- <property name="module.jar.name" value="${module.name}.jar" />
-
- <!-- Replace the dash by a / to create a relative directory
- from a module name -->
- <property name="module.dist.dir" value="${lib.dir}/${module.reldir}" />
-</target>
-
-<!-- ============================================================================
- Initialize the environment for other tasks. Normally, every task which
- does not depend on any other task should at least depend on init.
- ============================================================================ -->
-
- <target name="help" depends="import_header">
- <antcall target="help-within-module"/>
- <antcall target="help-outside-module"/>
- </target>
-
- <target name="help-within-module" depends="init_directory_properties" if="module.name">
- <antcall target="help-impl"/>
- </target>
-
- <target name="help-outside-module" unless="module.name">
- <antcall target="help-outside-module-2">
- <param name="module.name" value="MODULE_NAME"/>
- </antcall>
- </target>
-
- <target name="help-outside-module-2" depends="init_directory_properties">
- <antcall target="help-impl"/>
- </target>
-
-
- <target name="help-impl">
- <echo>
-
- Preparation:
-
- To execute with a specific proxy host and port, start ant with the
- command-line options -Dproxyhost=hostname -Dproxyport=portnumber.
-
- deps: Download dependencies, this is necessary for using
- any of the build targets.
- clean-deps: Remove downloaded dependencies.
-
- General build targets:
-
- clean: Cleans up all build results (excluding the dist location).
- compile: Compiles all java clasess. Target dir ${module.classes.dir}
- jar: Creates a jar file. Target: ${module.jar.file}
- dist: Makes the build results available for other modules Target: ${module.dist.dir}.
- dist-lite: Similar to dist but only creates the jars for code and test code. Useful
- during development because it takes much less time than the dist
- target
- clean-dist: Cleans up the dist directories.
-
- Test:
-
- test: Compile and run tests.
- junit-reports: As test but generates a test report. Target: ${module.report.dir}(/html/unit)
- reports: As junit-reports but also generates an emma test coverage
- report
-
- Note: By specifying -Dtest=TestCaseName on the ant command line,
- only the specified testcase will be run.
-
- Emma can also be executed manually:
-
- emma: Overwrites the production classes by their instrumented versions.
- emma-reports: Generates emma code coverage reports after running the
- testcases with instrumented classes.
-
- Javadoc targets:
-
- javadoc: Generates javadoc. Target: ${module.javadoc.dir}
- doccheck: Checks documentation. Target: ${module.doccheck.dir}
-
- Forrest:
-
- forrest: Generates project docs using forrest.
-
- Code analysis:
-
- checkstyle: Checks the style of the code.
- format: Formats to the code in accordance with the checkstyle rules.
- simian: Analyse similarities in the code.
-
- Building a web application:
-
- To build a web application archive (WAR) you must set the property
- webroot.dir to the value of the directory which is the root of your
- web application. This must be done before the header.xl is
- sourced. The build support will then make sure that
- classes and libs are put in the correct directories below
- ${webroot.dir}/WEB-INF, and it will build a web archive.
-
- Database targets: ** database targets are not functional yet **
-
- For all targets below the database is configured using
- hibernate.properties (hibernate.dialect property) and
- the JDBC connection properties in database.properties.
-
- The schemaexport and schemaupdate targets require the
- setting of a property named hibernate.filelist. The value
- of the property must be the fully qualified class name of
- a concrete subclass of ConfigFileList which has a default
- public constructor and defines the Hibernate mapping files that
- can be used.
-
- schemaexport: Generate SQL code to create the required database structures.
-
- startdb: Startup a lightweight database. The database
- type to start is obtained from the currently
- configured database.
-
- schemaupdate: Populate the database with a schema by running
- Hibernate schemaupdate against the currently
- configured database.
- </echo>
- </target>
-
-