<?xml version="1.0"?>

<project name="jboss-profiler-jvmti" default="core">


	<path id="taskdef-path">
		<fileset dir="../java/libs/ant-libs"/>
	</path>

	<path id="build.classpath">
		<pathelement location="./output/classes"/>
		<fileset dir="../build/jar"/>
		<fileset dir="../java/libs"/>
	</path>
	
	<target name="init">
		<mkdir dir="./output"/>
		<mkdir dir="./output/classes"/>
		<mkdir dir="./output/sars"/>
	</target>
	
	<target name="compile" depends="init">
		<javac srcdir="./java-src" destdir="output/classes" classpathref="build.classpath" compiler="modern" />
		<javac srcdir="./native-tests" destdir="output/classes" classpathref="build.classpath" compiler="modern" />
		<javah class="org.jboss.profiler.jvmti.JVMTIInterface" classpathref="build.classpath" destdir="./native-src">
		</javah>
	</target>
		
    <target name="test-native" depends="compile">
        <java classname="org.jboss.profiler.jvmtitest.JVMTITest" fork="true" classpathref="build.classpath">
        	<jvmarg value="-agentlib:jbossAgent=test"/>
        </java>
    </target>
	
	<target name="mbean" depends="compile">
		<jar jarfile="./output/sars/jboss-profiler-jvmti.sar">
                     <zipfileset dir="./output/classes"/>
                     <zipfileset dir="./mbean" includes="jboss-service.xml" prefix="META-INF"/>
		</jar>
	</target>
		
	<target name="core" depends="compile,mbean">
	</target>


</project>
