Tuesday, September 16, 2008

automating creation of Cross Reference(Xreftool) tables using ant

I had used an ant script to create cross reference tables in one of my projects .I am sharing the code so that it will be useful. This good thing if you have an ant script is that you can create cross reference tables on different environment by modifying the build.properties.


<project name="XrefTest" default="install" basedir=".">

<!-- First override from build.properties in process.dir, if available -->

<property file="build.properties"/>

<target name="checkEnv">

<condition property="bat.or.sh" value="bat" >

<os family="windows" />


<condition property="bat.or.sh" value="sh" >

<os family="unix" />


<condition property="windows.or.unix" value="cmd.exe" >

<os family="windows" />


<condition property="windows.or.unix" value="/bin/sh" >

<os family="unix" />


<condition property=" fileName" value="/c xreftool.${bat.or.sh} -f createtable.txt" >

<os family="windows" />


<condition property=" fileName" value="xreftool.${bat.or.sh} -f createtable.txt" >

<os family="unix" />



<target name="install" depends="checkEnv">

<exec dir="${esb.bin.path}" executable="${windows.or.unix}">

<env key="DB_URL" value="${DB_URL}"/>

<env key="DB_USER" value="${DB_USER}"/>

<env key="DB_PASSWORD" value="${DB_PASSWORD}"/>

<env key="OC4J_USERNAME" value="${OC4J_USERNAME}"/>

<env key="OC4J_PASSWORD" value="${OC4J_PASSWORD}"/>

<arg line="${fileName}"/>





oracle.home="your oracle home"

esb.bin.path="${ oracle.home } \\integration\\esb\\bin"







createTable TESTTABLE1

addColumns TESTTABLE1 sfdc_id,ebiz_id,ref_id

No comments: