<project name="Gnutella" default="core" basedir=".">

<!-- set global properties for this basedir -->
<property name="basedir" value="."/>
<property name="lib" value="../lib"/>
<property name="jars" value="${lib}/jars"/>


<!-- constants -->
<property name="DEBUG" value="yes"/>  
<property name="OPTIMIZE" value="no"/>  
<property name="DEPRECATION" value="yes"/>
<property name="NOWARN" value="yes"/>

<!-- default classpath for javac.  it is set as the user's CLASSPATH
     environment with the jar files necessary for compilation appended. -->
<path id="default.classpath" >
  <fileset dir="${jars}" includes="**/*.jar"/>
</path>


<!-- Initialization stuff -->
<target name="init">
    <available file="${jars}" type="dir" property="jars.present"/>
	<tstamp/>
	<antcall target="checkjars"/>
</target>

<target name="checkjars" unless="jars.present">
    <echo message="*******************************************************"/>
    <echo message="*******  YOU MUST CHECKOUT THE lib MODULE *************"/>
    <echo message="**** and place it as a sibling to this core module ****"/>
    <echo message="*******************************************************"/>
</target>

<!-- Core -->
<target name="core" depends="init">
	<javac debug="${DEBUG}" 
           optimize="${OPTIMIZE}" 
           deprecation="${DEPRECATION}"
		   srcdir="${basedir}" 
           destdir="${basedir}"
           nowarn="${NOWARN}"
      source="1.4"
      target="1.4"
    >
    <classpath refid="default.classpath" />
    </javac>
</target>

	

<!-- CLEAN -->
<target name="clean">
	<delete>
		<fileset dir="${basedir}/com" includes="**/*.class"/>
	</delete>
</target>

<!-- Creates a jar file from core code -->
<target name="jar" depends="clean, core">
	<delete file="lib/core.jar"/>
	<jar destfile="lib/core.jar" 
		 basedir="." 
		 excludes="**/*.java **/*.xml **/*.txt **/*.sh **/*.bat 
		 		   **/*.html **/*.jar compile run query_keys">
	</jar>
</target>

</project>













