<project name="WRFPortal" default="dist" basedir=".">
	<description>
	  WRF Portal and Domain Wizard
	</description>

	<path id="build.classpath">
		<pathelement location="lib/auxdata.jar"/>
		<pathelement location="lib/external.jar"/>
		<pathelement location="lib/idv.jar"/>
		<pathelement location="lib/jsch-20060426.jar"/>  
		<pathelement location="lib/jython.jar"/>
		<pathelement location="lib/local-visad.jar"/>
		<pathelement location="lib/mysql-connector-java-3.1.11-bin.jar"/>
		<pathelement location="lib/nc2.2.jar"/>
		<pathelement location="lib/SQLExecutorFramework.jar"/>
		<pathelement location="lib/SwingCalendar.jar"/>
		<pathelement location="lib/visad.jar"/>
		<pathelement location="lib/commons-net-1.4.1.jar"/>
		<pathelement location="lib/slf4j-simple.jar"/>
	</path>
	
	
	<property name="app.name" value="WRFPortal"/>

	   <!-- ******* top level source directory ******** -->
	<property name="src" location="."/>
	
	   <!-- ******* give build dir the name "classes" so it will be same dir that JBuilder uses ******** -->
	<property name="build" location="classes"/>  
	
	   <!-- ******* images are copied from images_srcdir to build so they are included in the JAR file ******** -->
	<property name="images_srcdir" location="images"/>
	<property name="images_todir" location="${build}"/>
	
	   <!-- ******* distribution directory ******** -->
	<property name="dist" location="dist"/>
	
	<property name="javadocdir" location="javadoc"/>
	<property name="bak" location="bak"/>
	
<!-- ******************** init (create build dir) ******************** -->
	
	<target name="init" description="create build dir...">
		<!-- create the timestamp -->
		<tstamp/>
	
		<!-- create the build dir structure used by compile -->
		<mkdir dir="${build}"/>
	</target>
	
<!-- ******************** compile (compiles all code in source tree to build dir) ******************** -->

	<target name="compile" depends="init" description="compile sourcecode">
		<javac srcdir="${src}" destdir="${build}"> 
			<classpath refid="build.classpath"/>  
		</javac>
	</target>	

	
<!-- ******************** dist (builds runnable jar and copies properties file to dist dir) *********** -->

	<target name="dist" depends="clean,compile" description="generate the distribution">

 		<copy todir="${images_todir}">    
 		  <fileset dir="${images_srcdir}"/>   
 		</copy>	  

		<mkdir dir="${dist}"/>
 		<jar manifest="manifest.txt" jarfile="${dist}/WRFPortal.jar" basedir="${build}"/>   
 		<copy todir="${dist}">
 		  <fileset dir="lib"/>
 		</copy>	
 	   	<copy file="readme.txt" todir="${dist}"/> 
 	   	<copy file="runWRFPortal.bat" todir="${dist}"/> 
 	   	<copy file="runWRFPortal_local" todir="${dist}"/> 
 	   	<copy file="runWRFPortal" todir="${dist}"/> 
	</target>	
	
<!-- ******************** domainwizard (builds runnable jar and copies properties file to dist dir) *********** -->

	<target name="domainwizard" depends="clean,compile" description="generate domain wizard">

 		<copy todir="${images_todir}">    
 		  <fileset dir="${images_srcdir}"/>   
 		</copy>	  
	
		<mkdir dir="dist_dwiz"/>
 		<jar manifest="manifest_dwiz.txt" jarfile="dist_dwiz/DomainWizard.jar" basedir="${build}"/>
 	   	<copy file="lib/jsch-20060426.jar" todir="dist_dwiz"/> 
 	   	<copy file="lib/SQLExecutorFramework.jar" todir="dist_dwiz"/> 
 	   	<copy file="lib/SwingCalendar.jar" todir="dist_dwiz"/> 
 	   	<copy file="readme_dwiz.txt" todir="dist_dwiz"/> 
 	   	<copy file="run_DomainWizard.bat" todir="dist_dwiz"/> 
 	   	<copy file="run_DomainWizard" todir="dist_dwiz"/> 
	</target>	
	
<!-- ******************** javadoc (generate javadoc html files) **************** -->

	<target name="javadoc" description="generate javadocs">
	  <mkdir dir="${javadocdir}" />
	  <javadoc private="true"
	           destdir="${javadocdir}"
	           author="true"
	           version="true">
	    <packageset dir="" defaultexcludes="yes">
      		<include name="gov/noaa/mapp/**"/>
      		<include name="gov/noaa/mapp/domain/**"/>
      		<include name="gov/noaa/mapp/sshfile/**"/>
      		<include name="gov/noaa/mapp/datalocator/**"/>
      		<include name="gov/noaa/mapp/visualization/**"/>
    	    </packageset>	           
	    <classpath refid="build.classpath"/>  
	  </javadoc>  
	</target>	

<!-- ******************** clean (remove build directories) ***************** -->

	<target name="clean" description="clean up">
		<delete dir="${build}"/>
		<delete dir="${doc}"/>
		<delete dir="${javadocdir}"/>
		<delete dir="${bak}"/>
		<delete dir="${dist}"/>
		<delete dir="dist_dwiz"/>
<!-- **		<delete file= filename -->
	</target>
		


</project>	
