<?xml version="1.0" encoding="UTF-8"?>

<project default="run" name="JBoss/AOP">

   <target name="prepare">
      <property name="jboss.aop.root" value="../../../.."/>
      <property name="jboss.aop.lib50" value="${jboss.aop.root}/lib-50"/>
 

      <path id="jboss.aop.classpath50">
         <fileset dir="${jboss.aop.lib50}">
            <include name="*.jar"/>
         </fileset>
      </path>

      <path id="classpath">
         <path refid="jboss.aop.classpath50"/>
         <pathelement path="."/>
      </path>
	  
      <property name="aop50jar" value="${jboss.aop.lib50}/jboss-aop-jdk50.jar"/>

      <path id="classpath50">
         <path refid="jboss.aop.classpath50"/>
         <pathelement path="."/>
      </path>

      <taskdef name="aopc" classname="org.jboss.aop.ant.AopC" classpathref="jboss.aop.classpath50"/>
   </target>

   <target name="compile" depends="prepare">
      <javac srcdir="."
         destdir="."
         debug="on"
         deprecation="on"
         optimize="off"
         includes="**">
         <classpath refid="classpath"/>
      </javac>
      <aopc compilerclasspathref="classpath" classpathref="classpath" verbose="true">
         <classpath path="."/>
         <src path="."/>
         <aopclasspath path="."/>
      </aopc>
   </target>

   <target name="run" depends="compile">
      <java fork="yes" failOnError="true" className="Driver">
         <sysproperty key="jboss.aop.class.path" value="."/>
         <classpath refid="classpath"/>
      </java>
   </target>

   <target name="compile50standalone" depends="prepare">
      <javac srcdir="."
         destdir="."
         debug="on"
         deprecation="on"
         optimize="off"
         includes="**">
         <classpath refid="classpath50"/>
      </javac>
   </target>

   <target name="run.50.instrumented" depends="compile50standalone">
      <java fork="yes" failOnError="true" className="Driver">
         <sysproperty key="jboss.aop.class.path" value="."/>
         <jvmarg value="-javaagent:${aop50jar}"/>
         <classpath refid="classpath50"/>
      </java>
   </target>

</project>
