<target name="common:init"
depends="common:read_params,
common:prepare,
common:resources" />
<target name="common:read_params">
<property file="build.properties"/>
<path id="run_classpath">
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
<pathelement path="${build.classes.dir}" />
</path>
<taskdef name="annotationc" classname="org.jboss.aop.ant.AnnotationC"
classpathref="run_classpath"/>
<taskdef name="aopc" classname="org.jboss.aop.ant.AopC"
classpathref="run_classpath" />
<available property="junit.present" classname="junit.framework.TestCase" />
</target>
<target name="junit-check">
<echo>
Every target using JUnit tests REQUIRES `junit.jar' in your ANT_HOME/lib
directory.
This script will try to automatically handle the problem.
If it fails, copy `junit.jar' into your ANT_HOME/lib.
If it fails all the time you're probably running inside IDE. Check docs how
to solve problem with Eclipse, IDEA (problems.html).
</echo>
<antcall target="junit-check-copy" />
</target>
<target name="junit-check-copy" depends="common:read_params"
unless="junit.present" if="ant.home">
<copy todir="${ant.home}/lib" file="${lib.dir}/junit.jar" />
<fail message="It's OK to fail Ant 1st time.." />
</target>
<target name="common:prepare" depends="common:read_params">
<mkdir dir="${build.dir}" />
<mkdir dir="${build.classes.dir}" />
<mkdir dir="${repository.dir}/tests" />
<mkdir dir="${repository.dir}/demo" />
<mkdir dir="${repository.dir}/skeleton-app" />
<mkdir dir="${repository.dir}/performance" />
<tstamp/>
</target>
<target name="common:resources" depends="common:read_params">
<copy todir="${build.classes.dir}" includeEmptyDirs="no">
<fileset dir="${etc.dir}">
<patternset>
<include name="*.properties" />
<include name="*.xml" />
</patternset>
</fileset>
</copy>
</target>
<target name="clean" depends="common:read_params"
description="Cleans ${build.classes.dir}">
<delete dir="${build.classes.dir}" />
<delete dir="${dist.dir}" />
</target>