<project name="lw-core" default="compile" basedir=".">

    <property name="limewire.home" location="${basedir}/.."/>
    
    <echo message="Update: Building now requires the 'components' module."/>
    <echo message="        If building fails because it cannot find ../components/build.xml,"/>
    <echo message="        please checkout the components module as a sibling to core."/>
    <import file="../components/build.xml"/>
    
    <target name="initialize" depends="lw-components.initialize">
        <property name="limewire.core.home"           location="${limewire.home}/core"/>
        <property name="limewire.core.src"  		  location="${limewire.core.home}"/>
        <property name="build.limewire.core.classes"  location="${limewire.core.home}"/>
        <path id="build.limewire.core.classpath">
            <fileset dir="${limewire.lib.jars}" includes="**/*.jar"/>
            <path refid="build.limewire.components.classes.core"/>
        </path>
    </target>
    
    <!-- compiles the core & components -->
    <target name="compile-all"
            description="Compiles the components and the core."
            depends="initialize, lw-components.compile-src, compile-core"/>
    
	<!-- builds only the core -->
	<target name="compile-core" 
	        description="Compiles just the core."
	        depends="initialize">
	    <javac destdir      ="${build.limewire.core.classes}"
			   debug	    ="${compile.debug}"
			   deprecation  ="${compile.deprecation}"
	           optimize     ="${compile.optimize}"
			   encoding     ="UTF-8"
	           source		="${compile.source}"
	           target       ="${compile.target}"
	           srcdir	    ="${limewire.core.src}"
			   excludes		="examples/**"
	    >
			<classpath refid="build.limewire.core.classpath"/>
	   	</javac>
	</target>
    
    <!-- cleans the core & components -->
    <target name="clean-all" 
            description="Cleans the classfiles generated from compiling the components and core."
            depends="initialize, lw-components.clean-src, clean-core"/>
	
	<!-- cleans only the core -->
	<target name="clean-core"
	        description="Cleans just the core classes."
            depends="initialize">
		<delete>
			<fileset dir="${build.limewire.core.classes}" includes="**/*.class"/>
		</delete>
	</target>
    
    <target name="clean" description="Cleans just the core" depends="clean-core"/>
    <target name="compile" description="Compiles just the core" depends="compile-core"/>
    
    <!--
       everything below is just to erase the targets from 'ant -p'
       they are listed because we import the component's buildfile.
      -->
    <target name="clean-src"/>
    <target name="clean-dist"/>
    <target name="clean-tests"/>
    <target name="clover2html"/>
    <target name="compile-src"/>
    <target name="compile-tests"/>
	<target name="jar"/>
    <target name="javadoc"/>
    <target name="test"/>
    <target name="test-all"/>
    <target name="test-package"/>
    <target name="with.clover"/>

</project>













