<?xml version="1.0"?>
<project name="org.bridgedb.tools.batchmapper" default="jar" basedir=".">
	
	<property name="jar.file" value="../dist/org.bridgedb.tools.batchmapper.jar"/>
	
	<path id="project.class.path">
		<pathelement location="build"/>
		<pathelement location="../dist/org.bridgedb.jar"/>
		<pathelement location="../dist/org.bridgedb.bio.jar"/>
		<!--TODO make sure corelib build is called first -->
	</path>

	<target name="prepare">
		<mkdir dir="../dist"/>
		<mkdir dir="build"/>
	</target>
	
	<target name="clean" description="Remove all generated files.">
		<delete dir="build"/>
	</target>
	
	<target name="compile" depends="prepare" description="Compile all sources">
		<javac srcdir="src" 
			    debug="true"	
			    destdir="build">
			<classpath refid="project.class.path"/>
		</javac>
	</target>

	<target name="test" depends="compile" description="Test batchmapper">
		<!-- TODO -->
	</target>

	<target name="jar" depends="compile">
		<jar jarfile="${jar.file}">
			<manifest>
				<attribute name="Main-Class" value="org.bridgedb.tools.BatchMapper"/>
				<attribute name="Class-Path" value="bridgedb.jar bridgedb-bio.jar"/>
			</manifest>
			<fileset dir="build" includes="**/*.class"/>
		</jar>
	</target>
	
	<target name="dist-clean" depends="clean" description="Remove all generated files.">
		<delete file="${jar.file}"/>
	</target>
	
	<target name="dist" depends="jar"/>
</project>

