<?xml version="1.0" encoding="UTF-8"?>
<project name="CCTNSApplication" default="CCTNS" basedir=".">
<property name="directory" value="C:\CCTNSClientApplication"/>
<property name="ant_log_directory" value="C:\cctns_offline_installation_log"/>	
<record name="${ant_log_directory}\simple.log"/>

<echo message="CCTNS Application Installaing " /> 
<target name="CCTNS" depends="dircheck,reCreateAppRootDirectory,createAppRootDirectory,copyApplication,ApplicationDBUserDetails,createAppShortCut,pauseAfterDone" >
	<echo message="CASOffline Application Installing " /> 
</target>
  <target name="reCreateAppRootDirectory" depends="dircheck" if="dir.exists">
    <echo>${directory} exists</echo>
    <delete dir="${directory}"/>
   <mkdir dir="${directory}" />
  </target>
    <target name="createAppRootDirectory" depends="dircheck" unless="dir.exists">
    <echo>${directory} Not Available "</echo>
    <mkdir dir="${directory}" /> 
  </target>
  <target name="dircheck">
    <condition property="dir.exists">
      <available file="${directory}" type="dir"/>
    </condition>
  </target>
<!-- <target name="MakedirForCCTNSApplication" description="CCTNS Application Directory" depends="dircheck"> 
<echo message="Creating CCTNS Application Directory"></echo>
	<mkdir dir="C:/CCTNSClientApplication" /> 
</target> -->

<target name="copyApplication"  description="Copying CCTNS Jar"  depends="dircheck"> 
<echo message="Copying CCTNS JAR Application"></echo> 
	<copy
	todir="C:/CCTNSClientApplication"> 
	<fileset dir="./Application"/> 
	</copy>
</target> 
<target name="ApplicationDBUserDetails" description="To set the Database settings" depends="copyApplication"  >
	<echo message="To set the Database settings"> </echo>
  	<java jar="${directory}\ConfigureCASOfflineClient.jar" fork="true"/>
</target>
<target name="createAppShortCut" description="Created Short Cut" depends="ApplicationDBUserDetails" >
    <echo message="CCTNS Short CUT Created" /> 	
    <exec executable="cscript">
        <arg value="${directory}\ShotCCTNS.vbs"/>
     </exec>
</target>
<target name="pauseAfterDone" description="Pause After done" depends="createAppShortCut" >
    <echo message="Done, please look at the output above, if any error please follow the procedure again." /> 	
    <input>Press return(enter) key to continue...</input>
        
    </target>
</project>
