<?xml version="1.0"?>

<project name="applet" basedir="." default="jar">
	
	<target name="clean">
		<delete dir="dist" failonerror="true"/>
	</target>
	
	<target name="init">
		<mkdir dir="classes"/>
		<mkdir dir="dist"/>
	</target>
	
    <target name="compile" depends="init">
        <javac srcdir="src" destdir="classes" debug="true" deprecation="true" source="1.4" target="1.4">
            <classpath>
				<pathelement location="../dist/jinput.jar"/>
				<pathelement location="../dist/jinput-test.jar"/>
            </classpath>
		</javac>
	</target>
	
	<target name="jar" depends="compile">
        <jar jarfile="dist/jinput-applet-test.jar" compress="true" basedir="classes">
            <include name="**/*.class"/>
        </jar> 
	</target>
	
	<target name="dist" depends="jar">
		<copy todir="dist">
			<fileset dir="../webstart/dist/"/>
			<fileset file="jinput.html"/>
			<fileset file="jinput-event.html"/>
		</copy>
	</target>

	<target name="sign" depends="jar">
		<input message="Input keystore alias: " addproperty="keystoreAlias"/>
		<input message="Input keystore password: " addproperty="keystorePassword"/>
		<signjar alias="${keystoreAlias}" keystore="../webstart/myKeyStore" storepass="${keystorePassword}" verbose="true">
			<fileset dir="dist">
				<include name="**/jinput-applet-test.jar"/>
			</fileset>
		</signjar>
	</target>
</project>