<?xml version="1.0" encoding="UTF-8"?>
<project name="mobibot" default="build" basedir=".">
	<property file="${basedir}/build.properties" />
	<path id="path.source">
		<pathelement location="${path.src}" />
	</path>
	<path id="path.class">
		<fileset dir="${path.lib}">
			<include name="**/*.jar"/>
		</fileset>
	</path>
	<path id="ant.class">
		<fileset dir="${path.ant}">
			<include name="**/*.jar"/>
		</fileset>
	</path>
	<taskdef name="jreleaseinfo" classname="ch.oscg.jreleaseinfo.anttask.JReleaseInfoAntTask" classpathref="ant.class"/>
	<target name="init">
		<tstamp />
		<mkdir dir="${path.classes}"/>
		<mkdir dir="${path.dist}"/>
	</target>
	<target name="compile" depends="init" description="Compiles sources">
		<jreleaseinfo targetDir="${basedir}/${path.src}" className="ReleaseInfo" packageName="${proj.package}" project="${proj.name}" version="${proj.version}" buildnumfile="${basedir}/buildnum.properties"/>
		<mkdir dir="${path.classes}" />
		<javac sourcepathref="path.source" classpathref="path.class" destdir="${path.classes}" debug="on" deprecation="on">
			<src refid="path.source" />
		</javac>
	</target>
	<target name="build" depends="clean,jar" description="Rebuilds project" />
	<target name="jar" depends="compile" description="Builds the JAR">
		<copy todir="${path.classes}">
			<fileset dir="${path.src}" includes="*.properties" />
		</copy>
		<pathconvert targetos="unix" pathsep=" " property="mf.lib" refid="path.class">
			<map from="${basedir}" to="."/>
		</pathconvert>
		<jar destfile="${basedir}/${path.dist}/${ant.project.name}.jar" basedir="${path.classes}" excludes="**/.dependency-info/**">
			<manifest>
				<attribute name="Main-Class" value="${proj.run}"/>
				<attribute name="Class-Path" value=". ${mf.lib}"/>
			</manifest>
		</jar>
	</target>
	<target name="clean" depends="init" description="Removes classses">
		<delete quiet="true" includeEmptyDirs="true">
			<fileset dir="${path.classes}" includes="*,*/**"/>
			<fileset dir="${path.dist}" includes="*,*/**"/>
		</delete>
	</target>
</project>

