<?xml version="1.0"?>

<project name="stax-api" basedir="." default="jar">

	<!-- Properties -->
	<property name="name" value="${ant.project.name}"/>
	<property name="srcdir" value="${basedir}/src"/>	
	<property name="metadir" value="${basedir}/META-INF"/>	
	<property name="builddir" value="${basedir}/build/classes"/>
	<property name="distdir" value="${basedir}/dist"/>
	<property name="jarname" value="${name}.jar"/>
	
	<target name="prepare" description="Prepare for action">
		<mkdir dir="${builddir}"/>
		<mkdir dir="${distdir}"/>
	</target>
	
    <target name="build" depends="prepare" description="Compile main source tree java files">
		<javac	srcdir="${srcdir}"
				destdir="${builddir}"
				debug="true"
               	deprecation="false"
               	optimize="false"
               	failonerror="true">
		</javac>
		
		<copy todir="${builddir}">
			<fileset dir="${metadir}"/>
		</copy>
    </target>

    <target name="jar" depends="build" description="Build Jar file">
        <jar destfile="${distdir}/${jarname}">
            <fileset dir="${builddir}">
                <include name="**/*.*"/>
            </fileset>
            <fileset dir="${metadir}">
                <include name="**/*.*"/>
            </fileset>
        </jar>
    </target>

    <target name="clean" description="Clean output directories">
        <delete dir="${distdir}"/>
    </target>
		
</project>
