<project name="Waba GRX" default="build" basedir=".">
    <!-- Targets -->
    <target name="init">
        <tstamp/>
    </target>

    <target name="clean" depends="init">
        <delete file="c/waba"/>
        <delete file="c/waba.exe"/>
        <delete dir="output"/>
        <delete>
            <fileset
                dir="../.."
                includes="*.zip"
             />
        </delete>
    </target>

    <target name="exe" depends="init">
        <exec
            dir="c"
            executable="cmd.exe"
        >
            <arg line="/c build.bat"/>
        </exec>
        <copy
            file="c/waba.exe"
            todir="output/bin"
            overwrite="yes"
         />
    </target>

    <target name="wrp" depends="init">
        <delete dir="output/classes"/>
        <mkdir dir="output/classes"/>
        <javac
            destdir="output/classes"
            debug="off"
            deprecation="off"
        >
            <src path="java/src"/>
            <exclude name="java/**"/>
        </javac>
        <move
            todir="output/classes/waba/lang"
        >
            <fileset dir="output/classes/java/lang"/>
        </move>
        <delete dir="output/classes/java"/>
        <exec
            dir="java"
            executable="cmd.exe"
        >
            <arg line="/c wrp.bat"/>
        </exec>
        <copy
            file="output/classes/waba.wrp"
            todir="output/bin"
            overwrite="yes"
         />
    </target>

    <target name="deploy" depends="init">
        <copy
            todir="../bin"
        >
            <fileset dir="output/bin"/>
            <fileset dir="../dpmi">
                <include name="*.EXE"/>
            </fileset>
        </copy>
    </target>

    <target name="build" depends="clean, exe, wrp" />

    <target name="zips" depends="clean">
        <zip
            zipfile="../../doswaba.zip"
        >
            <zipfileset dir="../..">
                <exclude name="waba/devl/**"/>
                <exclude name="waba/dpmi/**"/>
                <exclude name="*.zip"/>
            </zipfileset>
        </zip>
        <zip
            zipfile="../../doswabad.zip"
        >
            <zipfileset dir="../..">
                <exclude name="*.zip"/>
            </zipfileset>
        </zip>
    </target>

    <target name="all" depends="build, deploy">
        <antcall target="clean"/>
        <antcall target="zips"/>
    </target>
</project>
