<?xml version="1.0"?>

<project name="PojoCache tasks">
   <!--
   Tasks definition for JDK50 aopc. In addition to annotate your POJO with JDK-14 style
   annotation, you will also need to define the "source" and "build" directory. It will byte-code
   instrumented your POJOs and update them under build directory. You can verify this by doing
   a listing there to confirm creation of new (and additional) classes.

   To use this, you can use Ant import to import it into you regular build.xml (see the example
   build.xml here). You will need to pass in the following properties: user.build, where you
   output classes is located, and finally user.classpath is the path element that you java
   class is using.
   -->

   <!-- Assuming we are at tools directory -->
   <property name="cache_home" value="${basedir}/.."/>
   <property name="cache_lib" value="${cache_home}/lib"/>
   <property name="cache_lib-50" value="${cache_home}/lib-50"/>
   <property name="cache_resource" value="${cache_home}/resources"/>

   <!-- set local properties for this build -->
   <path id="pojocache.lib.classpath">
      <fileset dir="${cache_lib}">
         <include name="jboss-common.jar"/>
         <include name="concurrent.jar"/>
         <include name="javassist.jar"/>
         <include name="trove.jar"/>
      </fileset>
      <fileset dir="${cache_lib-50}">
         <include name="jboss-cache-jdk50.jar"/>
         <include name="jboss-aop-jdk50.jar"/>
      </fileset>
   </path>

   <path id="jboss.aop.classpath">
      <fileset dir="${cache_lib}">
         <include name="jboss-aop-jdk50.jar"/>
      </fileset>
   </path>

   <!-- pre-compile directory with aopc -->
   <target name="aopc" description="Precompile aop test classes">
      <taskdef name="aopc" classname="org.jboss.aop.ant.AopC" classpathref="pojocache.lib.classpath"/>
      <aopc compilerclasspathref="pojocache.lib.classpath" verbose="true">
         <src path="${user.build}"/>
         <aoppath path="${cache_resources}/jboss-aop.xml"/>
         <classpath refid="user.classpath"/>
      </aopc>
   </target>

</project>
