<project name="PostGIS" default="dist" basedir=".">
    <property name="build.dir" value="bin"/>
    <property name="lib.dir" value="lib"/>
    <property name="src.jdbc.dir" value="jdbc/src"/>
    <property name="src.jdbc.stubs" value="jdbc/stubs"/>
    <property name="dist.dir" value="dist"/>

    <path id="class.path">
        <pathelement location="${build.dir}"/>
        <fileset dir="${lib.dir}" includes="*.jar"/>
    </path>

    <target name="clean" description="Removes all generated files">
        <delete dir="${build.dir}"/>
        <delete dir="${dist.dir}"/>
    </target>

    <target name="compile">
        <mkdir dir="${build.dir}"/>
        <javac destdir="${build.dir}" fork="true" classpathref="class.path" source="1.5" target="1.5">
            <src path="${src.jdbc.dir}"/>
            <src path="${src.jdbc.stubs}"/>
            <exclude name="examples/**"/>
            <exclude name="**/ejb/**"/>
        </javac>
        <copy todir="${build.dir}">
            <fileset dir="${src.jdbc.dir}" includes="**/*.properties"/>
        </copy>
    </target>
    
    <target name="dist" depends="clean, compile">
        <mkdir dir="${dist.dir}"/>
        <jar destfile="${dist.dir}/postgis.jar" basedir="${build.dir}" excludes="org/postgresql/*"/>
    </target>
</project>
