build.xml
author Jordi Mas <jordi.mas@openbravo.com>
Tue, 23 Sep 2008 17:03:41 +0000
changeset 1711 72577fd0c13c
parent 1548 8302641b3f39
child 1738 d8dcb2ecfd14
permissions -rw-r--r--
Merge of the library auditing branch
asier@43
     1
<?xml version="1.0" encoding="UTF-8" ?>
asier@43
     2
<!--
juanpablo@1548
     3
*************************************************************************
juanpablo@1548
     4
* The contents of this file are subject to the Openbravo  Public  License
juanpablo@1548
     5
* Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
juanpablo@1548
     6
* Version 1.1  with a permitted attribution clause; you may not  use this
juanpablo@1548
     7
* file except in compliance with the License. You  may  obtain  a copy of
juanpablo@1548
     8
* the License at http://www.openbravo.com/legal/license.html
juanpablo@1548
     9
* Software distributed under the License  is  distributed  on  an "AS IS"
juanpablo@1548
    10
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
juanpablo@1548
    11
* License for the specific  language  governing  rights  and  limitations
juanpablo@1548
    12
* under the License.
juanpablo@1548
    13
* The Original Code is Openbravo ERP.
juanpablo@1548
    14
* The Initial Developer of the Original Code is Openbravo SL
juanpablo@1548
    15
* All portions are Copyright (C) 2001-2008 Openbravo SL
juanpablo@1548
    16
* All Rights Reserved.
juanpablo@1548
    17
* Contributor(s):  ______________________________________.
juanpablo@1548
    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.
antonio@451
    64
export.database.masterdata: refer to export.database.masterdata target of database.
antonio@451
    65
import.database.masterdata: refer to import.database.masterdata target of database.
juanpablo@213
    66
save.database.model: refer to save.database.model target of database.
juanpablo@213
    67
compare.database.structure: refer to compare.database.structure target of database.
fernando@202
    68
-->
asier@43
    69
<project name="openbravo" default="compile.complete" basedir=".">
juanpablo@131
    70
  <property environment="env"/>
juanpablo@537
    71
  <property name="base.config" location="config"/>
juanpablo@537
    72
  <property file="${base.config}/Openbravo.properties"/>
juanpablo@131
    73
juanpablo@536
    74
  <property name="base.src" location="src"/>
juanpablo@536
    75
  <property name="base.src.core" location="src-core"/>
juanpablo@536
    76
  <property name="base.src.db" location="src-db"/>
juanpablo@536
    77
  <property name="base.src.trl" location="src-trl"/>
juanpablo@536
    78
  <property name="base.src.wad" location="src-wad"/>
juanpablo@536
    79
  <property name="base.client.src" location="srcClient"/>
antonio@757
    80
  <property name="base.db" location="src-db/database"/>
juanpablo@536
    81
  <property name="base.web" location="web"/>
juanpablo@536
    82
  <property name="base.context" location="WebContent"/>
juanpablo@536
    83
  <property name="base.design" location="${base.context}/src-loc"/>
juanpablo@536
    84
  <property name="base.lib" location="lib"/>
juanpablo@536
    85
  <property name="build" location="build/classes"/>
juanpablo@536
    86
  <property name="build.AD" location="srcAD"/>
juanpablo@536
    87
  <property name="build.sqlc" location="build/javasqlc"/>
juanpablo@536
    88
  <property name="build.core.lib" location="src-core/lib"/>
juanpablo@536
    89
  <property name="build.trl.lib" location="src-trl/lib"/>
juanpablo@536
    90
  <property name="build.wad.lib" location="src-wad/lib"/>
juanpablo@536
    91
  <property name="build.docs" location="docs/api"/>
juanpablo@536
    92
  <property name="jakarta.home" location="${env.CATALINA_HOME}"/>
asier@43
    93
  <condition property="jakarta.base" value="${env.CATALINA_BASE}" else="${jakarta.home}">
asier@43
    94
    <and>
asier@43
    95
      <isset property="env.CATALINA_BASE"/>
asier@43
    96
    </and>
asier@43
    97
  </condition>
juanpablo@536
    98
  <property name="log.path" location="${jakarta.base}/logs"/>
juanpablo@536
    99
  <property name="lib" location="${jakarta.home}/common"/>
juanpablo@536
   100
  <property name="jakarta.context" location="${jakarta.base}/webapps/${context.name}"/>
asier@43
   101
  <property name="build.maxmemory" value="512M"/>
asier@43
   102
  <property name="debug.level" value="false"/>
asier@43
   103
stefan@124
   104
  <condition property="no.java.home" value="true">
stefan@124
   105
    <not>
stefan@125
   106
      <isset property="env.JAVA_HOME"/>
stefan@124
   107
    </not>
stefan@124
   108
  </condition>
stefan@124
   109
asier@43
   110
  <path id="project.class.path">
asier@43
   111
    <pathelement path="${build}"/>
asier@43
   112
    <fileset dir="${base.lib}">
asier@43
   113
      <include name="**/*.jar"/>
asier@43
   114
    </fileset>
asier@43
   115
    <fileset dir="${build.core.lib}">
asier@43
   116
      <include name="openbravo-core.jar"/>
asier@43
   117
    </fileset>
asier@43
   118
    <fileset dir="${build.trl.lib}">
asier@43
   119
      <include name="openbravo-trl.jar"/>
asier@43
   120
    </fileset>
asier@43
   121
    <fileset dir="${build.wad.lib}">
asier@43
   122
      <include name="openbravo-wad.jar"/>
asier@43
   123
    </fileset>
jordi@1711
   124
    <fileset dir="${base.lib}">
jordi@1711
   125
      <include name="**/*.jar"/>
jordi@1711
   126
    </fileset>
asier@43
   127
  </path>
juanpablo@1548
   128
stefan@124
   129
  <target name="init">
stefan@124
   130
    <fail if="no.java.home" message="The environment variable JAVA_HOME is not set."/>
stefan@124
   131
  </target>
stefan@124
   132
juanpablo@1548
   133
  <target name="code.rev">
juanpablo@1548
   134
    <loadfile property="svn.entries" srcFile=".svn/entries" failonerror="false">
juanpablo@1548
   135
      <filterchain>
juanpablo@1548
   136
        <filterreader classname="org.apache.tools.ant.filters.HeadFilter">
juanpablo@1548
   137
          <param name="skip" value="3"/>
juanpablo@1548
   138
          <param name="lines" value="1"/>
juanpablo@1548
   139
        </filterreader>
juanpablo@1548
   140
      </filterchain>
juanpablo@1548
   141
      <filterchain>
juanpablo@1548
   142
        <filterreader classname="org.apache.tools.ant.filters.StripLineBreaks" />
juanpablo@1548
   143
      </filterchain>
juanpablo@1548
   144
    </loadfile>
juanpablo@1548
   145
    <condition property="code.revision" value="${svn.entries}" else ="0">
juanpablo@1548
   146
      <and>
juanpablo@1548
   147
        <isset property="svn.entries" />
juanpablo@1548
   148
      </and>
juanpablo@1548
   149
    </condition>
juanpablo@1548
   150
  </target>
ivan@812
   151
stefan@124
   152
  <target name="compile.complete" depends="init">
juanpablo@536
   153
    <ant dir="${base.src}" target="compile.complete" inheritAll="true" inheritRefs="true"/>
asier@43
   154
  </target>
asier@43
   155
stefan@124
   156
  <target name="compile" depends="init">
juanpablo@536
   157
    <ant dir="${base.src}" target="compile" inheritAll="true" inheritRefs="true"/>
asier@43
   158
  </target>
asier@43
   159
stefan@124
   160
  <target name="compile.complete.development" depends="init">
juanpablo@536
   161
    <ant dir="${base.src}" target="compile.complete.development" inheritAll="true" inheritRefs="true"/>
asier@43
   162
  </target>
asier@43
   163
stefan@124
   164
  <target name="compile.development" depends="init">
juanpablo@536
   165
    <ant dir="${base.src}" target="compile.development" inheritAll="true" inheritRefs="true"/>
asier@43
   166
  </target>
asier@43
   167
stefan@124
   168
  <target name="eclipse.compile" depends="init">
juanpablo@536
   169
    <ant dir="${base.src.core}" target="build.jar" inheritAll="true" inheritRefs="true"/>
juanpablo@536
   170
    <ant dir="${base.src.trl}" target="build.jar" inheritAll="true" inheritRefs="true"/>
juanpablo@536
   171
    <ant dir="${base.src.wad}" target="build.jar" inheritAll="true" inheritRefs="true"/>
juanpablo@536
   172
    <ant dir="${base.src}" target="eclipse.compile" inheritAll="true" inheritRefs="true"/>
juanpablo@1548
   173
    <eclipse.refreshLocal resource="openbravo" depth="infinite"/>
juanpablo@1548
   174
    <eclipse.incrementalBuild project="openbravo" kind="incremental"/>
asier@43
   175
  </target>
asier@43
   176
stefan@124
   177
  <target name="eclipse.compile.complete" depends="init">
juanpablo@536
   178
    <ant dir="${base.src.core}" target="build.jar" inheritAll="true" inheritRefs="true"/>
juanpablo@536
   179
    <ant dir="${base.src.trl}" target="build.jar" inheritAll="true" inheritRefs="true"/>
juanpablo@536
   180
    <ant dir="${base.src.wad}" target="build.jar" inheritAll="true" inheritRefs="true"/>
juanpablo@536
   181
    <ant dir="${base.src}" target="eclipse.compile.complete" inheritAll="true" inheritRefs="true"/>
juanpablo@1548
   182
    <eclipse.refreshLocal resource="openbravo" depth="infinite"/>
juanpablo@1548
   183
    <eclipse.incrementalBuild project="openbravo" kind="full"/>
asier@43
   184
  </target>
asier@43
   185
stefan@124
   186
  <target name="compile.src" depends="init">
juanpablo@536
   187
    <ant dir="${base.src}" target="compile.src" inheritAll="true" inheritRefs="true"/>
asier@43
   188
  </target>
asier@43
   189
stefan@124
   190
  <target name="war" depends="init">
juanpablo@536
   191
    <ant dir="${base.src}" target="build.war" inheritAll="true" inheritRefs="true"/>
asier@43
   192
  </target>
asier@43
   193
stefan@124
   194
  <target name="core.docs" depends="init">
juanpablo@536
   195
    <ant dir="${base.src.core}" target="doc" inheritAll="true" inheritRefs="true"/>
asier@43
   196
  </target>
juanpablo@131
   197
stefan@124
   198
  <target name="core.lib" depends="init">
juanpablo@536
   199
    <ant dir="${base.src.core}" target="build" inheritAll="true" inheritRefs="true"/>
juanpablo@536
   200
    <copy file="${base.src.core}/lib/openbravo-core.jar" todir="${base.lib}" overwrite="true" failonerror="false"/>
asier@43
   201
  </target>
juanpablo@131
   202
stefan@124
   203
  <target name="eclipse.wad.lib" depends="init">
juanpablo@536
   204
    <ant dir="${base.src.wad}" target="sqlc" inheritAll="true" inheritRefs="true"/>
juanpablo@1548
   205
    <eclipse.refreshLocal resource="OpenbravoWAD" depth="infinite"/>
juanpablo@1548
   206
    <eclipse.incrementalBuild project="OpenbravoWAD" kind="full"/>
asier@43
   207
  </target>
juanpablo@131
   208
stefan@124
   209
  <target name="wad.docs" depends="init">
juanpablo@536
   210
    <ant dir="${base.src.wad}" target="doc" inheritAll="true" inheritRefs="true"/>
asier@43
   211
  </target>
juanpablo@131
   212
stefan@124
   213
  <target name="wad.lib" depends="init">
juanpablo@536
   214
    <ant dir="${base.src.wad}" target="build" inheritAll="true" inheritRefs="true"/>
asier@43
   215
  </target>
juanpablo@131
   216
stefan@124
   217
  <target name="eclipse.trl.lib" depends="init">
juanpablo@536
   218
    <ant dir="${base.src.trl}" target="sqlc" inheritAll="true" inheritRefs="true"/>
juanpablo@1548
   219
    <eclipse.refreshLocal resource="OpenbravoTrl" depth="infinite"/>
juanpablo@1548
   220
    <eclipse.incrementalBuild project="OpenbravoTrl" kind="full"/>
asier@43
   221
  </target>
juanpablo@131
   222
stefan@124
   223
  <target name="trl.docs" depends="init">
juanpablo@536
   224
    <ant dir="${base.src.trl}" target="doc" inheritAll="true" inheritRefs="true"/>
asier@43
   225
  </target>
juanpablo@131
   226
stefan@124
   227
  <target name="trl.lib" depends="init">
juanpablo@536
   228
    <ant dir="${base.src.trl}" target="build" inheritAll="true" inheritRefs="true"/>
asier@43
   229
  </target>
juanpablo@131
   230
stefan@124
   231
  <target name="database.lib" depends="init">
juanpablo@536
   232
    <ant dir="${base.src.db}" target="jar" inheritAll="true" inheritRefs="true"/>
juanpablo@536
   233
    <copy file="${base.src.db}/build/lib/dbmanager.jar" todir="${base.db}/lib" overwrite="true" failonerror="false"/>
asier@43
   234
  </target>
asier@43
   235
juanpablo@179
   236
  <target name="clean" depends="init">
juanpablo@536
   237
    <ant dir="${base.src}" target="clean" inheritAll="true" inheritRefs="true"/>
juanpablo@179
   238
  </target>
juanpablo@179
   239
juanpablo@179
   240
  <target name="trl.clean" depends="init">
juanpablo@536
   241
    <ant dir="${base.src}" target="trl.clean" inheritAll="true" inheritRefs="true"/>
juanpablo@179
   242
  </target>
juanpablo@179
   243
juanpablo@179
   244
  <target name="translate" depends="init">
juanpablo@536
   245
    <ant dir="${base.src}" target="translate" inheritAll="true" inheritRefs="true"/>
juanpablo@179
   246
  </target>
juanpablo@179
   247
stefan@124
   248
  <target name="installWebService" depends="init">
juanpablo@536
   249
    <ant dir="${base.src}" target="installWebService" inheritAll="true" inheritRefs="true">
asier@43
   250
      <property name="wsdd" value="1"/>
asier@43
   251
    </ant>
asier@43
   252
  </target>
asier@43
   253
stefan@124
   254
  <target name="uninstallWebService" depends="init">
juanpablo@536
   255
    <ant dir="${base.src}" target="uninstallWebService" inheritAll="true" inheritRefs="true"/>
asier@43
   256
  </target>
asier@43
   257
stefan@124
   258
  <target name="deploy" depends="init">
asier@43
   259
    <copy file="${base.lib}/${context.name}.war" todir="${jakarta.base}/webapps"/>
asier@43
   260
  </target>
asier@43
   261
antonio@1062
   262
  <target name="install.source" depends="init,code.rev">
asier@43
   263
    <antcall target="database.lib"/>
juanpablo@536
   264
    <ant dir="${base.db}" target="create.database" inheritAll="true" inheritRefs="true"/>
asier@43
   265
    <antcall target="core.lib"/>
asier@43
   266
    <antcall target="wad.lib"/>
asier@43
   267
    <antcall target="trl.lib"/>
asier@43
   268
    <antcall target="compile.complete"/>
asier@43
   269
    <antcall target="war"/>
asier@43
   270
  </target>
juanpablo@131
   271
antonio@1062
   272
  <target name="eclipse.install.source" depends="init,code.rev">
juanpablo@131
   273
    <antcall target="database.lib"/>
juanpablo@536
   274
    <ant dir="${base.db}" target="create.database" inheritAll="true" inheritRefs="true"/>
juanpablo@1548
   275
    <eclipse.incrementalBuild project="OpenbravoCore" kind="full"/>
rafael@1546
   276
    <antcall target="eclipse.wad.lib"/>
rafael@1546
   277
    <antcall target="eclipse.trl.lib"/>
rafael@1546
   278
    <antcall target="eclipse.compile.complete"/>
asier@43
   279
  </target>
asier@43
   280
ivan@812
   281
  <target name="create.database" depends="init,code.rev">
juanpablo@131
   282
    <antcall target="database.lib"/>
juanpablo@536
   283
    <ant dir="${base.db}" target="create.database" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   284
  </target>
asier@43
   285
antonio@1335
   286
  <target name="create.original.database" depends="init,code.rev">
antonio@1335
   287
    <antcall target="database.lib"/>
antonio@1335
   288
    <ant dir="${base.db}" target="create.original.database" inheritAll="true" inheritRefs="true"/>
antonio@1335
   289
  </target>
antonio@1335
   290
antonio@905
   291
  <target name="update.database" depends="init,code.rev">
antonio@1208
   292
    <antcall target="database.lib"/>
juanpablo@536
   293
    <ant dir="${base.db}" target="update.database" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   294
  </target>
asier@43
   295
antonio@1335
   296
  <target name="update.customized.database" depends="init,code.rev">
antonio@1335
   297
    <antcall target="database.lib"/>
antonio@1335
   298
    <ant dir="${base.db}" target="update.customized.database" inheritAll="true" inheritRefs="true"/>
antonio@1335
   299
  </target>
antonio@1335
   300
juanpablo@131
   301
  <target name="create.database.structure" depends="init">
juanpablo@536
   302
    <ant dir="${base.db}" target="create.database.structure" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   303
  </target>
asier@43
   304
juanpablo@131
   305
  <target name="update.database.structure" depends="init">
juanpablo@536
   306
    <ant dir="${base.db}" target="update.database.structure" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   307
  </target>
asier@43
   308
juanpablo@131
   309
  <target name="create.database.script" depends="init">
juanpablo@536
   310
    <ant dir="${base.db}" target="create.database.script" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   311
  </target>
asier@43
   312
juanpablo@131
   313
  <target name="update.database.script" depends="init">
juanpablo@536
   314
    <ant dir="${base.db}" target="update.database.script" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   315
  </target>
adrian@97
   316
antonio@903
   317
  <target name="export.database" depends="init,code.rev">
antonio@1208
   318
    <antcall target="database.lib"/>
juanpablo@536
   319
    <ant dir="${base.db}" target="export.database.structure" inheritAll="true" inheritRefs="true"/>
juanpablo@536
   320
    <ant dir="${base.db}" target="export.database.data" inheritAll="true" inheritRefs="true"/>
adrian@164
   321
  </target>
adrian@164
   322
antonio@903
   323
  <target name="export.database.structure" depends="init,code.rev">
juanpablo@536
   324
    <ant dir="${base.db}" target="export.database.structure" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   325
  </target>
asier@43
   326
antonio@903
   327
  <target name="export.database.data" depends="init,code.rev">
juanpablo@536
   328
    <ant dir="${base.db}" target="export.database.data" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   329
  </target>
asier@43
   330
antonio@879
   331
  <target name="import.database.data" depends="init,code.rev">
juanpablo@536
   332
    <ant dir="${base.db}" target="import.database.data" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   333
  </target>
asier@43
   334
antonio@903
   335
  <target name="export.database.sampledata" depends="init,code.rev">
juanpablo@536
   336
    <ant dir="${base.db}" target="export.database.sampledata" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   337
  </target>
asier@43
   338
antonio@879
   339
  <target name="import.database.sampledata" depends="init,code.rev">
juanpablo@536
   340
    <ant dir="${base.db}" target="import.database.sampledata" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   341
  </target>
juanpablo@131
   342
antonio@903
   343
  <target name="export.database.masterdata" depends="init,code.rev">
juanpablo@536
   344
    <ant dir="${base.db}" target="export.database.masterdata" inheritAll="true" inheritRefs="true"/>
antonio@451
   345
  </target>
antonio@451
   346
antonio@879
   347
  <target name="import.database.masterdata" depends="init,code.rev">
juanpablo@536
   348
    <ant dir="${base.db}" target="import.database.masterdata" inheritAll="true" inheritRefs="true"/>
antonio@451
   349
  </target>
antonio@451
   350
juanpablo@131
   351
  <target name="save.database.model" depends="init">
juanpablo@536
   352
    <ant dir="${base.db}" target="save.database.model" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   353
  </target>
adrian@171
   354
adrian@171
   355
  <target name="compare.database.structure" depends="init">
juanpablo@536
   356
    <ant dir="${base.db}" target="compare.database.structure" inheritAll="true" inheritRefs="true"/>
adrian@171
   357
  </target>
adrian@171
   358
antonio@1335
   359
  <target name="compare.database.data" depends="init">
antonio@1335
   360
    <ant dir="${base.db}" target="compare.database.data" inheritAll="true" inheritRefs="true"/>
antonio@1335
   361
  </target>
asier@43
   362
</project>