<project name="CRONOMETER" default="cronometer.jar" basedir=".">

	<description>
		Builds the CRONOMETER App
	</description>

	<!-- set global properties for this build -->
	<property name="name"  value="CRON-O-METER"/>
	<property name="source" location="src/"/>
	<property name="build" location="bin"/>
	<property name="lib" location="lib"/> 
	 
	<taskdef name="launch4j"
		    classname="net.sf.launch4j.ant.Launch4jTask"
		    classpath="C:/Program Files/Launch4j/launch4j.jar
		        :C:/Program Files/Launch4j/lib/xstream.jar" />
	
	 <taskdef name="exe4j"
	               classname="com.exe4j.Exe4JTask"
	               classpath="C:\Program Files\exe4j\bin\ant.jar"/> 
	                
	<!-- Compile the java code from ${src} into ${build} -->
	<target name="compile" description="compile the source">
		<javac source="1.4" srcdir="${source}" destdir="${build}">
			<classpath>
				<fileset dir="${build}/lib">
					<include name="*.jar"/>
				</fileset>
			</classpath>
		</javac>
	</target>

	<target name="docs.jar" description="create the documentation jar file" >
		<jar jarfile="lib/docs.jar" compress="true">
			<fileset dir="docs">
				<include name="**"/>				 
			</fileset>
			<manifest>
				<attribute name="Built-By" value="${user.name}"/> 
			</manifest>
		</jar>
	</target>
	
	<target name="cronometer.jar" depends="compile" description="generate the distribution jar" >
		<jar jarfile="lib/cronometer.jar" compress="true">
			<fileset dir="${build}">
				<include name="*.*"/>
				<include name="ca/**"/>
				<include name="com/**"/>
				<include name="se/**"/>
				<include name="img/**"/>
				<include name="docs/**"/>
			</fileset>
			<manifest>
			    <attribute name="Built-By" value="${user.name}"/>
			    <attribute name="Main-Class" value="ca.spaz.cron.CRONOMETER"/>
			</manifest>
		</jar>
	</target>

	<target name="launcher" depends="cronometer.jar,docs.jar" description="generate the executable" >
		<launch4j configFile="release/windows/launch4j.xml" />
		<exe4j projectfile="release/windows/cronometer.exe4j"/>
	</target>	

	 

</project>

