Tuesday, February 19, 2008

ANT

<project name="StateMachine" default="run">
 
 <!-- properties -->
 <property name="src" location="src"/>
 <property name="build" location="build"/>
 <property name="dist"  location="dist"/>

   <target name="clean">
     <delete dir="${build}"/>
     <delete dir="${dist}"/>
   </target>

   <target name="compile" depends="clean">
     <mkdir dir="${build}"/>
     <javac srcdir="${src}"
            destdir="${build}" 
     />
   </target>

   <target name="jar" depends="compile">
     <mkdir dir="${dist}"/>
     <jar destfile="${dist}/${ant.project.name}.jar"
          basedir="${build}"
     />
   </target>

   <target name="run" depends="jar">
     <java classname="Main"
           classpath=".;${dist}/${ant.project.name}.jar"
           fork="true"
     />
   </target>

</project>



http://wiki.apache.org/ant