<?xml version="1.0" encoding="UTF-8"?>
<!--
     ANT build configuration file for InSilicoDicer
     Author: Jan Krueger <jkrueger@techfak.uni-bielefeld.de>
-->


<project name="InSilicoDicer" basedir="." default="compile">

    
    <property name="project.title" value="InSilicioDicer"/>
    <property name="project.version" value="1.1"/>
    <property name="class.dir" value="classes"/>
    <property name="conf.dir" value="etc"></property>
    <property name="dist.dir" value="dist"/>
    <property name="doc.dir" value="docs/api"/>
    <property name="lib.dir" value="lib"/>
    <property name="src.dir" value="src"/>
    <property name="tmp.dir" value="tmp"/>
    <path id="classpath">
        <fileset dir="${lib.dir}">
            <include name="**/*.jar"/>
        </fileset>
    </path>
    
    <!-- CLEAN -->
    <target name="clean">
        <delete dir="${class.dir}"/>
        <delete dir="${dist.dir}/"/>
        <delete dir="${doc.dir}"/>
        <delete dir="${tmp.dir}"/>
    </target>
    
    <!-- COMPILE -->
    <target name="compile">
        <mkdir dir="${class.dir}"/>
        <!-- compile the java sources -->
        <javac srcdir="${src.dir}" destdir="${class.dir}" source="1.5"
            target="1.5" verbose="yes" >
            <classpath refid="classpath"/>
           
            </javac>
    </target>
    
    <!-- DIST -->
    <target name="dist" depends="compile,doc"> 
        <mkdir dir="${dist.dir}"/>
        <zip destfile="${dist.dir}/${project.title}-${project.version}.zip" >
            <fileset dir="." excludes="${dist.dir}"/>
        </zip>
    </target>
    
    <!-- DOCUMENTATION -->
    <target name="doc">
        <mkdir dir="${doc.dir}"/>
        <javadoc  sourcepath="${src.dir}" packagenames="de.unibi.techfak.*" classpathref="classpath"
             destdir="${doc.dir}" author="true" version="true"
            breakiterator="true" use="true" windowtitle="${project.title}  ${projekt.version} API "/>
    </target>
    
    <!-- WEBSTART -->
    <target name="webstart" depends="compile"> 
        <mkdir dir="${tmp.dir}"/>
        <unjar  dest="${tmp.dir}">
            <fileset dir="${lib.dir}">
                <include name="**/*.jar"/>
            </fileset>
        </unjar>
        <delete dir="${tmp.dir}/META-INF"/> 
        <mkdir dir="${dist.dir}"/>
        <jar destfile="${dist.dir}/${project.title}-${project.version}WS.jar">
            <fileset dir="${tmp.dir}"/>
            <fileset dir="${class.dir}"/>
            <fileset dir="${conf.dir}"/>
        </jar>
        <signjar jar="${dist.dir}/${project.title}-${project.version}WS.jar" alias="bibiserv" storepass="bibiserv" keypass="bibiserv"/> 
       <!-- <delete dir="${tmp.dir}"/> -->
    </target>

</project>
