<?xml version="1.0" encoding="UTF-8"?>

<project basedir=".">
	
  <!-- PROPERTY DEFINITIONS -->
  <property name="tmp.dir" value="tmp"/>
  
  <target name="install-DataSource" description="Copy DataSource definition file into JBOSS deploy dir." >
    <echo message="Copy DataSource definition file into JBOSS deploy dir"/> 

    <copy file="${resources.dir}/${datasource.file.name}"  todir="${tmp.dir}"/>

    <mkdir dir="${tmp.dir}"/>	

    <replace  file="${tmp.dir}/${datasource.file.name}">
      <replacefilter token="@datasource.name@" value="${datasource.name}"/>
      <replacefilter token="@database.connection.url@" value="${database.connection.url}"/>
      <replacefilter token="@database.driver@" value="${database.driver}"/>
      <replacefilter token="@database.login@" value="${database.login}"/>
      <replacefilter token="@database.password@" value="${database.password}"/>
    </replace> 

    <copy file="${tmp.dir}/${datasource.file.name}"  todir="${jboss.deploy.dir}"/>	

    <delete dir="${tmp.dir}" />	 
 </target>
  
  
  <target name="install-JDBC-driver" description="Copy Postgresql JDBC Driver into JBOSS deploy dir." >
    <echo message="Postgresql JDBC Driver into JBOSS deploy dir"/> 

    <copy   todir="${jboss.deploy.dir}">
      <fileset dir="${compiletime.lib.dir}"> 
        <include name="postgres*.jar"/>
      </fileset>
    </copy>
  </target>  
  
</project>
