<project name="BukkitXMPP" default="dist" basedir=".">
	<property name="pluginname" value="BukkitXMPP"/>
	<property name="plugins" location="../minecraft/plugins/"/>

	<property name="src" location="src"/>
	<property name="bin" location="bin"/>
	<property name="dist" location="dist"/>
	
    <path id="bukkitxmpp.classpath">
        <pathelement location="bin"/>
        <pathelement location="lib/craftbukkit-0.0.1-SNAPSHOT.jar"/>
        <pathelement location="lib/smack.jar"/>
        <pathelement location="lib/smackx.jar"/>
    </path>
	
	<target name="init">
		<mkdir dir="${bin}"/>
	</target>
	
	<target name="compile" depends="init">
		<javac srcdir="${src}" destdir="${bin}" includeantruntime="false">
			<classpath refid="bukkitxmpp.classpath"/>
		</javac>
	</target>
	
	<target name="dist" depends="compile">
                <zipgroupfileset dir="lib" includes="smack*.jar" /> 
		<mkdir dir="${dist}"/>
		<jar jarfile="${dist}/${pluginname}.jar">
			<fileset dir="${bin}"/>
			<fileset file="resources/plugin.yml"/>
			<manifest>
				<attribute name="Built-By" value="${user.name}"/>
	 		  	<!--<attribute name="Class-Path" value="../lib/smack.jar ../lib/smackx.jar"/>-->
			</manifest>
		</jar>
	</target>
	
	<target name="deploy" depends="dist">
		<copy file="${dist}/${pluginname}.jar" todir="${plugins}"/>
	</target>
	
	<target name="clean">
		<delete dir="${bin}"/>
		<delete dir="${dist}"/>
	</target>
		
    <target name="Main">
        <java classname="org.bukkit.craftbukkit.Main" failonerror="true" fork="yes">
            <classpath refid="bukkitxmpp.classpath"/>
        </java>
    </target>
</project>
