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

<project default="run" name="JBoss/AOP">
   <target name="prepare">
      <property name="jboss.aop.root" value="/Temp/jboss-aop_1.0.0-FINAL"/>
      <property name="jboss.aop.lib" value="${jboss.aop.root}/lib"/>
      <property name="jboss.aop.lib50" value="${jboss.aop.root}/lib-50"/>
 
      <path id="jboss.aop.classpath">
         <fileset dir="${jboss.aop.lib}">
            <include name="bsh-1.3.0.jar"/>
            <include name="concurrent.jar"/>  
            <include name="javassist.jar"/>  
            <include name="jboss-aspect-library.jar"/>
            <include name="jboss-common.jar"/>  
            <include name="qdox.jar"/>  
            <include name="trove.jar"/>
         </fileset>
      	<fileset dir="../../../output/lib">
            <include name="jboss-aop.jar"/>
    	</fileset>
      </path>

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

      <path id="classpath">
         <path refid="jboss.aop.classpath"/>
         <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.classpath"/>
   </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="."/>
         <aoppath path="jboss-aop.xml"/>
      </aopc>
   </target>

   <target name="run" depends="compile">
      <java fork="yes" failOnError="true" className="Driver">
         <sysproperty key="jboss.aop.path" value="jboss-aop.xml"/>
         <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.path" value="jboss-aop.xml"/>
         <jvmarg value="-javaagent:${aop50jar}"/>
         <classpath refid="classpath50"/>
      </java>
   </target>

</project>
