<?xml version="1.0"?>

<project name="TransToolsAntTasks" basedir="." default="all">

  <!-- =================================================================== -->
  <!-- INIT                                                                -->
  <!-- =================================================================== -->
  <target name="init">  

    <!-- Variables -->
    <property name="name"           value="TransToolsAntTasks" />    
    <property name="year"           value="2008" />

    <property name="src.dir"        location="src" />
    <property name="build.dir"      location="build" />
    <property name="apidoc.dir"     location="apidoc" />
    
    <property name="debug"          value="on" />    
    <property name="deprecation"    value="on" />    
    <property name="optimize"       value="on" />    

    <property name="ant.build.javac.source" value="1.4"/>
    <property name="ant.build.javac.target" value="1.4"/>
    
    <echo message="-------------------------"/>
    <echo message="TransToolsAntTasks build"/>
    <echo message="-------------------------"/>
    
    <!-- Create dirs -->
    <mkdir dir="${build.dir}"/>

  </target>

  <!-- =================================================================== -->
  <!-- MAIN                                                                -->
  <!-- =================================================================== -->
  <target name="all" 
          depends="anttasks" 
          description="Build everything.">

    <echo message="*** TransToolsAntTasks successfully compiled!"/>

  </target>

  <!-- =================================================================== -->
  <!-- CLEAN                                                               -->
  <!-- =================================================================== -->
  <target name="clean" 
          depends="init" 
          description="Clean build dir">
    <delete dir="${build.dir}" />
    <echo message="*** Build dir cleared!"/>
  </target>
  
  <!-- =================================================================== -->
  <!-- JAVADOC                                                             -->
  <!-- =================================================================== -->
  <target name="javadoc" 
          depends="all" 
          description="AntTasks JavaDoc">
    <delete dir="${apidoc.dir}" />
    <mkdir dir="${apidoc.dir}"/>
    <javadoc packagenames="edu.xtec.*" 
             destdir="${apidoc.dir}" 
             author="true" 
             version="true" 
             use="true" 
             splitindex="true" 
             noindex="false" 
             windowtitle="${name} API" 
             doctitle="${name}">
             <bottom><![CDATA[<p class="NavBarCell3"><font size="-1">Copyright &#169; ${year} Francesc Busquets (<a href="mailto:fbusquets@xtec.cat">fbusquets@xtec.cat</a>) & Departament d'Educaci&oacute; de la Generalitat de Catalunya (<a href="mailto:info@xtec.net">info@xtec.net</a>)<br>Licensed under the terms of the <a href="http://www.gnu.org/copyleft/gpl.html">GNU General Public License</a></font></p>]]></bottom>
             <sourcepath>
               <pathelement location="${src.dir}"/>
             </sourcepath>
             <classpath />
             <excludepackage name="edu.xtec.resources.messages" />
             <link href="http://java.sun.com/j2se/1.4.2/docs/api/" />
             <link href="http://www.jajakarta.org/ant/ant-1.6.1/docs/ja/manual/api/" />
    </javadoc>
  </target>

  <!-- =================================================================== -->
  <!-- ANTTASKS                                                            -->
  <!-- =================================================================== -->
  <target name="anttasks" 
          depends="init">
    <mkdir dir="${build.dir}/antTasks"/>
    <javac srcdir="${src.dir}" 
           destdir="${build.dir}/antTasks" 
           debug="${debug}" 
           source="${ant.build.javac.source}"
           target="${ant.build.javac.target}"
           deprecation="${deprecation}"
           optimize="${optimize}" />
    <copy todir="${build.dir}/antTasks">
      <fileset dir="${src.dir}">
        <include name="**/*.gif"/>
      </fileset>            
    </copy>        
    <jar jarfile="transToolsAntTasks.jar" 
         basedir="${build.dir}/antTasks" />
  </target>

</project>
