blob: 4fe0cfe7325fe97f83efbbc09c65fd670bf916a1 [file] [log] [blame]
<project name="Functor" default="test" basedir=".">
<!--
Copyright 2003-2004 The Apache Software Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
Commons-Functor Ant Build File
$Id$
-->
<!-- ========== Initialize Properties ===================================== -->
<property file="build.properties"/> <!-- Component local -->
<property file="../build.properties"/> <!-- Commons (sandbox) local -->
<property file="../../jakarta-commons/build.properties"/> <!-- Commons local -->
<property file="${user.home}/build.properties"/> <!-- User local -->
<!-- ========== External Dependencies ===================================== -->
<!-- The directories corresponding to your necessary dependencies -->
<property name="junit.home" value="/usr/local/junit3.7"/>
<!-- ========== Derived Values ============================================ -->
<!-- The locations of necessary jar files -->
<property name="junit.jar" value="${junit.home}/junit.jar"/>
<!-- ========== Component Declarations ==================================== -->
<!-- The name of this component -->
<property name="component.name" value="functor"/>
<!-- The primary package name of this component -->
<property name="component.package" value="org.apache.commons.functor"/>
<!-- The title of this component -->
<property name="component.title" value="Functor - Function Objects for Java"/>
<!-- The current version number of this component -->
<property name="component.version" value="1.0-dev"/>
<!-- The base directory for compilation targets -->
<property name="build.home" value="target"/>
<!-- The base directory for component configuration files -->
<property name="conf.home" value="src/conf"/>
<!-- The base directory for distribution targets -->
<property name="dist.home" value="dist"/>
<!-- The base directory for component sources -->
<property name="source.home" value="src/java"/>
<!-- The base directory for unit test sources -->
<property name="test.home" value="src/test"/>
<!-- ========== Compiler Defaults ========================================= -->
<!-- Should Java compilations set the 'debug' compiler option? -->
<property name="compile.debug" value="true"/>
<!-- Should Java compilations set the 'deprecation' compiler option? -->
<property name="compile.deprecation" value="false"/>
<!-- Should Java compilations set the 'optimize' compiler option? -->
<property name="compile.optimize" value="true"/>
<!-- Construct compile classpath -->
<path id="compile.classpath">
<pathelement location="${build.home}/classes"/>
<pathelement location="${junit.jar}"/>
</path>
<path id="javadoc.classpath">
<pathelement location="${build.home}/classes"/>
</path>
<!-- ========== Test Execution Defaults =================================== -->
<!-- Construct unit test classpath -->
<path id="test.classpath">
<pathelement location="${build.home}/classes"/>
<pathelement location="${build.home}/test-classes"/>
<pathelement location="${test.home}"/>
<pathelement location="${junit.jar}"/>
</path>
<!-- Should all tests fail if one does? -->
<property name="test.failonerror" value="true"/>
<!-- The test runner to execute -->
<property name="test.runner" value="junit.textui.TestRunner"/>
<property name="test.entry" value="org.apache.commons.functor.TestAll"/>
<!-- ========== Executable Targets ======================================== -->
<target name="init" description="Initialize and evaluate conditionals">
<tstamp/>
<echo message="-------- ${component.name} ${component.version} --------"/>
<filter token="name" value="${component.package}"/>
<filter token="version" value="${component.version}"/>
</target>
<target name="prepare" depends="init" description="Prepare build directory">
<mkdir dir="${build.home}"/>
<mkdir dir="${build.home}/classes"/>
<mkdir dir="${build.home}/conf"/>
<mkdir dir="${build.home}/test-classes"/>
</target>
<target name="static" depends="prepare" description="Copy static files to build directory">
<copy todir="${build.home}/conf" filtering="on">
<fileset dir="${conf.home}" includes="*.MF"/>
</copy>
</target>
<target name="compile" depends="static" description="Compile shareable components">
<javac srcdir="${source.home}"
destdir="${build.home}/classes"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
optimize="${compile.optimize}">
<classpath refid="compile.classpath"/>
</javac>
</target>
<target name="compile.tests" depends="compile"
description="Compile unit test cases">
<javac srcdir="${test.home}"
destdir="${build.home}/test-classes"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
optimize="${compile.optimize}">
<classpath refid="test.classpath"/>
</javac>
</target>
<target name="clean" description="Clean build and distribution directories">
<delete dir="${build.home}"/>
<delete dir="${dist.home}"/>
</target>
<target name="javadoc" depends="prepare" description="Create component Javadoc documentation">
<mkdir dir="${dist.home}"/>
<mkdir dir="${dist.home}/docs"/>
<mkdir dir="${dist.home}/docs/api"/>
<javadoc destdir="${dist.home}/docs/api"
sourcepath="${source.home}"
packagenames="org.apache.commons.*"
author="false"
private="true"
version="true"
doctitle="&lt;h1&gt;${component.title} (Version ${component.version})&lt;/h1&gt;"
windowtitle="${component.title} (Version ${component.version})"
bottom="Copyright (c) 2003 - Apache Software Foundation. Generated ${TODAY}.">
<classpath refid="javadoc.classpath"/>
</javadoc>
</target>
<target name="dist" depends="test,javadoc" description="Create binary distribution">
<mkdir dir="${dist.home}"/>
<copy file="LICENSE.txt"
todir="${dist.home}"/>
<mkdir dir="${build.home}/classes/META-INF"/>
<copy file="LICENSE.txt"
tofile="${build.home}/classes/META-INF/LICENSE.txt"/>
<jar jarfile="${dist.home}/commons-${component.name}.jar"
basedir="${build.home}/classes"/>
</target>
<!-- ========== Unit Test Targets ========================================= -->
<target name="test" depends="compile.tests">
<java classname="${test.runner}" fork="yes" failonerror="${test.failonerror}">
<arg value="${test.entry}"/>
<classpath refid="test.classpath"/>
</java>
</target>
<!-- ========== Gump Targets ============================================== -->
<target name="gump" depends="clean,test,dist"/>
</project>