<?xml version="1.0" ?><project name="Game">
    <!-- Set up the game environment by preparing the natives. -->
    <target name="setup" depends="check-setup" unless="setup.exists">
        <mkdir dir="lib/natives" />
        <unzip src="lib/natives-win32.jar" dest="lib/natives" />
        <unzip src="lib/natives-mac.jar" dest="lib/natives" />
        <unzip src="lib/natives-linux.jar" dest="lib/natives" />
    </target>

    <!-- Determines whether setup has been run. -->
    <target name="check-setup">
        <condition property="setup.exists">
            <available file="lib/natives" type="dir" />
        </condition>
    </target>

    <!-- Compile and archive the game. -->
    <target name="build">
        <antcall target="compile" />
        <antcall target="archive" />
    </target>
    
    <!-- Compile the code put results into bin. -->
    <target name="compile">
        <mkdir dir="bin" />
        <javac destdir="bin" debug="on">
            <src path="bin" />
            <classpath>
                <!-- Assumes Slick is in your lib dir! -->
                <pathelement path="lib/slick.jar" />
            </classpath>
        </javac>
    </target>

    <!-- Jar compiled code and place result into current dir. -->
    <target name="archive">
        <jar destfile="./game.jar" manifest="manifest.txt">
            <fileset dir="bin" />
            <fileset dir="res" />
        </jar>
    </target>

    <!-- Run the game. -->
    <target name="run" depends="setup,build">
        <java jar="./game.jar" fork="true" failonerror="true">
            <jvmarg value="-Djava.library.path=lib/natives" />
        </java>
    </target>
</project>
