<?xml version="1.0" encoding="UTF-8"?>
<project name="org.netlib" default="default" basedir=".">
	<description>Builds, tests, and runs the project org.netlib.</description>
	<property name="version" value="0.9.3" />
	<!-- REMINDER: When bumping the version value, also bump the value in jni/configure -->
	<import file="nbproject/build-impl.xml"/>
	
	<!-- NOTE: before running 'ant test', run 'ant clean generate compile package' and then build the JNI -->
		
	<!-- Delete all files that are autogenerated -->
	<target name="-post-clean">
		<delete>
			<fileset dir="src/org/netlib/blas/" includes="**/*"/>
			<fileset dir="src/org/netlib/lapack/" includes="**/*"/>
			<fileset dir="src/org/netlib/arpack/" includes="**/*"/>
			<fileset dir="jni/" includes="**org_netlib_*.c"/>
			<fileset dir="jni/" includes="**.o"/>
			<fileset dir="jni/" includes="**.a"/>
			<fileset dir="jni/" includes="**org_netlib_*.h"/>
			<fileset dir="jni/" includes="**Makefile.incl"/>
			<fileset dir="jni/" includes="**.so"/>
			<fileset dir="jni/" includes="**.jnilib"/>
		</delete>
		<delete dir="jni/ARPACK"/>
	</target>
	<target name="generate" depends="compile">
		<!-- Autogenerate the Java and C files -->
		<java fork="yes" classname="org.netlib.generate.JavaGenerator" classpath="${run.classpath}" />
	</target>
	
	<!--
	WARNING: you need to call `ant clean generate compile package` for this to work
	because there is no easy way to tell ant that we really do need the second
	compile task to run.
	-->
	<target name="package" depends="javadoc">
		<!-- TODO: unpack and include the F2J classes -->
		<jar destfile="netlib-java-${version}.jar">
			<fileset dir="build/classes"
             excludes="**org/netlib/generate**" />
		</jar>
		<move file="dist/javadoc" todir="." />
		<zip destfile="netlib-java-${version}.zip">
			<zipfileset dir="." excludes="**/lib/nblibraries-private.properties **/nbproject/private** **/.ant-targets-build.xml dist/** build/** **/*.zip **/.svn** **/jni/*.tar.gz" prefix="netlib-java-${version}" />
		</zip>
		<delete dir="javadoc"/>
	</target>
</project>
