<project name="Standalone Tools for Click" default="help" basedir=".">

    <!--
    Project Properties
    -->
    <property name="version" value="1.1"/>

    <!--
    Path Definitions
    -->
    <path id="classpath.dev-tasks">
    </path>

    <!--
    Target Definitions
    -->
    <target name="build" description="build the dev-tasks" depends="clean, init">

        <copy todir="dev-tasks/classes">
         <fileset dir="dev-tasks/src">
            <exclude name="**/package.html"/>
         </fileset>
        </copy>
 	      <copy file="LICENSE.txt" todir="dev-tasks/classes/META-INF"/>
 	      <copy file="NOTICE.txt" todir="dev-tasks/classes/META-INF"/>
        <copy file="README.txt" todir="dev-tasks/classes/META-INF"/>

        <!-- 1. Compile the tasks -->
        <javac srcdir="dev-tasks/src"
               destdir="dev-tasks/classes"
               debug="true"
               excludes="**/Test*"
               encoding="ISO-8859-1"
               source="1.5">
            <classpath refid="classpath.dev-tasks"/>
        </javac>

        <!-- 2. package the tasks into a JAR -->
        <copy todir="dev-tasks/classes">
            <fileset dir="dev-tasks/src" includes="**/*.xml"/>
        </copy>

        <jar destfile="dist/click-dev-tasks-${version}.jar">
            <manifest>
                <attribute name="Click-Version" value="${version}"/>
                <attribute name="Package" value="org.apache.click.tools.devtasks"/>
                <attribute name="Built-By" value="${user.name}"/>
            </manifest>
            <fileset dir="dev-tasks/classes"/>
        </jar>
    </target>

    <target name="init" depends="clean">
        <!-- 1. copy the Original JAR from the original dist directory -->
        <mkdir dir="dist"/>
        <!-- 2. Cleanup the old classes -->
        <mkdir dir="dev-tasks/classes"/>
    </target>

    <target name="clean">
        <delete dir="dist" quiet="false"/>
        <delete dir="dev-tasks/classes" quiet="false"/>
    </target>

    <target name="get-deps" description="download JAR dependencies">
        <fail message="This task is not implemented yet!"/>
    </target>

    <target name="help" description="display the Help message">
        <echo>Standalone Tools for Click ${version} web application framework
==============================================================

Main targets:

  build                 build the dev-tasks
  get-deps              download JAR dependencies
	help                  display the Help message

Environment:

	java.home = ${java.home}
	ant.home  = ${ant.home}

Please ensure you have configured build.properties
        </echo>
    </target>
</project>
