<?xml version="1.0"?>

<!-- ================================================================ -->
<!--                                                                  -->
<!-- Execute Query Ant build script                                   -->
<!-- Date:  17 September 2006                                         -->
<!-- Build: 5053                                                      -->
<!--                                                                  -->
<!-- ================================================================ -->

<project name="ExecuteQuery" default="make" basedir=".">

	<property name="compile.outdir" value="classes" />
	<property name="src.path" value="src" />
	<property name="dist.outdir" value="build" />
	<property name="lib.dir" value="${dist.outdir}/lib" />
	<property name="docs.dir" value="${dist.outdir}/docs" />
	<property name="main.class" value="org.executequery.ExecuteQuery" />

	<path id="classpath">
		<pathelement location="${lib.dir}" />
		<fileset dir="${lib.dir}">
			<include name="*.jar" />
		</fileset>
	</path>

	<path id="srcpath">
		<pathelement location="${src.path}/java" />
	</path>

	<target name="init" description="Create required directories">
		<tstamp />
		<mkdir dir="${compile.outdir}" />
		<mkdir dir="${dist.outdir}" />

		<copy todir="${compile.outdir}">
			<fileset dir="${src.path}/java" excludes="**/*.java" />
		</copy>

		<copy todir="${dist.outdir}">
			<fileset dir="${src.path}" excludes="java/" />
		</copy>

	</target>

	<target name="compile" depends="init">

		<javac destdir="${compile.outdir}" debug="on">
			<classpath refid="classpath" />
			<src refid="srcpath" />
			<include name="org/**" />
		</javac>

	</target>

	<target name="make" depends="jar">
	</target>

	<target name="jar" depends="compile" description="generate the jar file">
		
        <manifestclasspath property="manifest.classpath"
                           jarfile="${dist.outdir}/eq.jar">
            <classpath refid="classpath" />
        </manifestclasspath>

        <jar jarfile="${dist.outdir}/eq.jar" 
            basedir="${compile.outdir}"
            compress="false" includes="org/**">

            <manifest>
                <attribute name="Main-Class" value="${main.class}" />
            	<attribute name="Class-Path" value="${manifest.classpath} docs/eqhelp.jar" />
            </manifest>

        </jar>

	</target>

    <target name="clean">
        <delete dir="${dist.dir}" quiet="true"/>
        <delete dir="${compile.outdir}" quiet="true"/>
    </target>

	<target name="all" depends="compile,jar" />

</project>
