<?xml version="1.0" encoding="UTF-8"?>
<!-- ====================================================================== 
     Ant build file for TET Java sample programs.
     
     Requires Ant 1.6 or newer.
     
     $Id: build.xml,v 1.2.2.1 2010/07/27 13:04:57 stm Exp $                    
     ====================================================================== -->
<project name="tet-java-samples" default="run">

	<description>Ant build file for TET Java sample programs</description>

	<property name="bin.dir" value="bin" />
	<property name="src.dir" value="${basedir}" />

	<path id="project.class.path">
		<pathelement location="TET.jar" />
		<pathelement path="${bin.dir}" />
	</path>

	<macrodef name="runsample" description="TET 'name'">
		<attribute name="name" />
		<element name="javaargs" optional="yes"/>
		<sequential>
			<echo message="@{name}" />
			<java classname="@{name}" fork="true">
				<classpath refid="project.class.path" />
				<sysproperty key="java.library.path" path="${basedir}:${basedir}/.libs" />
				<javaargs/>
			</java>
		</sequential>
	</macrodef>

	<target name="run" depends="compile">
		<runsample name="dumper">
			<javaargs>
				<arg value="FontReporter.pdf" />
			</javaargs>
		</runsample>
		<runsample name="extractor">
        		<javaargs>
        			<arg value="FontReporter.pdf" />
        			<arg value="FontReporter" />
        		</javaargs>
		</runsample>
		<runsample name="fontfilter">
			<javaargs>
                                <arg value="FontReporter.pdf" />
                        </javaargs>
                </runsample>
		<runsample name="get_attachments">
                        <javaargs>
                                <arg value="FontReporter.pdf" />
                                <arg value="attachments.txt" />
                        </javaargs>
                </runsample>
		<runsample name="glyphinfo">
                        <javaargs>
                                <arg value="FontReporter.pdf" />
                                <arg value="FontReporter.info.txt" />
                        </javaargs>
                </runsample>
		<runsample name="image_resources">
                        <javaargs>
                                <arg value="FontReporter.pdf" />
                        </javaargs>
                </runsample>
                <runsample name="tetml">
                        <javaargs>
                                <arg value="FontReporter.pdf" />
                                <arg value="FontReporter.tetml" />
                        </javaargs>
                </runsample>
	</target>

	<target name="compile">
		<mkdir dir="${bin.dir}" />
		<javac destdir="${bin.dir}">
			<classpath refid="project.class.path" />
			<src path="${src.dir}" />
			<exclude name="j2ee/**" />
		</javac>
	</target>

	<target name="clean">
		<delete dir="${bin.dir}" />
	</target>
</project>
