<?xml version="1.0"?>
<project name="owlifier" default="run" basedir=".">
   <description>simple owlifier ant build file </description>
   
   <!-- set global properties for this build -->
   <property name="src" location="src"/>
   <property name="build" location="build"/>
   <property name="dist"  location="dist"/>
   <property name="config"  location="config"/>
   <property name="args"  value=""/>

   <target name="init">
      <!-- Create the time stamp -->
      <tstamp/>
      <!-- Create the build directory structure used by compile -->
      <mkdir dir="${build}"/>
      <!-- Create the config sub-directory -->
      <mkdir dir="${build}/config"/>
      <copy todir="${build}/config">
         <fileset dir="${config}">
            <include name="**"/>
         </fileset>
      </copy>
   </target>

   <target name="setclasspath" depends="">
      <path id="project.class.path">
         <pathelement location="./"/>
         <pathelement location="./configs"/>
         <pathelement location="./lib"/>
         <pathelement location="./build"/>
         <fileset dir="lib">
            <include name="**/*.jar"/>
         </fileset>
      </path>
      <property name="classpath" refid="project.class.path"/>
   </target>

   <target name="compile" depends="init,setclasspath"
        description="compile the source " >
      <!-- Compile the java code from ${src} into ${build} -->
      <echo>Compiling with classpath: ${classpath}</echo>
      <javac srcdir="${src}" 
           destdir="${build}"
           classpath="${classpath}"
           debug="on"
           source="1.5"
           deprecation="true"/>
   </target>

   <target name="run" depends="compile">
      <echo>Running with classpath: ${classpath}:${build}</echo>
      <java classname="org.ecoinformatics.owlifier.Owlifier"
          classpath="${classpath}:${build}"
          fork="yes">
         <arg value="-ant"/>
         <arg value="${args}"/>
         <jvmarg value="-DSMS=${pwd}"/>
         <jvmarg value="-Xmx512m"/>
         <jvmarg value="-Xss5m"/>
      </java>
   </target>




   <target name="jar" depends="compile">
      <jar jarfile="sms.jar">
         <fileset dir="build/"/>
      </jar>
   </target>

   <target name="javadoc" depends="run">
      <javadoc sourcepath="src"
             destdir="doc/javadoc"
	     classpath="${classpath}:${build}"
	     verbose="false"
	     maxmemory="256m"
	     source="1.5"
	     failonerror="true">
         <package name="org.*"/>
      </javadoc>
   </target>

   <target name="clean"
        description="clean up" >
    <!-- Delete the ${build} and ${dist} directory trees -->
      <delete dir="${build}"/>
      <delete dir="${dist}"/>
   </target>

</project>

