build.xml
author Adrián Romero <adrian.romero@openbravo.com>
Thu, 06 Dec 2007 15:50:10 +0000
changeset 171 c56f20417392
parent 164 eedafc9e1b8f
child 179 f1adca24a8cc
permissions -rw-r--r--
Bug fixed: [ 1845598 ] Task to compare database model and database created
<?xml version="1.0" encoding="UTF-8" ?>
<!--
 *************************************************************************
 * The contents of this file are subject to the Openbravo  Public  License
 * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
 * Version 1.1  with a permitted attribution clause; you may not  use this
 * file except in compliance with the License. You  may  obtain  a copy of
 * the License at http://www.openbravo.com/legal/license.html 
 * Software distributed under the License  is  distributed  on  an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific  language  governing  rights  and  limitations
 * under the License. 
 * The Original Code is Openbravo ERP. 
 * The Initial Developer of the Original Code is Openbravo SL 
 * All portions are Copyright (C) 2001-2006 Openbravo SL 
 * All Rights Reserved. 
 * Contributor(s):  ______________________________________.
 ************************************************************************
-->

<project name="openbravo" default="compile.complete" basedir=".">
  <property environment="env"/>
  <property file="config/Openbravo.properties"/>
  <property name="separator" value="/"/>

  <property name="base.context" value="${base.source}/WebContent"/>
  <property name="context.name" value="openbravo"/>
  <property name="jakarta.home" value="${env.CATALINA_HOME}"/>
  <property name="build.core.lib" value="${base.source}/src-core/lib"/>
  <property name="build.trl.lib" value="${base.source}/src-trl/lib"/>
  <property name="build.wad.lib" value="${base.source}/src-wad/lib"/>
  <condition property="jakarta.base" value="${env.CATALINA_BASE}" else="${jakarta.home}">
    <and>
      <isset property="env.CATALINA_BASE"/>
    </and>
  </condition>
  <property name="log.path" value="${jakarta.base}/logs"/>
  <property name="base.src" value="${base.source}${separator}src"/>
  <property name="base.design" value="${base.context}/src-loc"/>
  <property name="base.web" value="${base.source}${separator}web"/>
  <property name="base.wad" value="${base.source}${separator}src-wad"/>
  <property name="build" value="${base.source}${separator}build${separator}classes"/>
  <property name="build.AD" value="${base.source}${separator}srcAD"/>
  <property name="build.sqlc" value="${base.source}${separator}build${separator}javasqlc"/>
  <property name="build.docs" value="${base.source}${separator}docs${separator}api"/>
  <property name="lib" value="${jakarta.home}${separator}common"/>
  <property name="base.lib" value="${base.source}${separator}lib"/>
  <property name="base.config" value="${base.source}${separator}config"/>
  <property name="jakarta.context" value="${jakarta.base}${separator}webapps${separator}openbravo"/>
  <property name="base.client.src" value="${base.source}${separator}srcClient"/>
  <property name="build.maxmemory" value="512M"/>
  <property name="debug.level" value="false"/>

  <condition property="shell.extension" value="bat" else="sh">
    <and>
      <os family="windows"/>
    </and>
  </condition>

  <condition property="temp.folder" value="c:\Temp" else="/tmp">
    <and>
      <os family="windows"/>
    </and>
  </condition>

  <condition property="no.java.home" value="true">
    <not>
      <isset property="env.JAVA_HOME"/>
    </not>
  </condition>

  <path id="project.class.path">
    <pathelement path="${build}"/>
    <fileset dir="${base.lib}">
      <include name="**/*.jar"/>
    </fileset>
    <fileset dir="${build.core.lib}">
      <include name="openbravo-core.jar"/>
    </fileset>
    <fileset dir="${build.trl.lib}">
      <include name="openbravo-trl.jar"/>
    </fileset>
    <fileset dir="${build.wad.lib}">
      <include name="openbravo-wad.jar"/>
    </fileset>
  </path>

  <target name="init">
    <fail if="no.java.home" message="The environment variable JAVA_HOME is not set."/>
  </target>

  <target name="compile.complete" depends="init">
    <ant dir="${base.source}/src" target="compile.complete" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="compile" depends="init">
    <ant dir="${base.source}/src" target="compile" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="compile.complete.development" depends="init">
    <ant dir="${base.source}/src" target="compile.complete.development" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="compile.development" depends="init">
    <ant dir="${base.source}/src" target="compile.development" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="eclipse.compile" depends="init">
    <ant dir="${base.source}/src-core" target="build.jar" inheritAll="true" inheritRefs="true"/>
    <ant dir="${base.source}/src-trl" target="build.jar" inheritAll="true" inheritRefs="true"/>
    <ant dir="${base.source}/src-wad" target="build.jar" inheritAll="true" inheritRefs="true"/>
    <ant dir="${base.source}/src" target="eclipse.compile" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="eclipse.compile.complete" depends="init">
    <ant dir="${base.source}/src-core" target="build.jar" inheritAll="true" inheritRefs="true"/>
    <ant dir="${base.source}/src-trl" target="build.jar" inheritAll="true" inheritRefs="true"/>
    <ant dir="${base.source}/src-wad" target="build.jar" inheritAll="true" inheritRefs="true"/>
    <ant dir="${base.source}/src" target="eclipse.compile.complete" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="compile.src" depends="init">
    <ant dir="${base.source}/src" target="compile.src" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="war" depends="init">
    <ant dir="${base.source}${separator}src" target="build.war" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="core.docs" depends="init">
    <ant dir="${base.source}${separator}src-core" target="doc" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="core.lib" depends="init">
    <ant dir="${base.source}${separator}src-core" target="build" inheritAll="true" inheritRefs="true"/>
    <copy file="${base.source}/src-core/lib/openbravo-core.jar" todir="${base.lib}" overwrite="true" failonerror="false"/>
  </target>

  <target name="eclipse.wad.lib" depends="init">
    <ant dir="${base.source}${separator}src-wad" target="sqlc" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="wad.docs" depends="init">
    <ant dir="${base.source}${separator}src-wad" target="doc" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="wad.lib" depends="init">
    <ant dir="${base.source}${separator}src-wad" target="build" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="eclipse.trl.lib" depends="init">
    <ant dir="${base.source}${separator}src-trl" target="sqlc" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="trl.docs" depends="init">
    <ant dir="${base.source}${separator}src-trl" target="doc" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="trl.lib" depends="init">
    <ant dir="${base.source}${separator}src-trl" target="build" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="database.lib" depends="init">
    <ant dir="${base.source}${separator}src-db" target="jar" inheritAll="true" inheritRefs="true"/>
    <copy file="${base.source}/src-db/build/lib/dbmanager.jar" todir="${base.source}/database/lib" overwrite="true" failonerror="false"/>
  </target>

  <target name="installWebService" depends="init">
    <ant dir="${base.source}/src" target="installWebService" inheritAll="true" inheritRefs="true">
      <property name="wsdd" value="1"/>
    </ant>
  </target>

  <target name="uninstallWebService" depends="init">
    <ant dir="${base.subversin}/src" target="uninstallWebService" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="preinstall" depends="init">
    <ant dir="${base.source}/bdutil" target="build" inheritAll="true" inheritRefs="true"/>
    <ant dir="${base.source}/bdutil" target="preinstall" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="preinstall.complete" depends="init">
    <ant dir="${base.source}/bdutil" target="build" inheritAll="true" inheritRefs="true"/>
    <ant dir="${base.source}/bdutil" target="preinstall_complete" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="install" depends="init">
    <ant dir="${base.source}/install" target="build" inheritAll="true" inheritRefs="true"/>
    <ant dir="${base.source}/install" target="install" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="deploy" depends="init">
    <copy file="${base.lib}/${context.name}.war" todir="${jakarta.base}/webapps"/>
  </target>

  <target name="install.source" depends="init">
    <antcall target="database.lib"/>
    <ant dir="${base.source}/database" target="create.database" inheritAll="true" inheritRefs="true"/>
    <antcall target="core.lib"/>
    <antcall target="wad.lib"/>
    <antcall target="trl.lib"/>
    <antcall target="compile.complete"/>
    <antcall target="installWebService"/>
    <antcall target="war"/>
  </target>

  <target name="eclipse.install.source" depends="init">
    <antcall target="database.lib"/>
    <ant dir="${base.source}/database" target="create.database" inheritAll="true" inheritRefs="true"/>
    <antcall target="core.lib"/>
    <antcall target="wad.lib"/>
    <antcall target="trl.lib"/>
    <antcall target="compile.complete"/>
    <antcall target="installWebService"/>
  </target>

  <target name="create.database" depends="init">
    <antcall target="database.lib"/>
    <ant dir="${base.source}/database" target="create.database" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="update.database" depends="init">
    <ant dir="${base.source}/database" target="update.database" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="create.database.structure" depends="init">
    <ant dir="${base.source}/database" target="create.database.structure" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="update.database.structure" depends="init">
    <ant dir="${base.source}/database" target="update.database.structure" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="create.database.script" depends="init">
    <ant dir="${base.source}/database" target="create.database.script" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="update.database.script" depends="init">
    <ant dir="${base.source}/database" target="update.database.script" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="export.database" depends="init">
    <ant dir="${base.source}/database" target="export.database.structure" inheritAll="true" inheritRefs="true"/>
    <ant dir="${base.source}/database" target="export.database.data" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="export.database.structure" depends="init">
    <ant dir="${base.source}/database" target="export.database.structure" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="export.database.data" depends="init">
    <ant dir="${base.source}/database" target="export.database.data" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="import.database.data" depends="init">
    <ant dir="${base.source}/database" target="import.database.data" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="export.database.sampledata" depends="init">
    <ant dir="${base.source}/database" target="export.database.sampledata" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="import.database.sampledata" depends="init">
    <ant dir="${base.source}/database" target="import.database.sampledata" inheritAll="true" inheritRefs="true"/>
  </target>
	
	  <target name="trl.clean">
	  	<ant dir="${base.subversion}/src" target="trl.clean" inheritAll="true" inheritRefs="true"/>
	  </target>
	
	  <target name="translate">
	  	<ant dir="${base.subversion}/src" target="translate" inheritAll="true" inheritRefs="true"/>
	  </target>

  <target name="save.database.model" depends="init">
    <ant dir="${base.source}/database" target="save.database.model" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="compare.database.structure" depends="init">
    <ant dir="${base.source}/database" target="compare.database.structure" inheritAll="true" inheritRefs="true"/>
  </target>

</project>