<project default="main">
	<path id="classpath">
		<fileset dir="lib/" includes="**/*.jar" />
	</path>
	
	<target name="clean">
		<delete dir="build" />
	</target>
	
	<target name="build">
		<mkdir dir="build/classes" />
		<javac srcdir="src" destdir="build/classes" classpathref="classpath"/>
	</target>
	
	<target name="jar" depends="build">
		<mkdir dir="build/jar" />
		<jar destfile="build/jar/telegram_backup.jar"
		basedir="build/classes">
			<manifest>
				<attribute name="Main-Class"
				value="de.fabianonline.telegram_backup.Main" />
			</manifest>
		</jar>
	</target>
	
	<target name="run" depends="jar">
		<java classname="de.fabianonline.telegram_backup.Main" fork="true" >
			<classpath>
				<path refid="classpath" />
				<path location="build/jar/telegram_backup.jar" />
			</classpath>
		</java>
	</target>
	
	<target name="main" depends="clean,run" />
</project>
