build.xml
author Gorka Ion Damián <gorkaion.damian@openbravo.com>
Thu, 17 Jan 2008 16:27:39 +0000
changeset 345 337c99045b67
parent 305 b296d661c7c5
child 451 408c33b8ad40
permissions -rw-r--r--
BugFix[1873921] moved context.name property from build.xml to config/Openbravo.properties.template
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
-->
juanpablo@213
    20
<!--
juanpablo@213
    21
List of targets:
juanpablo@213
    22
juanpablo@213
    23
init: checks if exists the JAVA_HOME var.
juanpablo@213
    24
compile.complete: refer to compile.complete target of src.
juanpablo@213
    25
compile: refer to compile target of src.
juanpablo@213
    26
compile.complete.development: refer to compile.complete.development target of src.
juanpablo@213
    27
compile.development: refer to compile.development target of src.
juanpablo@213
    28
eclipse.compile: refer to eclipse.compile target of src.
juanpablo@213
    29
eclipse.compile.complete: refer to eclipse.compile.complete target of src.
juanpablo@213
    30
compile.src: refer to compile.src target of src.
juanpablo@213
    31
war: refer to build.war target of src.
juanpablo@213
    32
core.docs: refer to doc target of src-core.
juanpablo@213
    33
core.lib: refer to build target of src-core.
juanpablo@213
    34
eclipse.wad.lib: refer to sqlc target of src-wad.
juanpablo@213
    35
wad.docs: refer to doc target of src-wad.
juanpablo@213
    36
wad.lib: refer to build target of src-wad.
juanpablo@213
    37
eclipse.trl.lib: refer to sqlc target of src-trl.
juanpablo@213
    38
trl.docs: refer to doc target of src-trl.
juanpablo@213
    39
trl.lib: refer to build target of src-trl.
juanpablo@213
    40
database.lib: refer to jar target of src-db.
juanpablo@213
    41
clean: refer to clean target of src.
juanpablo@213
    42
trl.clean: refer to trl.clean target of src.
juanpablo@213
    43
translate: refer to translate target of src.
juanpablo@213
    44
installWebService: refer to installWebService target of src.
juanpablo@213
    45
uninstallWebService: refer to uninstallWebService target of src.
juanpablo@213
    46
preinstall: deprecated.
juanpablo@213
    47
preinstall.complete: deprecated.
juanpablo@213
    48
install: deprecated.
juanpablo@213
    49
deploy: copy war to the jakarta context.
juanpablo@213
    50
install.source: install the ERP from sources (from subversion).
juanpablo@213
    51
eclipse.install.source: install the ERP from sources for eclipse (from subversion).
juanpablo@213
    52
create.database: refer to create.database target of database.
juanpablo@213
    53
update.database: refer to update.database target of database.
juanpablo@213
    54
create.database.structure: refer to create.database.structure target of database.
juanpablo@213
    55
update.database.structure: refer to update.database.structure target of database.
juanpablo@213
    56
create.database.script: refer to create.database.script target of database.
juanpablo@213
    57
update.database.script: refer to update.database.script target of database.
juanpablo@213
    58
export.database: exports database structure and data to xml files.
juanpablo@213
    59
export.database.structure: refer to export.database.structure target of database.
juanpablo@213
    60
export.database.data: refer to export.database.data target of database.
juanpablo@213
    61
import.database.data: refer to import.database.data target of database.
juanpablo@213
    62
export.database.sampledata: refer to export.database.sampledata target of database.
juanpablo@213
    63
import.database.sampledata: refer to import.database.sampledata target of database.
juanpablo@213
    64
save.database.model: refer to save.database.model target of database.
juanpablo@213
    65
compare.database.structure: refer to compare.database.structure target of database.
fernando@202
    66
-->
asier@43
    67
<project name="openbravo" default="compile.complete" basedir=".">
juanpablo@131
    68
  <property environment="env"/>
juanpablo@131
    69
  <property file="config/Openbravo.properties"/>
asier@43
    70
  <property name="separator" value="/"/>
juanpablo@131
    71
juanpablo@131
    72
  <property name="base.context" value="${base.source}/WebContent"/>
asier@43
    73
  <property name="jakarta.home" value="${env.CATALINA_HOME}"/>
juanpablo@131
    74
  <property name="build.core.lib" value="${base.source}/src-core/lib"/>
juanpablo@131
    75
  <property name="build.trl.lib" value="${base.source}/src-trl/lib"/>
juanpablo@131
    76
  <property name="build.wad.lib" value="${base.source}/src-wad/lib"/>
asier@43
    77
  <condition property="jakarta.base" value="${env.CATALINA_BASE}" else="${jakarta.home}">
asier@43
    78
    <and>
asier@43
    79
      <isset property="env.CATALINA_BASE"/>
asier@43
    80
    </and>
asier@43
    81
  </condition>
asier@43
    82
  <property name="log.path" value="${jakarta.base}/logs"/>
juanpablo@131
    83
  <property name="base.src" value="${base.source}${separator}src"/>
asier@43
    84
  <property name="base.design" value="${base.context}/src-loc"/>
juanpablo@131
    85
  <property name="base.web" value="${base.source}${separator}web"/>
asier@43
    86
  <property name="base.wad" value="${base.source}${separator}src-wad"/>
asier@43
    87
  <property name="build" value="${base.source}${separator}build${separator}classes"/>
asier@43
    88
  <property name="build.AD" value="${base.source}${separator}srcAD"/>
asier@43
    89
  <property name="build.sqlc" value="${base.source}${separator}build${separator}javasqlc"/>
asier@43
    90
  <property name="build.docs" value="${base.source}${separator}docs${separator}api"/>
asier@43
    91
  <property name="lib" value="${jakarta.home}${separator}common"/>
juanpablo@131
    92
  <property name="base.lib" value="${base.source}${separator}lib"/>
juanpablo@131
    93
  <property name="base.config" value="${base.source}${separator}config"/>
asier@43
    94
  <property name="jakarta.context" value="${jakarta.base}${separator}webapps${separator}openbravo"/>
asier@43
    95
  <property name="base.client.src" value="${base.source}${separator}srcClient"/>
asier@43
    96
  <property name="build.maxmemory" value="512M"/>
asier@43
    97
  <property name="debug.level" value="false"/>
asier@43
    98
asier@43
    99
  <condition property="shell.extension" value="bat" else="sh">
asier@43
   100
    <and>
asier@43
   101
      <os family="windows"/>
asier@43
   102
    </and>
asier@43
   103
  </condition>
asier@43
   104
asier@43
   105
  <condition property="temp.folder" value="c:\Temp" else="/tmp">
juanpablo@131
   106
    <and>
juanpablo@131
   107
      <os family="windows"/>
juanpablo@131
   108
    </and>
asier@43
   109
  </condition>
asier@43
   110
stefan@124
   111
  <condition property="no.java.home" value="true">
stefan@124
   112
    <not>
stefan@125
   113
      <isset property="env.JAVA_HOME"/>
stefan@124
   114
    </not>
stefan@124
   115
  </condition>
stefan@124
   116
asier@43
   117
  <path id="project.class.path">
asier@43
   118
    <pathelement path="${build}"/>
asier@43
   119
    <fileset dir="${base.lib}">
asier@43
   120
      <include name="**/*.jar"/>
asier@43
   121
    </fileset>
asier@43
   122
    <fileset dir="${build.core.lib}">
asier@43
   123
      <include name="openbravo-core.jar"/>
asier@43
   124
    </fileset>
asier@43
   125
    <fileset dir="${build.trl.lib}">
asier@43
   126
      <include name="openbravo-trl.jar"/>
asier@43
   127
    </fileset>
asier@43
   128
    <fileset dir="${build.wad.lib}">
asier@43
   129
      <include name="openbravo-wad.jar"/>
asier@43
   130
    </fileset>
asier@43
   131
  </path>
asier@43
   132
stefan@124
   133
  <target name="init">
stefan@124
   134
    <fail if="no.java.home" message="The environment variable JAVA_HOME is not set."/>
stefan@124
   135
  </target>
stefan@124
   136
stefan@124
   137
  <target name="compile.complete" depends="init">
juanpablo@131
   138
    <ant dir="${base.source}/src" target="compile.complete" inheritAll="true" inheritRefs="true"/>
asier@43
   139
  </target>
asier@43
   140
stefan@124
   141
  <target name="compile" depends="init">
juanpablo@131
   142
    <ant dir="${base.source}/src" target="compile" inheritAll="true" inheritRefs="true"/>
asier@43
   143
  </target>
asier@43
   144
stefan@124
   145
  <target name="compile.complete.development" depends="init">
juanpablo@131
   146
    <ant dir="${base.source}/src" target="compile.complete.development" inheritAll="true" inheritRefs="true"/>
asier@43
   147
  </target>
asier@43
   148
stefan@124
   149
  <target name="compile.development" depends="init">
juanpablo@131
   150
    <ant dir="${base.source}/src" target="compile.development" inheritAll="true" inheritRefs="true"/>
asier@43
   151
  </target>
asier@43
   152
stefan@124
   153
  <target name="eclipse.compile" depends="init">
juanpablo@131
   154
    <ant dir="${base.source}/src-core" target="build.jar" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   155
    <ant dir="${base.source}/src-trl" target="build.jar" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   156
    <ant dir="${base.source}/src-wad" target="build.jar" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   157
    <ant dir="${base.source}/src" target="eclipse.compile" inheritAll="true" inheritRefs="true"/>
asier@43
   158
  </target>
asier@43
   159
stefan@124
   160
  <target name="eclipse.compile.complete" depends="init">
juanpablo@131
   161
    <ant dir="${base.source}/src-core" target="build.jar" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   162
    <ant dir="${base.source}/src-trl" target="build.jar" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   163
    <ant dir="${base.source}/src-wad" target="build.jar" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   164
    <ant dir="${base.source}/src" target="eclipse.compile.complete" inheritAll="true" inheritRefs="true"/>
asier@43
   165
  </target>
asier@43
   166
stefan@124
   167
  <target name="compile.src" depends="init">
juanpablo@131
   168
    <ant dir="${base.source}/src" target="compile.src" inheritAll="true" inheritRefs="true"/>
asier@43
   169
  </target>
asier@43
   170
stefan@124
   171
  <target name="war" depends="init">
juanpablo@131
   172
    <ant dir="${base.source}${separator}src" target="build.war" inheritAll="true" inheritRefs="true"/>
asier@43
   173
  </target>
asier@43
   174
stefan@124
   175
  <target name="core.docs" depends="init">
juanpablo@131
   176
    <ant dir="${base.source}${separator}src-core" target="doc" inheritAll="true" inheritRefs="true"/>
asier@43
   177
  </target>
juanpablo@131
   178
stefan@124
   179
  <target name="core.lib" depends="init">
juanpablo@131
   180
    <ant dir="${base.source}${separator}src-core" target="build" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   181
    <copy file="${base.source}/src-core/lib/openbravo-core.jar" todir="${base.lib}" overwrite="true" failonerror="false"/>
asier@43
   182
  </target>
juanpablo@131
   183
stefan@124
   184
  <target name="eclipse.wad.lib" depends="init">
juanpablo@131
   185
    <ant dir="${base.source}${separator}src-wad" target="sqlc" inheritAll="true" inheritRefs="true"/>
asier@43
   186
  </target>
juanpablo@131
   187
stefan@124
   188
  <target name="wad.docs" depends="init">
juanpablo@131
   189
    <ant dir="${base.source}${separator}src-wad" target="doc" inheritAll="true" inheritRefs="true"/>
asier@43
   190
  </target>
juanpablo@131
   191
stefan@124
   192
  <target name="wad.lib" depends="init">
juanpablo@131
   193
    <ant dir="${base.source}${separator}src-wad" target="build" inheritAll="true" inheritRefs="true"/>
asier@43
   194
  </target>
juanpablo@131
   195
stefan@124
   196
  <target name="eclipse.trl.lib" depends="init">
juanpablo@131
   197
    <ant dir="${base.source}${separator}src-trl" target="sqlc" inheritAll="true" inheritRefs="true"/>
asier@43
   198
  </target>
juanpablo@131
   199
stefan@124
   200
  <target name="trl.docs" depends="init">
juanpablo@131
   201
    <ant dir="${base.source}${separator}src-trl" target="doc" inheritAll="true" inheritRefs="true"/>
asier@43
   202
  </target>
juanpablo@131
   203
stefan@124
   204
  <target name="trl.lib" depends="init">
juanpablo@131
   205
    <ant dir="${base.source}${separator}src-trl" target="build" inheritAll="true" inheritRefs="true"/>
asier@43
   206
  </target>
juanpablo@131
   207
stefan@124
   208
  <target name="database.lib" depends="init">
juanpablo@131
   209
    <ant dir="${base.source}${separator}src-db" target="jar" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   210
    <copy file="${base.source}/src-db/build/lib/dbmanager.jar" todir="${base.source}/database/lib" overwrite="true" failonerror="false"/>
asier@43
   211
  </target>
asier@43
   212
juanpablo@179
   213
  <target name="clean" depends="init">
juanpablo@179
   214
    <ant dir="${base.source}/src" target="clean" inheritAll="true" inheritRefs="true"/>
juanpablo@179
   215
  </target>
juanpablo@179
   216
juanpablo@179
   217
  <target name="trl.clean" depends="init">
juanpablo@179
   218
    <ant dir="${base.source}/src" target="trl.clean" inheritAll="true" inheritRefs="true"/>
juanpablo@179
   219
  </target>
juanpablo@179
   220
juanpablo@179
   221
  <target name="translate" depends="init">
juanpablo@179
   222
    <ant dir="${base.source}/src" target="translate" inheritAll="true" inheritRefs="true"/>
juanpablo@179
   223
  </target>
juanpablo@179
   224
stefan@124
   225
  <target name="installWebService" depends="init">
juanpablo@131
   226
    <ant dir="${base.source}/src" target="installWebService" inheritAll="true" inheritRefs="true">
asier@43
   227
      <property name="wsdd" value="1"/>
asier@43
   228
    </ant>
asier@43
   229
  </target>
asier@43
   230
stefan@124
   231
  <target name="uninstallWebService" depends="init">
antonio@305
   232
    <ant dir="${base.source}/src" target="uninstallWebService" inheritAll="true" inheritRefs="true"/>
asier@43
   233
  </target>
asier@43
   234
stefan@124
   235
  <target name="preinstall" depends="init">
juanpablo@131
   236
    <ant dir="${base.source}/bdutil" target="build" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   237
    <ant dir="${base.source}/bdutil" target="preinstall" inheritAll="true" inheritRefs="true"/>
asier@43
   238
  </target>
asier@43
   239
stefan@124
   240
  <target name="preinstall.complete" depends="init">
juanpablo@131
   241
    <ant dir="${base.source}/bdutil" target="build" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   242
    <ant dir="${base.source}/bdutil" target="preinstall_complete" inheritAll="true" inheritRefs="true"/>
asier@43
   243
  </target>
asier@43
   244
stefan@124
   245
  <target name="install" depends="init">
juanpablo@131
   246
    <ant dir="${base.source}/install" target="build" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   247
    <ant dir="${base.source}/install" target="install" inheritAll="true" inheritRefs="true"/>
asier@43
   248
  </target>
asier@43
   249
stefan@124
   250
  <target name="deploy" depends="init">
asier@43
   251
    <copy file="${base.lib}/${context.name}.war" todir="${jakarta.base}/webapps"/>
asier@43
   252
  </target>
asier@43
   253
stefan@124
   254
  <target name="install.source" depends="init">
asier@43
   255
    <antcall target="database.lib"/>
juanpablo@131
   256
    <ant dir="${base.source}/database" target="create.database" inheritAll="true" inheritRefs="true"/>
asier@43
   257
    <antcall target="core.lib"/>
asier@43
   258
    <antcall target="wad.lib"/>
asier@43
   259
    <antcall target="trl.lib"/>
asier@43
   260
    <antcall target="compile.complete"/>
asier@43
   261
    <antcall target="installWebService"/>
asier@43
   262
    <antcall target="war"/>
asier@43
   263
  </target>
juanpablo@131
   264
stefan@124
   265
  <target name="eclipse.install.source" depends="init">
juanpablo@131
   266
    <antcall target="database.lib"/>
juanpablo@131
   267
    <ant dir="${base.source}/database" target="create.database" inheritAll="true" inheritRefs="true"/>
asier@43
   268
    <antcall target="core.lib"/>
asier@43
   269
    <antcall target="wad.lib"/>
asier@43
   270
    <antcall target="trl.lib"/>
asier@43
   271
    <antcall target="compile.complete"/>
asier@43
   272
    <antcall target="installWebService"/>
asier@43
   273
  </target>
asier@43
   274
juanpablo@131
   275
  <target name="create.database" depends="init">
juanpablo@131
   276
    <antcall target="database.lib"/>
juanpablo@131
   277
    <ant dir="${base.source}/database" target="create.database" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   278
  </target>
asier@43
   279
juanpablo@131
   280
  <target name="update.database" depends="init">
juanpablo@131
   281
    <ant dir="${base.source}/database" target="update.database" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   282
  </target>
asier@43
   283
juanpablo@131
   284
  <target name="create.database.structure" depends="init">
juanpablo@131
   285
    <ant dir="${base.source}/database" target="create.database.structure" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   286
  </target>
asier@43
   287
juanpablo@131
   288
  <target name="update.database.structure" depends="init">
juanpablo@131
   289
    <ant dir="${base.source}/database" target="update.database.structure" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   290
  </target>
asier@43
   291
juanpablo@131
   292
  <target name="create.database.script" depends="init">
juanpablo@131
   293
    <ant dir="${base.source}/database" target="create.database.script" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   294
  </target>
asier@43
   295
juanpablo@131
   296
  <target name="update.database.script" depends="init">
juanpablo@131
   297
    <ant dir="${base.source}/database" target="update.database.script" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   298
  </target>
adrian@97
   299
adrian@164
   300
  <target name="export.database" depends="init">
adrian@164
   301
    <ant dir="${base.source}/database" target="export.database.structure" inheritAll="true" inheritRefs="true"/>
adrian@164
   302
    <ant dir="${base.source}/database" target="export.database.data" inheritAll="true" inheritRefs="true"/>
adrian@164
   303
  </target>
adrian@164
   304
juanpablo@131
   305
  <target name="export.database.structure" depends="init">
juanpablo@131
   306
    <ant dir="${base.source}/database" target="export.database.structure" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   307
  </target>
asier@43
   308
juanpablo@131
   309
  <target name="export.database.data" depends="init">
juanpablo@131
   310
    <ant dir="${base.source}/database" target="export.database.data" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   311
  </target>
asier@43
   312
juanpablo@131
   313
  <target name="import.database.data" depends="init">
juanpablo@131
   314
    <ant dir="${base.source}/database" target="import.database.data" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   315
  </target>
asier@43
   316
juanpablo@131
   317
  <target name="export.database.sampledata" depends="init">
juanpablo@131
   318
    <ant dir="${base.source}/database" target="export.database.sampledata" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   319
  </target>
asier@43
   320
juanpablo@131
   321
  <target name="import.database.sampledata" depends="init">
juanpablo@131
   322
    <ant dir="${base.source}/database" target="import.database.sampledata" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   323
  </target>
juanpablo@131
   324
juanpablo@131
   325
  <target name="save.database.model" depends="init">
juanpablo@131
   326
    <ant dir="${base.source}/database" target="save.database.model" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   327
  </target>
adrian@171
   328
adrian@171
   329
  <target name="compare.database.structure" depends="init">
adrian@171
   330
    <ant dir="${base.source}/database" target="compare.database.structure" inheritAll="true" inheritRefs="true"/>
adrian@171
   331
  </target>
adrian@171
   332
asier@43
   333
</project>