<project name="run" default="run" basedir=".">
   <description>
      Instead of separate start scripts for starting Antelope for Windows,
      Unix, Mac, or whatever, this single Ant build file starts Antelope on
      all platforms that run Ant. 
      
      Obviously, Ant must already be installed, but Antelope is pretty much
      useless without Ant, so this doesn't seem like an unreasonable
      requirement.
      
      To use this file, you need to have a working installation of Ant.
      Antelope has been tested extensively with Ant version 1.5 and 1.6.
      
      To run Antelope, just do "ant -f run.xml". You shouldn't need to adjust
      the classpath below.
   </description>

   <!-- ========================================================================
      Target: run
      Runs Antelope as a stand-alone application.
   ========================================================================= -->
   <target name="run" 
           description="Runs Antelope as a standalone app."
           depends="-setClasspath">
      <java classname="ise.antelope.launcher.Launcher" fork="true">
         <classpath refid="antelopeCP"/>
      </java>
   </target>

   <!-- ========================================================================
      Subtarget: -setClasspath
      Sets the classpath for Antelope by adding appropriate jars. Include
      jdk tools.jar, Ant's classpath, and Antelope's own jars.
   ========================================================================= -->
   <target name="-setClasspath" depends="-init">
      <available property="haveToolsJar" 
                 value="${java.home}/lib/tools.jar"
                 file="${java.home}/lib/tools.jar"/>
      <available property="haveToolsJar"
                 value="${java.home}/../lib/tools.jar"
                 file="${java.home}/../lib/tools.jar"/>
      <property name="tools.jar" location="${haveToolsJar}"/>
      <path id="antelopeCP">
         <fileset dir="${basedir}">
            <include name="*.jar"/>
         </fileset>
         <fileset dir="${basedir}/lib">
            <include name="**/*.jar"/>
         </fileset>
         <pathelement path="${java.class.path}"/>
         <pathelement location="${tools.jar}"/>
      </path>
   </target>
   
   <target name="-init">
      <mkdir dir="${basedir}/lib"/>
   </target>
   
</project>
