<?xml version="1.0"?>
<!--++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

   Ant build file for JPFCodeGenerator

             Ant-Download: http://jakarta.apache.org/ant
             Ant-Manual:   http://jakarta.apache.org/ant/manual/index.html
             
   Precondition: 1. Ant should be installed.
                 2. JAVA_HOME environment variable contains the path to JDK1.5 or higher
                 3. ANT_HOME environment variable contains the path to ant's home directory

   Language: XML
   Compiler: Ant
   Author:   Christopher Oezbek
   Based on ant build file originally written by:
             Joerg K. Wegner, wegnerj@informatik.uni-tuebingen.de
             Morten O. Alver
   Version:  $Revision: 1.82 $
             $Date: 2007/02/16 22:03:15 $
             $Author: mortenalver $

   modified: 

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->

<project name="JPFCodeGenerator" default="jars" basedir=".">

	<!-- Properties -->
	<property name="version" value="0.4" />
	<property name="jar" value="JPFCodeGenerator-${version}" />
	<property name="build" value="build" />
	<property name="src" value="src" />
	<property name="lib" value="lib" />

	<!-- Build classpath -->
	<path id="classpath">
		<pathelement path="${build}" />
		<pathelement location="${lib}/jpf.jar" />
		<pathelement location="${lib}/jpf-boot.jar" />
		<pathelement location="${lib}/velocity-dep-1.5.jar" />
		<pathelement location="${lib}/commons-logging.jar" />
	</path>

	<target name="run" depends="compile">
		<java classname="net.sf.jabref.plugin.util.CodeGenerator" fork="true">
			<classpath refid="classpath" />
		</java>
	</target>

	<target name="compile">
		<mkdir dir="${build}" />
		<javac debug="on" deprecation="on" destdir="${build}" source="1.5" target="1.5">
			<src path="${src}" />
			<classpath refid="classpath" />
		</javac>
	</target>

	<!-- Jars up project -->
	<target name="jars" depends="compile, unjarlib">
		<jar destfile="${jar}.jar">
			<fileset dir="${build}" />
			<fileset dir=".">
				<exclude name="bin/**" />
				<exclude name="${build}/**" />
				<exclude name="lib/**" />
				<exclude name="*.jar" />
				<exclude name="${src}/**" />
				<exclude name="todo/**" />
			</fileset>
			<manifest>
				<attribute name="Main-Class" value="net.sf.jabref.plugin.util.CodeGenerator" />
			</manifest>
		</jar>
		<jar destfile="${jar}-rt.jar">
			<fileset dir="${build}">
			  <include name="net/sf/jabref/**" />
			</fileset>
		</jar>
		<jar destfile="${jar}-src.jar">
			<fileset dir=".">
				<exclude name="bin/**"/>
				<exclude name="${build}/**"/>
				<exclude name="*.jar"/>
				<exclude name="todo/**"/>
			</fileset>
		</jar>
	</target>

	<target name="unjarlib" description="Unpacks jars from library">
		<unjar src="lib/jpf.jar" dest="${build}" />
		<unjar src="lib/jpf-boot.jar" dest="${build}" />
		<unjar src="lib/velocity-dep-1.5.jar" dest="${build}" />
		<unjar src="lib/commons-logging.jar" dest="${build}" />
	</target>

	<target name="clean" description="Clean project">
		<delete dir="${build.dir}" />
	</target>

</project>
