<project name="DeepMatrix 1.x" default="dist" basedir=".">

  <!-- set global properties for this build -->
  <property name="src" value="source" />
  <property name="build" value="." />

  <path id="project.class.path">
    <pathelement location="${src}/vrml.zip" />
    <pathelement path="${java.class.path}/" />
    <pathelement location="${src}/java40.jar" />
    <pathelement location="${build}/shout3d.zip" />
  </path>

  <target name="compile">
    <!-- Compile the java code from ${src} into ${build} -->
    <javac srcdir="${src}" destdir="${build}" excludes="**/additions/**/*.java" >
        <classpath refid="project.class.path"/>
    </javac>
  </target>

  <target name="dist" depends="compile">
    <!-- make the different jar files -->
    <jar jarfile="muserver.jar" basedir="${build}" 
         includes="**/matrix/*.class, **/matrix/server/*.class, **/matrix/vrml/*.class" />      
     <jar jarfile="mudeck.eai.jar" basedir="${build}" 
          includes="**/matrix/*.class, **/matrix/vrml/**/*.class, **/matrix/util/*.class, **/matrix/deck/*.class, **/matrix/deck/eai/*.class" />
     <jar jarfile="mudeck.s3d.jar" basedir="${build}" 
          includes="**/matrix/*.class, **/matrix/vrml/*.class, **/matrix/util/*.class, **/matrix/deck/*.class, **/matrix/deck/s3d/*.class, **/custom_nodes/*.class" />
    <jar jarfile="muchat.jar" basedir="${build}" 
          includes="**/matrix/*.class, **/matrix/vrml/*.class, **/matrix/chat/*.class, **/matrix/deck/*.class" />
    <jar jarfile="mutools.jar" basedir="${build}" 
          includes="**/tools/*.class, **/matrix/*.class, **/matrix/vrml/*.class, **/matrix/deck/*.class" />     
    <war warfile="deepmatrix.war" webxml="web.xml">
        <fileset dir="${build}" includes="*.html, matrixrc"/>       
        <fileset dir="${build}" includes="matrix/*.class, matrix/chat/*.class, matrix/deck/**/*.class, matrix/vrml/*.class" />
        <classes dir="${build}" includes="matrix/*.class, matrix/server/*.class, matrix/vrml/*.class" />
    </war>
  </target>

  <target name="clean">
    <!-- Delete the ${build} directory trees and any jar files-->
    <delete dir="${build}/matrix" />
    <delete dir="${build}/tools" />
    <delete dir="${build}/custom_nodes" />
    <delete>
        <fileset dir="${build}" includes="*.jar" />
    </delete>
  </target>
</project>
  
