<!-- 

PTRACO Application (ProjectTracking System)

********************************************************
Created By: Sagark
Thursday, August 29, 2006
********************************************************
version 0.2.0, 29. August 2004
Source code, modifications, copy and use not without permession
contact sagaint@yahoo.com for more details.
********************************************************

-->


<project name="ptraco" default="dist" basedir=".">
    <description>
        Ptraco Building 
    </description>
  <!-- set global properties for this build -->
  <property name="src" 	 location="ptinstance/src"/>
  <property name="serverHome"  location="C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps"/>
  <property name="serverStartHome" location="C:\Program Files\Apache Software Foundation\Tomcat 5.0\bin"/>
    <property name="antHome" location="C:\Ant\apache-ant-1.5.4\lib"/>
  <property name="build" location="install"/>
  <property name="classes" location="classes"/>
  <property name="project" location="ptraco"/>

  <target name="clean">
      <delete dir="install"/>

  </target>

  <target name="init" depends="clean">
    <tstamp/>
    <mkdir dir="${build}"/>    
    <mkdir dir="${build}/ptraco"/>
    <mkdir dir="install/ptraco/WEB-INF"/>
    <mkdir dir="install/ptraco/WEB-INF/classes"/>
    <mkdir dir="install/ptraco/WEB-INF/lib"/>
  </target>

  <target name="compile" depends="init" description="compile the source " >
  
    
    <javac srcdir="${src}" destdir="install/ptraco/WEB-INF/classes">
          <classpath>
            <pathelement path="${classpath}"/>
            <fileset dir="PTPE/lib">
              <include name="**/*.jar"/>
          </fileset>
      </classpath>
    </javac>
   
   </target>
  
  <target name="openamf" depends="compile" description="Copying the OPENAMFCONFIG">
  
  <copy file="PTPE/common/build-webservice.xml" todir="install/ptraco/WEB-INF"/>
  <copy file="PTPE/common/openamf-config.xml" todir="install/ptraco/WEB-INF"/>
  <copy file="PTPE/common/web.xml" todir="install/ptraco/WEB-INF"/>
  
  
  <copy todir="install/ptraco/WEB-INF/lib">
  	  <fileset dir="PTPE/lib"/>
   </copy>
   <copy todir="install/ptraco/">
  	  <fileset dir="ptinstance/modules" excludes="**/*.fla"/>
  	     </copy>
	  <copy todir="install/ptraco/WEB-INF/classes">
  	  <fileset dir="ptinstance/src" excludes="**/*.java, "/>
   </copy>
  </target>
  
  
   <target name="copytoServer" depends="openamf"  description="copy stuff to Server" >
 <!--	<copy todir="${serverHome}">
  	  <fileset dir="install/"/>
 	  </copy>-->
  
  </target>
  
  
  
  <target name="dist" depends="copytoServer"  description="copy stuff to Server" >
  <ant antfile="CreateTabels.xml" />
  <echo>Tabels Created Successfully </echo>
  <echo>Need to Work on excepetion for the java.utils.zip please Check ASAP</echo>
   <ant antfile="JAVA2AS.xml" />
   <echo>ActionScript Classes Created Successfully </echo>
	  <copy todir="${serverHome}">
  	  <fileset dir="install/"/>
	  </copy>
   <echo>Ptraco Instance Copied to Server </echo>
    <ant antfile="DefaultData.xml" />
    <echo>Default Data Added  Successfully </echo>
    <echo>${tstamp}</echo>



<echo>PTRACO has successfully install on ${serverHome} </echo>
<echo>Now can start the server </echo>
<buildnumber file="ptraco.projectbuild.number"/>
<loadfile property="message" srcFile="Release Notes 1.3"/> 

<loadfile property="buildnum" srcFile="ptraco.projectbuild.number"/>
<echo>${message}</echo>
<echo>Build Created with following number </echo>
<echo>${buildnum}</echo>
 <!--<ant antfile="startServer.xml" />-->
  </target>
</project>

