<?xml version="1.0"?>

<project name="aop examples annotated" default="help" >

  <property name="build.sysclasspath" value="ignore"/>
  <property name="junit.timeout" value="180000"/> <!-- 3 minutes -->

  <!-- Check this property file as well!! -->
  <property file="./build.properties"/>

   <!-- Need to define these before importing PojoCacheTasks.xml -->
   <!-- You define your own classpath here -->
   <path id="user.classpath">
      <pathelement path="${build}"/>
   </path>
   <property name="user.build" value="${build}"/>
   <property name="user.source" value="${source}"/>

   <import file="PojoCacheTasks.xml"/>

  <!-- set local properties for this build -->

  <target name="help" description="help page">
      <echo message="ant &lt;command&gt; where command is:" />
      <echo message="         compile       -- compile the examples code" />
      <echo message="        clobber       -- clean up the whole directory" />
      <echo message="        dist          -- package the war file" />
  </target>

  <!-- set up directory -->
  <target name="init" description="Prepare to build.">
    <!-- Create the time stamp -->
    <tstamp/>
    <!-- Create the build directory structure used by compile
    and copy the deployment descriptors into it-->
     <mkdir dir="${output}"/>
     <mkdir dir="${output}/etc"/>
     <mkdir dir="${build}"/>
    <mkdir dir="${dist}"/>
  </target>

  <target name="clean" description="Clean up compiled classes">
    <delete dir="${build}"/>
    <delete dir="${dist}"/>
  </target>

  <target name="clobber" depends="clean" />

  <!-- compile directory -->
  <target name="compile" depends="init" description="Build unit testing class">
    <javac srcdir="${source}"
           destdir="${build}"
           includes="**/**"
           debug="true"
           deprecation="true">
      <classpath>
        <path refid="pojocache.lib.classpath" />
      </classpath>
    </javac>

     <copy todir="${output}/etc">
       <fileset dir="${etc}">
          <!--exclude name="*.jsp"/-->
       </fileset>
     </copy>
   
  </target>  

  <target name="dist" depends="aopc" description="run standalone server replicator.">
   <war warfile="${dist}/test-http-scoped-FIELD.war"
      webxml="${output}/etc/WEB-INF/web.xml">
      <webinf dir="${output}/etc/WEB-INF">
         <include name="jboss-web.xml"/>
      </webinf>
      <classes dir="${build}">
         <include name="examples/*.class"/>
      </classes>

      <fileset dir="${output}/etc">
         <include name="*.jsp"/>
         <include name="*.html"/>
      </fileset>
   </war>
  </target>

</project>
