build.xml
author Antonio Moreno <antonio.moreno@openbravo.com>
Wed, 14 May 2008 15:05:59 +0000
changeset 905 40b6c5195307
parent 903 0ce6e1b8e53f
child 1062 d0dd1d1fbd18
permissions -rw-r--r--
Fixed problem with the build.xml files. Update.database didn't call postcreate task.
<?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):  ______________________________________.
 ************************************************************************
-->
<!--
List of targets:

init: checks if exists the JAVA_HOME var.
compile.complete: refer to compile.complete target of src.
compile: refer to compile target of src.
compile.complete.development: refer to compile.complete.development target of src.
compile.development: refer to compile.development target of src.
eclipse.compile: refer to eclipse.compile target of src.
eclipse.compile.complete: refer to eclipse.compile.complete target of src.
compile.src: refer to compile.src target of src.
war: refer to build.war target of src.
core.docs: refer to doc target of src-core.
core.lib: refer to build target of src-core.
eclipse.wad.lib: refer to sqlc target of src-wad.
wad.docs: refer to doc target of src-wad.
wad.lib: refer to build target of src-wad.
eclipse.trl.lib: refer to sqlc target of src-trl.
trl.docs: refer to doc target of src-trl.
trl.lib: refer to build target of src-trl.
database.lib: refer to jar target of src-db.
clean: refer to clean target of src.
trl.clean: refer to trl.clean target of src.
translate: refer to translate target of src.
installWebService: refer to installWebService target of src.
uninstallWebService: refer to uninstallWebService target of src.
preinstall: deprecated.
preinstall.complete: deprecated.
install: deprecated.
deploy: copy war to the jakarta context.
install.source: install the ERP from sources (from subversion).
eclipse.install.source: install the ERP from sources for eclipse (from subversion).
create.database: refer to create.database target of database.
update.database: refer to update.database target of database.
create.database.structure: refer to create.database.structure target of database.
update.database.structure: refer to update.database.structure target of database.
create.database.script: refer to create.database.script target of database.
update.database.script: refer to update.database.script target of database.
export.database: exports database structure and data to xml files.
export.database.structure: refer to export.database.structure target of database.
export.database.data: refer to export.database.data target of database.
import.database.data: refer to import.database.data target of database.
export.database.sampledata: refer to export.database.sampledata target of database.
import.database.sampledata: refer to import.database.sampledata target of database.
export.database.masterdata: refer to export.database.masterdata target of database.
import.database.masterdata: refer to import.database.masterdata target of database.
save.database.model: refer to save.database.model target of database.
compare.database.structure: refer to compare.database.structure target of database.
-->
<project name="openbravo" default="compile.complete" basedir=".">
  <property environment="env"/>
  <property name="base.config" location="config"/>
  <property file="${base.config}/Openbravo.properties"/>

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

  <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="code.rev">
  <loadfile property="svn.entries" srcFile=".svn/entries" failonerror="false">
    <filterchain>
      <filterreader classname="org.apache.tools.ant.filters.HeadFilter">
        <param name="skip" value="3"/>
        <param name="lines" value="1"/>
      </filterreader>
    </filterchain>
  	<filterchain>
      <filterreader classname="org.apache.tools.ant.filters.StripLineBreaks" />
    </filterchain>
  </loadfile>
  <condition property="code.revision" value="${svn.entries}" else ="0">
  	<and>
      <isset property="svn.entries" />
  	</and>
  </condition>    
 </target>


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  <target name="uninstallWebService" depends="init">
    <ant dir="${base.src}" target="uninstallWebService" 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.db}" 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="war"/>
  </target>

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

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

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

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

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

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

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

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

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

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

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

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

  <target name="import.database.sampledata" depends="init,code.rev">
    <ant dir="${base.db}" target="import.database.sampledata" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="export.database.masterdata" depends="init,code.rev">
    <ant dir="${base.db}" target="export.database.masterdata" inheritAll="true" inheritRefs="true"/>
  </target>

  <target name="import.database.masterdata" depends="init,code.rev">
    <ant dir="${base.db}" target="import.database.masterdata" inheritAll="true" inheritRefs="true"/>
  </target>

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

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

</project>