<project name="joda-time" default="jar" basedir=".">
<!-- Joda-time ANT script -->
<!-- Based on scripts from Apache Jakarta Commons and elsewhere -->
<!-- This is the recommended way to build Joda-Time. -->
<!-- Maven is only intended for building the website. -->
<!-- This ant file will download junit-3.8.1.jar to the lib subdirectory -->
<!-- automatically if it does not find it there already. To change this -->
<!-- behaviour, override the junit.jar property in build.properties. -->
<!-- ========== Properties ================================================ -->
<property file="build.properties"/>
<property name="sketch4j" value="/Users/lisahua/projects/jpf/example/workspace/Sketch4J"/>
<!-- ========== Component Declarations ==================================== -->
<!-- The name of this component -->
<property name="component.name" value="joda-time"/>
<!-- The primary package name of this component -->
<property name="component.package" value="org.joda.time"/>
<!-- The title of this component -->
<property name="component.title" value="Joda date and time"/>
<!-- The current version number of this component -->
<property name="component.version" value="2.1"/>
<property name="previous.version" value="2.0"/>
<!-- The current version number of this component -->
<property name="component.fullname" value="${component.name}-${component.version}"/>
<!-- The directory of source files -->
<property name="xdocs" value="xdocs"/>
<!-- Dependencies -->
<property name="lib" value="lib"/>
<property name="junit.jar" value="${lib}/junit-3.8.2.jar"/>
<property name="jodaconvert.jar" value="${lib}/joda-convert-1.2.jar"/>
<property name="jodaprevious.jar" value="${lib}/joda-time-${previous.version}.jar"/>
<!-- The directory of source files -->
<property name="source" value="src"/>
<property name="source.home" value="${source}/main/java"/>
<property name="source.tz" value="${source.home}/org/joda/time/tz/src"/>
<property name="conf.home" value="${source}/conf"/>
<property name="test.home" value="${source}/test/java"/>
<!-- The base directory for example sources -->
<property name="example.home" value="src/example"/>
<!-- The base directory for compilation targets -->
<property name="build" value="build"/>
<property name="build.conf" value="${build}/conf"/>
<property name="build.classes" value="${build}/classes"/>
<property name="build.tz" value="${build.classes}/org/joda/time/tz/data"/>
<property name="build.tests" value="${build}/tests"/>
<property name="build.docs" value="${build}/docs"/>
<property name="build.sources" value="${build}/sources"/>
<property name="build.javadoc" value="${build}/javadoc"/>
<property name="build.dist" value="${build}/dist"/>
<property name="build.fullname" value="${build}/${component.fullname}"/>
<property name="build.dist.fullname" value="${build.dist}/${component.fullname}"/>
<property name="build.dist.src.fullname" value="${build.dist.fullname}-src"/>
<property name="build.dist.bundle" value="${build.dist.fullname}-bundle"/>
<!-- ========== Compiler Defaults ========================================= -->
<!-- Should Java compilations set the 'debug' compiler option? -->
<property name="compile.debug" value="true"/>
<property name="compile.debuglevel" value="lines,source"/>
<!-- 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="${sketch4j}/junit.jar"/> <pathelement location="${sketch4j}/hamcrest-core-1.3.jar"/> <pathelement location="${sketch4j}/Sketch4J.jar"/>
<pathelement location="${build.classes}"/>
<pathelement location="${jodaconvert.jar}"/>
</path>
<!-- ========== Test Execution Defaults =================================== -->
<!-- Construct unit test classpath -->
<path id="test.classpath">
<pathelement location="${sketch4j}/junit.jar"/> <pathelement location="${sketch4j}/hamcrest-core-1.3.jar"/> <pathelement location="${sketch4j}/Sketch4J.jar"/>
<pathelement location="${build.classes}"/>
<pathelement location="${build.tests}"/>
<pathelement location="${junit.jar}"/>
<pathelement location="${jodaconvert.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"/>
<!-- ====================================================================== -->
<!-- ========== Executable Targets ======================================== -->
<!-- ====================================================================== -->
<target name="clean"
description="Clean build and distribution directories">
<delete dir="${build}"/>
</target>
<!-- ====================================================================== -->
<target name="init"
description="Initialize and evaluate conditionals">
<echo message="-------- ${component.name} ${component.version} --------"/>
<filter token="name" value="${component.name}"/>
<filter token="package" value="${component.package}"/>
<filter token="version" value="${component.version}"/>
<available property="junit.ant" classname="junit.framework.Test"/>
<available property="junit.present" file="${junit.jar}"/>
<available property="jodaconvert.present" file="${jodaconvert.jar}"/>
<available property="jodaprevious.present" file="${jodaprevious.jar}"/>
<uptodate property="tz.build.notneeded" targetfile="${build.tz}/ZoneInfoMap" >
<srcfiles dir= "${source.tz}" includes="**/*.*"/>
</uptodate>
</target>
<!-- ====================================================================== -->
<target name="getjunit" unless="junit.present">
<echo message="Getting junit from http://repo2.maven.org/maven2/junit/junit/3.8.2"/>
<setproxy />
<mkdir dir="${lib}"/>
<get dest="${junit.jar}" usetimestamp="true" ignoreerrors="true" src="http://repo2.maven.org/maven2/junit/junit/3.8.2/junit-3.8.2.jar" />
</target>
<target name="getjodaconvert" unless="jodaconvert.present">
<echo message="Getting joda-convert from http://repo2.maven.org/maven2/org/joda/joda-convert/1.2"/>
<setproxy />
<mkdir dir="${lib}"/>
<get dest="${jodaconvert.jar}" usetimestamp="true" ignoreerrors="true" src="http://repo2.maven.org/maven2/org/joda/joda-convert/1.2/joda-convert-1.2.jar" />
</target>
<target name="getjodaprevious" unless="jodaprevious.present">
<echo message="Getting joda-convert from http://repo2.maven.org/maven2/joda-time/joda-time/${previous.version}"/>
<setproxy />
<mkdir dir="${lib}"/>
<get dest="${jodaprevious.jar}" usetimestamp="true" ignoreerrors="true" src="http://repo2.maven.org/maven2/joda-time/joda-time/${previous.version}/joda-time-${previous.version}.jar" />
</target>
<!-- ====================================================================== -->
<target name="installjunit" unless="junit.ant">
<echo message="Installing junit in ${ant.home}/lib"/>
<copy file="${junit.jar}" todir="${ant.home}/lib" />
<echo message="***************************************************************"/>
<echo message="* A copy of junit has been installed in your ant directory *"/>
<echo message="*