<project name="sample-build-file" default="test" basedir=".">

    <!--
       This sample build file can be copied to the projects main directory
       and modified as necessary. Notable changes
       * The <project name="..."> above
       * The project-name property below.
    -->
       

    <tstamp>
        <!-- current time for buildstamp purposes -->
        <format property="buildstamp" pattern="yyyyMMddHHmmss"/>
    </tstamp>
    <tstamp>
        <format property="year" pattern="yyyy"/>
    </tstamp>

    <property environment="env" />
    <property name="project-name" value="sample project"/>
    <property name="classes" location="classes"/>
    <property name="lib" location="lib"/>
    <property name="src" location="src"/>
    <property name="javadocs" location="javadocs"/>
    <property name="logs" location="logs"/>
    <property name="config" location="config"/>

    <!-- compiler and javadoc settings -->
    <property name="debug" value="on"/>
    <property name="optimize" value="on"/>
    <property name="deprecation" value="on"/>
    <property name="ant.build.javac.source" value="1.5"/>
    <property name="ant.build.javac.target" value="1.5"/>

    <path id="compile.classpath">
        <fileset dir="${lib}">
            <include name="*.jar"/>
        </fileset>
    </path>

    <path id="classpath">
        <pathelement location="${classes}"/>
        <pathelement location="${config}"/>
        <path refid="compile.classpath"/>
    </path>

    <import file="testsupport/build.xml"/>

    <!-- =================================================================== -->
    <!-- Initialization target                                               -->
    <!-- =================================================================== -->
    <target name="init" depends="testsupport.init">
        <tstamp/>
        <mkdir dir="${classes}"/>
        <mkdir dir="${logs}"/>
    </target>

    <target name="compile" depends="init" description="compiles the source code">
        <javac srcdir="${src}" destdir="${classes}" debug="${debug}"
               optimize="${optimize}" deprecation="${deprecation}">
            <classpath refid="compile.classpath"/>
        </javac>
    </target>

    <!-- =================================================================== -->
    <!-- Creates the API documentation                                       -->
    <!-- =================================================================== -->
    <target name="javadocs" depends="init" description="generates the API documentation">
        <mkdir dir="${javadocs}"/>
        <javadoc packagenames="edu.cornell.med.*"
                 sourcepath="${src}" destdir="${javadocs}" encoding="UTF-8"
                 author="true" version="true" windowtitle="${project-name} ${label} (${buildstamp})"
                 header="${project-name} ${label} (${buildstamp})">
            <link href="http://java.sun.com/j2se/1.5/docs/api/"/>
            <classpath>
                <path refid="compile.classpath"/>
                <pathelement location="${classes}"/>
            </classpath>
            <bottom>
                <![CDATA[<i>Copyright &#169; 2005-${year} Institute for Computational Biomedicine, All Rights Reserved.</i>]]>
            </bottom>
        </javadoc>
    </target>

    <target name="clean" depends="testsupport.clean" description="Cleans up the directory">
        <delete dir="${classes}"/>
        <delete dir="${javadocs}"/>
        <delete dir="${logs}"/>
    </target>

    <target name="cruisecontrol" depends="clean, cobertura-setup, findbugs,
                  test, javadocs, pmd, cpd, checkstyle, cobertura-report"
            description="Run CruiseControl Build and Tests"/>
</project>
