Newer
Older
nonet / build.xml
@Andreas Jaggi Andreas Jaggi on 4 May 2006 2 KB Completed exercice 2 of lab 7
<project name="nonet" default="dist" basedir=".">
	<description>
		simple build file
	</description>

	<!-- set global properties -->
	<property name="src" location="src"/>
	<property name="build" location="build"/>
	<property name="dist" location="dist"/>
	<property name="lib" location="lib"/>

	<target name="init">
		<!-- Create the time stamp -->
		<tstamp/>
		<!-- Create the build directory structure used by compile -->
		<mkdir dir="${build}"/>
	</target>

	<target name="compile" depends="init" description="compile the source">
		<!-- Compile the java code from ${src} into ${build} -->
		<javac srcdir="${src}" destdir="${build}">
			<classpath>
			      <pathelement path="${build}"/>
			</classpath>
		</javac>
	</target>

	<target name="dist" depends="compile" description="generate the distribution">
		<!-- Create the distribution directory -->
		<mkdir dir="${dist}/lib"/>

		<!-- Put everything in ${build} into the kernelpanic-${DSTAMP}.jar file -->
		<jar jarfile="${dist}/lib/kernelpanic-{$DSTAMP}.jar" basedir="${build}"/>
	</target>

	<target name="serventserver" depends="compile" description="run server">
		<java classname="ch.epfl.lca.sc250.ServentServer" fork="true" spawn="true">
			<classpath>
			      <pathelement path="${build}"/>
			</classpath>
		</java>
	</target>

	<target name="serventclient" depends="compile" description="run server">
		<java classname="ch.epfl.lca.sc250.ServentClient" fork="true" spawn="true">
			<classpath>
			      <pathelement path="${build}"/>
			</classpath>
		</java>
	</target>

	<target name="client" depends="compile" description="run server">
		<java classname="ch.epfl.lca.sc250.TCPClient" fork="true" spawn="true">
			<classpath>
			      <pathelement path="${build}"/>
			</classpath>
		</java>
	</target>

	<target name="server" depends="compile" description="run server">
		<java classname="ch.epfl.lca.sc250.UDPServer" fork="true" spawn="true">
			<classpath>
			      <pathelement path="${build}"/>
			</classpath>
		</java>
	</target>

	<target name="clean" description="clean up">
		<!-- Delete the ${build} and ${dist} directory trees -->
		<delete dir="${build}"/>
		<delete dir="${dist}"/>
	</target>
</project>