<?xml version="1.0"?>
<project name="spring-ws-stock-sample-spring-ws-client" default="build" xmlns:artifact="urn:maven-artifact-ant">
    <property name="bin.dir" value="bin"/>
    <property name="src.dir" value="src"/>

    <target name="init">
        <typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant">
            <classpath>
                <pathelement location="${basedir}/../../../maven-ant-tasks-2.0.7.jar"/>
            </classpath>
        </typedef>

        <artifact:dependencies pathId="classpath">
            <dependency groupId="org.springframework.ws" artifactId="spring-ws-core" version="1.5.3"/>
            <dependency groupId="com.sun.xml.messaging.saaj" artifactId="saaj-impl" version="1.3"/>
            <dependency groupId="log4j" artifactId="log4j" version="1.2.13"/>
        </artifact:dependencies>

    </target>

    <target name="build" depends="init">
        <mkdir dir="${bin.dir}"/>
        <javac srcdir="${src.dir}" destdir="${bin.dir}">
            <classpath refid="classpath"/>
        </javac>
        <copy todir="${bin.dir}">
            <fileset dir="${src.dir}">
                <exclude name="**/*.java"/>
            </fileset>
        </copy>
    </target>

    <target name="clean">
        <delete dir="${bin.dir}"/>
    </target>

    <target name="run" depends="quotes"/>

    <target name="quotes" depends="build">
        <java classname="org.springframework.ws.samples.stockquote.client.sws.StockClient" fork="true"
              failonerror="true">
            <classpath refid="classpath"/>
            <classpath location="${bin.dir}"/>
        </java>
    </target>

</project>
