core-jgi/org.adempiere.install/Adempiere/build.xml

178 lines
6.8 KiB
XML

<!-- ====================================================== -->
<!-- Adempiere Distribution Setup -->
<!-- ====================================================== -->
<!-- $Header: /cvs/adempiere/install/Adempiere/build.xml,v 1.4 2006/07/03 16:51:31 jjanke Exp $-->
<project name="setup" default="setup" basedir=".">
<description>
This buildfile is used to setup the Adempiere Environment.
</description>
<property environment="env" />
<property name="envFile" value="AdempiereEnv.properties" />
<property name="server" value="nas" />
<patternset id="manifest.exclude">
<exclude name="META-INF/*.DSA"/>
<exclude name="META-INF/*.RSA"/>
<exclude name="META-INF/*.SF"/>
<exclude name="META-INF/MANIFEST.MF"/>
<exclude name="META-INF/INDEX.LIST"/>
</patternset>
<!-- ==================================================== -->
<!-- Init -->
<!-- ==================================================== -->
<target name="setupInit"
description="initialization target">
<echo message="Adempiere Server Setup ===================" />
<echo message="ADEMPIERE_HOME = ${env.ADEMPIERE_HOME}" />
<!-- create the time stamp and environment -->
<tstamp />
<available file="${envFile}" property="envFileExists" />
<fail message="**** RUN_setup was not successful - please re-run ****" unless="envFileExists" />
<property file="${envFile}"/>
<filter filtersfile="${envFile}" />
<echo message="Environment = ${envFile}" />
<echo message="Java VM = ${ADEMPIERE_JAVA_TYPE}" />
<echo message="Database = ${ADEMPIERE_DB_TYPE}" />
<!-- Environment variables -->
<condition property="isWindows">
<os family="windows" />
</condition>
<echo message="Windows=${isWindows}" />
<copy file="osgi/plugins/org.adempiere.tomcat.config/META-INF/tomcat/serverTemplate.xml"
tofile="osgi/plugins/org.adempiere.tomcat.config/META-INF/tomcat/server.xml" filtering="yes" overwrite="yes"/>
</target>
<!-- ==================================================== -->
<!-- Windows Setup -->
<!-- ==================================================== -->
<target name="setupWin" depends="setupInit" if="isWindows"
description="Windows Setup">
<!-- Filter files No Overwrite -->
<copy file="utils/myDBcopyTemplate.bat"
tofile="utils/myDBcopy.bat" filtering="yes" overwrite="no" />
<!-- Filter files Overwrite -->
<copy file="utils/myEnvironmentTemplate.bat"
tofile="utils/myEnvironment.bat" filtering="yes" overwrite="yes" />
<copy file="utils/RUN_GetAdempiereTemplate.bat"
tofile="utils/RUN_GetAdempiere.bat" filtering="yes" overwrite="yes" />
<copy file="utils/RUN_PutExportTemplate.bat"
tofile="utils/RUN_PutExport.bat" filtering="yes" overwrite="yes" />
<copy file="utils/RUN_WinEnvTemplate.bat"
tofile="utils/RUN_WinEnv.bat" filtering="yes" overwrite="yes" />
<delete>
<fileset dir="." includes="**/*.sh" excludes="RUN_Adempiere.sh" />
</delete>
</target>
<!-- ==================================================== -->
<!-- Non Windows Setup -->
<!-- ==================================================== -->
<target name="setupNonWin" depends="setupInit" unless="isWindows"
description="Non Windows Setup">
<!-- Filter files No Overwrite -->
<copy file="utils/myDBcopyTemplate.sh"
tofile="utils/myDBcopy.sh" filtering="yes" overwrite="no" />
<!-- Filter files Overwrite -->
<copy file="utils/myEnvironmentTemplate.sh"
tofile="utils/myEnvironment.sh" filtering="yes" overwrite="yes" />
<copy file="utils/RUN_GetAdempiereTemplate.sh"
tofile="utils/RUN_GetAdempiere.sh" filtering="yes" overwrite="yes" />
<copy file="utils/RUN_PutExportTemplate.sh"
tofile="utils/RUN_PutExport.sh" filtering="yes" overwrite="yes" />
<copy file="utils/RUN_UnixEnvTemplate.sh"
tofile="utils/RUN_UnixEnv.sh" filtering="yes" overwrite="yes" />
<!-- Fix OS stuff -->
<fixcrlf srcdir="." eol="lf" eof="remove" includes="**/*.sh" />
<chmod dir="." perm="ugo+x" includes="**/*.sh" />
<delete>
<fileset dir="." includes="*.bat" excludes="RUN_Adempiere.bat" />
<fileset dir="utils" includes="**/*.bat" />
</delete>
</target>
<!-- ==================================================== -->
<!-- Setup (Main) -->
<!-- ==================================================== -->
<target name="setup" depends="setupInit, setupWin, setupNonWin"
description="Setup Adempiere">
</target>
<!-- ==================================================== -->
<!-- Shutting down server, setting up adempiere and importing database -->
<!-- ==================================================== -->
<target name="cleanall" description="shutdown,settingup and importing database">
<echo message="================Adempiere Server Shutdown ===================" />
<echo message="OS = ${os.name}" />
<!-- Shutting down server by calling the RUN_Stop.bat or RUN_Stop.sh script in Adempiere dir -->
<exec dir="${env.ADEMPIERE_HOME}\utils" executable="cmd" os="Windows XP, Windows 2000, Windows NT" >
<arg line="/c RUN_Stop.bat"/>
</exec>
<exec dir="${env.ADEMPIERE_HOME}\utils" executable="/bin/sh" os="SunOS,unix">
<arg value="-c" />
<arg value="RUN_Stop.sh" />
</exec>
<echo message="================Adempiere Server Shutdown Complete===================" />
<sleep seconds="2"/>
<!-- Deleting all the log files, jboss dir and log dir in ${env.ADEMPIERE_HOME} directory -->
<delete>
<fileset dir="${env.ADEMPIERE_HOME}" includes="*.log" />
</delete>
<delete dir="${env.ADEMPIERE_HOME}\jboss" />
<delete dir="${env.ADEMPIERE_HOME}\log" />
<echo message="=========== ftp to nas and download the current build==============="/>
<ftp action= "get"
server="${server}"
userid="guest"
password="">
<fileset dir="${env.ADEMPIERE_HOME}">
<include name="**/Adempiere_253d.zip"/>
</fileset>
</ftp>
<!-- unzip and overwrite them and delete the downloaded directory -->
<unzip src="${env.ADEMPIERE_HOME}/Disk 1/Adempiere_253a.zip" dest="${env.ADEMPIERE_HOME}\..\" overwrite="yes" />
<delete dir="${env.ADEMPIERE_HOME}/Disk 1"/>
<echo message="======================Setup adempiere==============================" />
<ant inheritAll="false" dir="${env.ADEMPIERE_HOME}" target="setup"/>
<!-- Importing the database -->
<exec dir="${env.ADEMPIERE_HOME}\utils" executable="cmd" os="Windows XP, Windows 2000, Windows NT" >
<arg line="/c RUN_ImportAdempiere.bat"/>
</exec>
<exec dir="${env.ADEMPIERE_HOME}\utils" executable="/bin/sh" os="SunOS,unix">
<arg value="-c" />
<arg value="RUN_ImportAdempiere.sh" />
</exec>
</target>
</project>