<!--
    Build file for the BFG Sound Engine.

    @author Steven N. Severinghaus
-->
<project name="BFG Sound Engine" default="build">

    <!-- Load global properties (file locations, etc.). -->
    <property file="build.properties"/>

    <!-- Run the graphical event and music simulator. Note that you will not
         get any debugging output if you use this target, since the spawned
         VM's stdout won't be attached to anything. -->
    <target name="simulate" depends="build">
        <java classname="edu.uiuc.cs397rhc.game.Simulator"
            fork="true" spawn="true">
            <classpath>
                <pathelement path="${classpath}"/>
                <pathelement path="${dest.path}"/>
                <fileset dir="${sound.path}/lib">
                    <include name="**/*.jar"/>
                </fileset>
            </classpath>
            <!-- Assertions won't show up anyway.
            <assertions><enable/></assertions>
            -->
        </java>
    </target>

    <!-- Compile the source. -->
    <target name="build" depends="init">
        <javac
            srcdir="${src.path}"
            destdir="${dest.path}"
            debug="true"
            source="1.5">
            <compilerarg value="-Xlint:unchecked"/>
        </javac>
    </target>

    <!-- Initialize build location. -->
    <target name="init">
        <mkdir dir="${dest.path}"/>
    </target>

    <!-- Do a clean build. There's probably a better way to do this. -->
    <target name="clean">
        <delete dir="${dest.path}"/>
        <antcall target="build"/>
    </target>

    <!-- Generate javadoc documentation. -->
    <target name="javadoc">
        <mkdir dir="${javadoc.path}"/>
        <javadoc
            sourcepath="${src.path}"
            destdir="${javadoc.path}"
            packagenames="edu.uiuc.cs397rhc.*"
            source="1.5"
            overview="${sound.path}/misc/overview.html"
            use="true"
            author="true"
            stylesheetfile="${sound.path}/misc/javadoc.css"
            linksource="true">
            <bottom><![CDATA[<div id="footer">Copyright &copy; University of Illinois at Urbana-Champaign</div>]]></bottom>
        </javadoc>

        <!-- Ideally, we could skip this step if the gif isn't there.
        <available file="${sound.path}/inherit.gif" property="gif.present"/>
        -->
        <copy
            file="${sound.path}/misc/inherit.gif"
            todir="${javadoc.path}/resources"
            overwrite="true"/>
    </target>

</project>

