<project name="Designer" default="compile" basedir=".">

	<property name="src" location="src" />
	<property name="build" location="build" />
	<property name="dist" location="dist" />
	<property name="lib" location="lib" />
	<property name="lib.win32" location="lib/win32" />
	<property name="lib.win64" location="lib/win64" />
	<property name="lib.lin32" location="lib/lin32" />
	<property name="lib.lin64" location="lib/lin64" />
	<property name="lib.osx" location="lib/osx" />

	<path id="project">
		<fileset dir="${lib}" includes="*.jar" />
	</path>

	<target name="compile" description="compile the project">
		<mkdir dir="${build}" />
		<javac srcdir="${src}" destdir="${build}" classpathref="project" includeantruntime="false" />
		<copy todir="${build}/template">
			<fileset dir="${src}/template" />
		</copy>
	</target>

	<target name="win32" depends="compile" description="generate win32 jar">
		<mkdir dir="${dist}" />
		<jar jarfile="${dist}/designer-win32.jar" basedir="${build}">
			<zipgroupfileset dir="${lib}" includes="*.jar" />
			<zipgroupfileset dir="${lib.win32}" includes="*.jar" />
			<manifest>
				<attribute name="Main-Class" value="at.ac.tuwien.ims.Designer" />
			</manifest>
		</jar>
	</target>

	<target name="win64" depends="compile" description="generate win64 jar">
		<mkdir dir="${dist}" />
		<jar jarfile="${dist}/designer-win64.jar" basedir="${build}">
			<zipgroupfileset dir="${lib}" includes="*.jar" />
			<zipgroupfileset dir="${lib.win64}" includes="*.jar" />
			<manifest>
				<attribute name="Main-Class" value="at.ac.tuwien.ims.Designer" />
			</manifest>
		</jar>
	</target>

	<target name="lin32" depends="compile" description="generate lin32 jar">
		<mkdir dir="${dist}" />
		<jar jarfile="${dist}/designer-lin32.jar" basedir="${build}">
			<zipgroupfileset dir="${lib}" includes="*.jar" />
			<zipgroupfileset dir="${lib.lin32}" includes="*.jar" />
			<manifest>
				<attribute name="Main-Class" value="at.ac.tuwien.ims.Designer" />
			</manifest>
		</jar>
	</target>

	<target name="lin64" depends="compile" description="generate lin64 jar">
		<mkdir dir="${dist}" />
		<jar jarfile="${dist}/designer-lin64.jar" basedir="${build}">
			<zipgroupfileset dir="${lib}" includes="*.jar" />
			<zipgroupfileset dir="${lib.lin64}" includes="*.jar" />
			<manifest>
				<attribute name="Main-Class" value="at.ac.tuwien.ims.Designer" />
			</manifest>
		</jar>
	</target>

	<target name="osx" depends="compile" description="generate osx jar">
		<mkdir dir="${dist}" />
		<jar jarfile="${dist}/designer-osx.jar" basedir="${build}">
			<zipgroupfileset dir="${lib}" includes="*.jar" />
			<zipgroupfileset dir="${lib.osx}" includes="*.jar" />
			<manifest>
				<attribute name="Main-Class" value="at.ac.tuwien.ims.Designer" />
			</manifest>
		</jar>
	</target>

	<target name="clean" description="clean up">
		<delete dir="${build}" />
		<delete dir="${dist}" />
	</target>
</project>