build.xml
author Stefan Hühner <stefan.huehner@openbravo.com>
Mon, 26 Nov 2007 18:16:21 +0000
changeset 124 e202022fd2fd
parent 98 8e1fa3bfbf21
child 125 471aee945a8f
permissions -rw-r--r--
ant a new init-task which is depended on from all other targets
check if JAVA_HOME is set in the init task to produce a better error message if it is not
asier@43
     1
<?xml version="1.0" encoding="UTF-8" ?>
asier@43
     2
<!--
asier@43
     3
 *************************************************************************
asier@43
     4
 * The contents of this file are subject to the Openbravo  Public  License
asier@43
     5
 * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
asier@43
     6
 * Version 1.1  with a permitted attribution clause; you may not  use this
asier@43
     7
 * file except in compliance with the License. You  may  obtain  a copy of
asier@43
     8
 * the License at http://www.openbravo.com/legal/license.html 
asier@43
     9
 * Software distributed under the License  is  distributed  on  an "AS IS"
asier@43
    10
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
asier@43
    11
 * License for the specific  language  governing  rights  and  limitations
asier@43
    12
 * under the License. 
asier@43
    13
 * The Original Code is Openbravo ERP. 
asier@43
    14
 * The Initial Developer of the Original Code is Openbravo SL 
asier@43
    15
 * All portions are Copyright (C) 2001-2006 Openbravo SL 
asier@43
    16
 * All Rights Reserved. 
asier@43
    17
 * Contributor(s):  ______________________________________.
asier@43
    18
 ************************************************************************
asier@43
    19
-->
asier@43
    20
asier@43
    21
<project name="openbravo" default="compile.complete" basedir=".">
asier@43
    22
	<property environment="env"/>
asier@43
    23
	<property file="config/Openbravo.properties"/>
asier@43
    24
  <property name="separator" value="/"/>
asier@43
    25
  <property name="base.subversion" value="${base.source}"/>
asier@43
    26
  
asier@43
    27
  <property name="base.context" value="${base.subversion}/WebContent"/>
asier@43
    28
  <property name="context.name" value="openbravo"/>
asier@43
    29
  <property name="jakarta.home" value="${env.CATALINA_HOME}"/>
asier@43
    30
  <property name="build.core.lib" value="${base.subversion}/src-core/lib"/>
asier@43
    31
  <property name="build.trl.lib" value="${base.subversion}/src-trl/lib"/>
asier@43
    32
  <property name="build.wad.lib" value="${base.subversion}/src-wad/lib"/>
asier@43
    33
  <condition property="jakarta.base" value="${env.CATALINA_BASE}" else="${jakarta.home}">
asier@43
    34
    <and>
asier@43
    35
      <isset property="env.CATALINA_BASE"/>
asier@43
    36
    </and>
asier@43
    37
  </condition>
asier@43
    38
  <property name="log.path" value="${jakarta.base}/logs"/>
asier@43
    39
  <property name="base.src" value="${base.subversion}${separator}src"/>
asier@43
    40
  <property name="base.design" value="${base.context}/src-loc"/>
asier@43
    41
  <property name="base.web" value="${base.subversion}${separator}web"/>
asier@43
    42
  <property name="base.wad" value="${base.source}${separator}src-wad"/>
asier@43
    43
  <property name="build" value="${base.source}${separator}build${separator}classes"/>
asier@43
    44
  <property name="build.AD" value="${base.source}${separator}srcAD"/>
asier@43
    45
  <property name="build.sqlc" value="${base.source}${separator}build${separator}javasqlc"/>
asier@43
    46
  <property name="build.docs" value="${base.source}${separator}docs${separator}api"/>
asier@43
    47
  <property name="lib" value="${jakarta.home}${separator}common"/>
asier@43
    48
  <property name="base.lib" value="${base.subversion}${separator}lib"/>
asier@43
    49
  <property name="base.config" value="${base.subversion}${separator}config"/>
asier@43
    50
  <property name="jakarta.context" value="${jakarta.base}${separator}webapps${separator}openbravo"/>
asier@43
    51
  <property name="base.client.src" value="${base.source}${separator}srcClient"/>
asier@43
    52
  <property name="client" value="download"/>
asier@43
    53
  <property name="release_dir" value="/opt/AppsPublicRelease/release"/>
asier@43
    54
  <property name="release_fonts" value="/opt/download"/>
asier@43
    55
  <property name="release_dest" value="/opt/release"/>
asier@43
    56
  <property name="release" value="2.12"/>
asier@43
    57
  <property name="fileRelease" value="/opt/FileRelease"/>
asier@43
    58
  <property name="documentation" value="/opt/documentation"/>
asier@43
    59
  <property name="demo_dest" value="/opt/demo"/>
asier@43
    60
  <property name="demo_client" value="demo"/>
asier@43
    61
  <property name="demo_dir" value="/opt/AppsPublicRelease/demo"/>
asier@43
    62
  <property name="build.maxmemory" value="512M"/>
asier@43
    63
  <property name="debug.level" value="false"/>
asier@43
    64
asier@43
    65
  <condition property="shell.extension" value="bat" else="sh">
asier@43
    66
    <and>
asier@43
    67
      <os family="windows"/>
asier@43
    68
    </and>
asier@43
    69
  </condition>
asier@43
    70
asier@43
    71
  <condition property="temp.folder" value="c:\Temp" else="/tmp">
asier@43
    72
        <and>
asier@43
    73
                <os family="windows"/>
asier@43
    74
        </and>
asier@43
    75
  </condition>
asier@43
    76
stefan@124
    77
  <condition property="no.java.home" value="true">
stefan@124
    78
    <not>
stefan@124
    79
      <isset property="${env.JAVA_HOME}"/>
stefan@124
    80
    </not>
stefan@124
    81
  </condition>
stefan@124
    82
asier@43
    83
  <path id="project.class.path">
asier@43
    84
    <pathelement path="${build}"/>
asier@43
    85
    <fileset dir="${base.lib}">
asier@43
    86
      <include name="**/*.jar"/>
asier@43
    87
    </fileset>
asier@43
    88
    <fileset dir="${build.core.lib}">
asier@43
    89
      <include name="openbravo-core.jar"/>
asier@43
    90
    </fileset>
asier@43
    91
    <fileset dir="${build.trl.lib}">
asier@43
    92
      <include name="openbravo-trl.jar"/>
asier@43
    93
    </fileset>
asier@43
    94
    <fileset dir="${build.wad.lib}">
asier@43
    95
      <include name="openbravo-wad.jar"/>
asier@43
    96
    </fileset>
asier@43
    97
  </path>
asier@43
    98
stefan@124
    99
  <target name="init">
stefan@124
   100
    <fail if="no.java.home" message="The environment variable JAVA_HOME is not set."/>
stefan@124
   101
  </target>
stefan@124
   102
stefan@124
   103
  <target name="compile.complete" depends="init">
asier@43
   104
    <ant dir="${base.subversion}/src" target="compile.complete" inheritAll="true" inheritRefs="true"/>
asier@43
   105
  </target>
asier@43
   106
stefan@124
   107
  <target name="compile" depends="init">
asier@43
   108
    <ant dir="${base.subversion}/src" target="compile" inheritAll="true" inheritRefs="true"/>
asier@43
   109
  </target>
asier@43
   110
stefan@124
   111
  <target name="compile.complete.development" depends="init">
asier@43
   112
    <ant dir="${base.subversion}/src" target="compile.complete.development" inheritAll="true" inheritRefs="true"/>
asier@43
   113
  </target>
asier@43
   114
stefan@124
   115
  <target name="compile.development" depends="init">
asier@43
   116
    <ant dir="${base.subversion}/src" target="compile.development" inheritAll="true" inheritRefs="true"/>
asier@43
   117
  </target>
asier@43
   118
stefan@124
   119
  <target name="eclipse.compile" depends="init">
asier@43
   120
    <ant dir="${base.subversion}/src-core" target="build.jar" inheritAll="true" inheritRefs="true"/>
asier@43
   121
    <ant dir="${base.subversion}/src-trl" target="build.jar" inheritAll="true" inheritRefs="true"/>
asier@43
   122
    <ant dir="${base.subversion}/src-wad" target="build.jar" inheritAll="true" inheritRefs="true"/>
asier@43
   123
    <ant dir="${base.subversion}/src" target="eclipse.compile" inheritAll="true" inheritRefs="true"/>
asier@43
   124
  </target>
asier@43
   125
stefan@124
   126
  <target name="eclipse.compile.complete" depends="init">
asier@43
   127
    <ant dir="${base.subversion}/src-core" target="build.jar" inheritAll="true" inheritRefs="true"/>
asier@43
   128
    <ant dir="${base.subversion}/src-trl" target="build.jar" inheritAll="true" inheritRefs="true"/>
asier@43
   129
    <ant dir="${base.subversion}/src-wad" target="build.jar" inheritAll="true" inheritRefs="true"/>
asier@43
   130
    <ant dir="${base.subversion}/src" target="eclipse.compile.complete" inheritAll="true" inheritRefs="true"/>
asier@43
   131
  </target>
asier@43
   132
stefan@124
   133
  <target name="compile.src" depends="init">
asier@43
   134
    <ant dir="${base.subversion}/src" target="compile.src" inheritAll="true" inheritRefs="true"/>
asier@43
   135
  </target>
asier@43
   136
stefan@124
   137
  <target name="war" depends="init">
asier@43
   138
    <ant dir="${base.subversion}${separator}src" target="build.war" inheritAll="true" inheritRefs="true"/>
asier@43
   139
  </target>
asier@43
   140
stefan@124
   141
  <target name="core.docs" depends="init">
asier@43
   142
    <ant dir="${base.subversion}${separator}src-core" target="doc" inheritAll="true" inheritRefs="true"/>
asier@43
   143
  </target>
asier@43
   144
  
stefan@124
   145
  <target name="core.lib" depends="init">
asier@43
   146
    <ant dir="${base.subversion}${separator}src-core" target="build" inheritAll="true" inheritRefs="true"/>
asier@43
   147
    <copy file="${base.subversion}/src-core/lib/openbravo-core.jar" todir="${base.lib}" overwrite="true" failonerror="false"/>
asier@43
   148
  </target>
asier@43
   149
  
stefan@124
   150
  <target name="eclipse.wad.lib" depends="init">
asier@43
   151
    <ant dir="${base.subversion}${separator}src-wad" target="sqlc" inheritAll="true" inheritRefs="true"/>
asier@43
   152
  </target>
asier@43
   153
  
stefan@124
   154
  <target name="wad.docs" depends="init">
asier@43
   155
    <ant dir="${base.subversion}${separator}src-wad" target="doc" inheritAll="true" inheritRefs="true"/>
asier@43
   156
  </target>
asier@43
   157
  
stefan@124
   158
  <target name="wad.lib" depends="init">
asier@43
   159
    <ant dir="${base.subversion}${separator}src-wad" target="build" inheritAll="true" inheritRefs="true"/>
asier@43
   160
  </target>
asier@43
   161
  
stefan@124
   162
  <target name="eclipse.trl.lib" depends="init">
asier@43
   163
    <ant dir="${base.subversion}${separator}src-trl" target="sqlc" inheritAll="true" inheritRefs="true"/>
asier@43
   164
  </target>
asier@43
   165
  
stefan@124
   166
  <target name="trl.docs" depends="init">
asier@43
   167
    <ant dir="${base.subversion}${separator}src-trl" target="doc" inheritAll="true" inheritRefs="true"/>
asier@43
   168
  </target>
asier@43
   169
  
stefan@124
   170
  <target name="trl.lib" depends="init">
asier@43
   171
    <ant dir="${base.subversion}${separator}src-trl" target="build" inheritAll="true" inheritRefs="true"/>
asier@43
   172
    <!--copy file="${base.subversion}/src-trl/lib/openbravo-trl.jar" todir="${base.lib}" overwrite="true" failonerror="false"/-->
asier@43
   173
  </target>
asier@43
   174
  
stefan@124
   175
  <target name="database.lib" depends="init">
asier@43
   176
    <ant dir="${base.subversion}${separator}src-db" target="jar" inheritAll="true" inheritRefs="true"/>
asier@43
   177
    <copy file="${base.subversion}/src-db/build/lib/dbmanager.jar" todir="${base.subversion}/database/lib" overwrite="true" failonerror="false"/>
asier@43
   178
  </target>
asier@43
   179
stefan@124
   180
  <target name="installWebService" depends="init">
asier@43
   181
    <ant dir="${base.subversion}/src" target="installWebService" inheritAll="true" inheritRefs="true">
asier@43
   182
      <property name="wsdd" value="1"/>
asier@43
   183
    </ant>
asier@43
   184
  </target>
asier@43
   185
stefan@124
   186
  <target name="uninstallWebService" depends="init">
asier@43
   187
    <ant dir="${base.subversin}/src" target="uninstallWebService" inheritAll="true" inheritRefs="true"/>
asier@43
   188
  </target>
asier@43
   189
stefan@124
   190
  <target name="preinstall" depends="init">
asier@43
   191
    <ant dir="${base.subversion}/bdutil" target="build" inheritAll="true" inheritRefs="true"/>
asier@43
   192
    <ant dir="${base.subversion}/bdutil" target="preinstall" inheritAll="true" inheritRefs="true"/>
asier@43
   193
  </target>
asier@43
   194
stefan@124
   195
  <target name="preinstall.complete" depends="init">
asier@43
   196
    <ant dir="${base.subversion}/bdutil" target="build" inheritAll="true" inheritRefs="true"/>
asier@43
   197
    <ant dir="${base.subversion}/bdutil" target="preinstall_complete" inheritAll="true" inheritRefs="true"/>
asier@43
   198
  </target>
asier@43
   199
stefan@124
   200
  <target name="install" depends="init">
asier@43
   201
    <ant dir="${base.subversion}/install" target="build" inheritAll="true" inheritRefs="true"/>
asier@43
   202
    <ant dir="${base.subversion}/install" target="install" inheritAll="true" inheritRefs="true"/>
asier@43
   203
  </target>
asier@43
   204
stefan@124
   205
  <target name="deploy" depends="init">
asier@43
   206
    <copy file="${base.lib}/${context.name}.war" todir="${jakarta.base}/webapps"/>
asier@43
   207
  </target>
asier@43
   208
stefan@124
   209
  <target name="install.source" depends="init">
asier@43
   210
    <antcall target="database.lib"/>
rafael@47
   211
  	<ant dir="${base.subversion}/database" target="create.database" inheritAll="true" inheritRefs="true"/>
asier@43
   212
    <antcall target="core.lib"/>
asier@43
   213
    <antcall target="wad.lib"/>
asier@43
   214
    <antcall target="trl.lib"/>
asier@43
   215
    <antcall target="compile.complete"/>
asier@43
   216
    <antcall target="installWebService"/>
asier@43
   217
    <antcall target="war"/>
asier@43
   218
  </target>
asier@43
   219
  
stefan@124
   220
  <target name="eclipse.install.source" depends="init">
rafael@47
   221
	<antcall target="database.lib"/>
asier@43
   222
    <ant dir="${base.subversion}/database" target="create.database" inheritAll="true" inheritRefs="true"/>
asier@43
   223
    <antcall target="core.lib"/>
asier@43
   224
    <antcall target="wad.lib"/>
asier@43
   225
    <antcall target="trl.lib"/>
asier@43
   226
    <antcall target="compile.complete"/>
asier@43
   227
    <antcall target="installWebService"/>
asier@43
   228
  </target>
asier@43
   229
stefan@124
   230
    <target name="create.database" depends="init">
rafael@48
   231
    	<antcall target="database.lib"/>
rafael@48
   232
    	<ant dir="${base.subversion}/database" target="create.database" inheritAll="true" inheritRefs="true"/>
asier@43
   233
    </target>
asier@43
   234
stefan@124
   235
    <target name="update.database" depends="init">
asier@43
   236
        <ant dir="${base.subversion}/database" target="update.database" inheritAll="true" inheritRefs="true"/>   
asier@43
   237
   </target>
asier@43
   238
stefan@124
   239
    <target name="create.database.structure" depends="init">
asier@43
   240
        <ant dir="${base.subversion}/database" target="create.database.structure" inheritAll="true" inheritRefs="true"/>
asier@43
   241
    </target>
asier@43
   242
stefan@124
   243
    <target name="update.database.structure" depends="init">
asier@43
   244
        <ant dir="${base.subversion}/database" target="update.database.structure" inheritAll="true" inheritRefs="true"/>   
asier@43
   245
   </target>
asier@43
   246
stefan@124
   247
    <target name="create.database.script" depends="init">
asier@43
   248
        <ant dir="${base.subversion}/database" target="create.database.script" inheritAll="true" inheritRefs="true"/>
asier@43
   249
    </target>
asier@43
   250
stefan@124
   251
    <target name="update.database.script" depends="init">
asier@43
   252
        <ant dir="${base.subversion}/database" target="update.database.script" inheritAll="true" inheritRefs="true"/>   
asier@43
   253
   </target>
adrian@97
   254
stefan@124
   255
    <target name="export.database.structure" depends="init">
adrian@97
   256
        <ant dir="${base.subversion}/database" target="export.database.structure" inheritAll="true" inheritRefs="true"/>
adrian@97
   257
    </target>
asier@43
   258
    
stefan@124
   259
    <target name="export.database.data" depends="init">
asier@43
   260
        <ant dir="${base.subversion}/database" target="export.database.data" inheritAll="true" inheritRefs="true"/>
asier@43
   261
    </target>
asier@43
   262
    
stefan@124
   263
    <target name="import.database.data" depends="init">
asier@43
   264
        <ant dir="${base.subversion}/database" target="import.database.data" inheritAll="true" inheritRefs="true"/>
asier@43
   265
    </target>
asier@43
   266
stefan@124
   267
    <target name="export.database.sampledata" depends="init">
asier@43
   268
        <ant dir="${base.subversion}/database" target="export.database.sampledata" inheritAll="true" inheritRefs="true"/>
asier@43
   269
    </target>
asier@43
   270
stefan@124
   271
    <target name="import.database.sampledata" depends="init">
asier@43
   272
        <ant dir="${base.subversion}/database" target="import.database.sampledata" inheritAll="true" inheritRefs="true"/>
asier@43
   273
    </target>
asier@43
   274
stefan@124
   275
    <target name="save.database.model" depends="init">
asier@43
   276
        <ant dir="${base.subversion}/database" target="save.database.model" inheritAll="true" inheritRefs="true"/>
asier@43
   277
    </target>
asier@43
   278
asier@43
   279
</project>