build.xml 1.81 KB
Newer Older
petter's avatar
petter committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
<project name="VAM" default ="all" basedir=".">
  <property name="java"       location="java" />
  <property name="classes"   location="bin" />
  <property name="dist"      location="dist"/>
  <property name="etc" 	     location="etc" />
  <property environment="env" />

  <path id="sources">
    <fileset dir="${src}">
      <include name="**/**.java" />
    </fileset>
  </path>

  <!-- initialize the workspace -->
  <target name="init">
    <mkdir dir="${classes}" />
    <mkdir dir="${dist}" />    
  </target>

  <!-- deletes all build-related directories -->
  <target name="clean">
    <delete>
      <fileset dir="." defaultexcludes="no" includes="**/*~"/>
      <fileset dir="." defaultexcludes="no" includes="**/#*#"/>
    </delete>
    <delete dir="${classes}" />
    <delete dir="${dist}" />
  </target>


  <!-- Compiles the .java files to the classes directory -->
  <target name="classes" depends="init">
    <depend srcdir="${java}" destdir="${classes}" cache="${etc}" />
    <javac srcdir="${java}" destdir="${classes}" verbose="off" listfiles="off"
35
      source="1.4" target="1.4" debug="off" encoding="Cp1252">
petter's avatar
petter committed
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
    </javac>
  </target>

  <!-- Packs the classes into single .jar files -->
  <target name="pack" depends="classes">
    <jar jarfile="${dist}/vam.jar" basedir="${classes}">
     <manifest>
       <attribute name="Main-Class" value="Starter" />
       <!--attribute name="Class-Path" value="derby.jar jna.jar" /-->
     </manifest>
     </jar>
    <copy todir="${dist}"><fileset dir="${etc}"></fileset></copy>
    <zip destfile="./vam.zip" basedir="${dist}" update="true"/> 
  </target>

  <!-- build the whole project -->
  <target name="all" depends="pack" />
  <target name="run" depends="pack">
    <java jar="${dist}/vam.jar" fork="true">
      <assertions><disable /></assertions>
    </java>
  </target>
</project>