build.xml
author Antonio Moreno <antonio.moreno@openbravo.com>
Tue, 13 May 2008 08:04:20 +0000
changeset 879 520f6bbb86e3
parent 812 cdac95bc56e3
child 903 0ce6e1b8e53f
permissions -rw-r--r--
Corrected bug: import.data tasks now depend on the code.rev task to prevent problems regarding $code.rev usage in the build.xml.
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.
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>
asier@43
   124
  </path>
ivan@812
   125
  
stefan@124
   126
  <target name="init">
stefan@124
   127
    <fail if="no.java.home" message="The environment variable JAVA_HOME is not set."/>
stefan@124
   128
  </target>
stefan@124
   129
ivan@812
   130
 
ivan@812
   131
 <target name="code.rev">
ivan@812
   132
  <loadfile property="svn.entries" srcFile=".svn/entries" failonerror="false">
ivan@812
   133
    <filterchain>
ivan@812
   134
      <filterreader classname="org.apache.tools.ant.filters.HeadFilter">
ivan@812
   135
        <param name="skip" value="3"/>
ivan@812
   136
        <param name="lines" value="1"/>
ivan@812
   137
      </filterreader>
ivan@812
   138
    </filterchain>
ivan@812
   139
  </loadfile>
ivan@812
   140
  <property name="code.revision" value="${svn.entries}" />
ivan@812
   141
 </target>
ivan@812
   142
ivan@812
   143
stefan@124
   144
  <target name="compile.complete" depends="init">
juanpablo@536
   145
    <ant dir="${base.src}" target="compile.complete" inheritAll="true" inheritRefs="true"/>
asier@43
   146
  </target>
asier@43
   147
stefan@124
   148
  <target name="compile" depends="init">
juanpablo@536
   149
    <ant dir="${base.src}" target="compile" inheritAll="true" inheritRefs="true"/>
asier@43
   150
  </target>
asier@43
   151
stefan@124
   152
  <target name="compile.complete.development" depends="init">
juanpablo@536
   153
    <ant dir="${base.src}" target="compile.complete.development" inheritAll="true" inheritRefs="true"/>
asier@43
   154
  </target>
asier@43
   155
stefan@124
   156
  <target name="compile.development" depends="init">
juanpablo@536
   157
    <ant dir="${base.src}" target="compile.development" inheritAll="true" inheritRefs="true"/>
asier@43
   158
  </target>
asier@43
   159
stefan@124
   160
  <target name="eclipse.compile" depends="init">
juanpablo@536
   161
    <ant dir="${base.src.core}" target="build.jar" inheritAll="true" inheritRefs="true"/>
juanpablo@536
   162
    <ant dir="${base.src.trl}" target="build.jar" inheritAll="true" inheritRefs="true"/>
juanpablo@536
   163
    <ant dir="${base.src.wad}" target="build.jar" inheritAll="true" inheritRefs="true"/>
juanpablo@536
   164
    <ant dir="${base.src}" target="eclipse.compile" inheritAll="true" inheritRefs="true"/>
asier@43
   165
  </target>
asier@43
   166
stefan@124
   167
  <target name="eclipse.compile.complete" depends="init">
juanpablo@536
   168
    <ant dir="${base.src.core}" target="build.jar" inheritAll="true" inheritRefs="true"/>
juanpablo@536
   169
    <ant dir="${base.src.trl}" target="build.jar" inheritAll="true" inheritRefs="true"/>
juanpablo@536
   170
    <ant dir="${base.src.wad}" target="build.jar" inheritAll="true" inheritRefs="true"/>
juanpablo@536
   171
    <ant dir="${base.src}" target="eclipse.compile.complete" inheritAll="true" inheritRefs="true"/>
asier@43
   172
  </target>
asier@43
   173
stefan@124
   174
  <target name="compile.src" depends="init">
juanpablo@536
   175
    <ant dir="${base.src}" target="compile.src" inheritAll="true" inheritRefs="true"/>
asier@43
   176
  </target>
asier@43
   177
stefan@124
   178
  <target name="war" depends="init">
juanpablo@536
   179
    <ant dir="${base.src}" target="build.war" inheritAll="true" inheritRefs="true"/>
asier@43
   180
  </target>
asier@43
   181
stefan@124
   182
  <target name="core.docs" depends="init">
juanpablo@536
   183
    <ant dir="${base.src.core}" target="doc" inheritAll="true" inheritRefs="true"/>
asier@43
   184
  </target>
juanpablo@131
   185
stefan@124
   186
  <target name="core.lib" depends="init">
juanpablo@536
   187
    <ant dir="${base.src.core}" target="build" inheritAll="true" inheritRefs="true"/>
juanpablo@536
   188
    <copy file="${base.src.core}/lib/openbravo-core.jar" todir="${base.lib}" overwrite="true" failonerror="false"/>
asier@43
   189
  </target>
juanpablo@131
   190
stefan@124
   191
  <target name="eclipse.wad.lib" depends="init">
juanpablo@536
   192
    <ant dir="${base.src.wad}" target="sqlc" inheritAll="true" inheritRefs="true"/>
asier@43
   193
  </target>
juanpablo@131
   194
stefan@124
   195
  <target name="wad.docs" depends="init">
juanpablo@536
   196
    <ant dir="${base.src.wad}" target="doc" inheritAll="true" inheritRefs="true"/>
asier@43
   197
  </target>
juanpablo@131
   198
stefan@124
   199
  <target name="wad.lib" depends="init">
juanpablo@536
   200
    <ant dir="${base.src.wad}" target="build" inheritAll="true" inheritRefs="true"/>
asier@43
   201
  </target>
juanpablo@131
   202
stefan@124
   203
  <target name="eclipse.trl.lib" depends="init">
juanpablo@536
   204
    <ant dir="${base.src.trl}" target="sqlc" inheritAll="true" inheritRefs="true"/>
asier@43
   205
  </target>
juanpablo@131
   206
stefan@124
   207
  <target name="trl.docs" depends="init">
juanpablo@536
   208
    <ant dir="${base.src.trl}" target="doc" inheritAll="true" inheritRefs="true"/>
asier@43
   209
  </target>
juanpablo@131
   210
stefan@124
   211
  <target name="trl.lib" depends="init">
juanpablo@536
   212
    <ant dir="${base.src.trl}" target="build" inheritAll="true" inheritRefs="true"/>
asier@43
   213
  </target>
juanpablo@131
   214
stefan@124
   215
  <target name="database.lib" depends="init">
juanpablo@536
   216
    <ant dir="${base.src.db}" target="jar" inheritAll="true" inheritRefs="true"/>
juanpablo@536
   217
    <copy file="${base.src.db}/build/lib/dbmanager.jar" todir="${base.db}/lib" overwrite="true" failonerror="false"/>
asier@43
   218
  </target>
asier@43
   219
juanpablo@179
   220
  <target name="clean" depends="init">
juanpablo@536
   221
    <ant dir="${base.src}" target="clean" inheritAll="true" inheritRefs="true"/>
juanpablo@179
   222
  </target>
juanpablo@179
   223
juanpablo@179
   224
  <target name="trl.clean" depends="init">
juanpablo@536
   225
    <ant dir="${base.src}" target="trl.clean" inheritAll="true" inheritRefs="true"/>
juanpablo@179
   226
  </target>
juanpablo@179
   227
juanpablo@179
   228
  <target name="translate" depends="init">
juanpablo@536
   229
    <ant dir="${base.src}" target="translate" inheritAll="true" inheritRefs="true"/>
juanpablo@179
   230
  </target>
juanpablo@179
   231
stefan@124
   232
  <target name="installWebService" depends="init">
juanpablo@536
   233
    <ant dir="${base.src}" target="installWebService" inheritAll="true" inheritRefs="true">
asier@43
   234
      <property name="wsdd" value="1"/>
asier@43
   235
    </ant>
asier@43
   236
  </target>
asier@43
   237
stefan@124
   238
  <target name="uninstallWebService" depends="init">
juanpablo@536
   239
    <ant dir="${base.src}" target="uninstallWebService" inheritAll="true" inheritRefs="true"/>
asier@43
   240
  </target>
asier@43
   241
stefan@124
   242
  <target name="deploy" depends="init">
asier@43
   243
    <copy file="${base.lib}/${context.name}.war" todir="${jakarta.base}/webapps"/>
asier@43
   244
  </target>
asier@43
   245
stefan@124
   246
  <target name="install.source" depends="init">
asier@43
   247
    <antcall target="database.lib"/>
juanpablo@536
   248
    <ant dir="${base.db}" target="create.database" inheritAll="true" inheritRefs="true"/>
asier@43
   249
    <antcall target="core.lib"/>
asier@43
   250
    <antcall target="wad.lib"/>
asier@43
   251
    <antcall target="trl.lib"/>
asier@43
   252
    <antcall target="compile.complete"/>
asier@43
   253
    <antcall target="war"/>
asier@43
   254
  </target>
juanpablo@131
   255
stefan@124
   256
  <target name="eclipse.install.source" depends="init">
juanpablo@131
   257
    <antcall target="database.lib"/>
juanpablo@536
   258
    <ant dir="${base.db}" target="create.database" inheritAll="true" inheritRefs="true"/>
asier@43
   259
    <antcall target="core.lib"/>
asier@43
   260
    <antcall target="wad.lib"/>
asier@43
   261
    <antcall target="trl.lib"/>
asier@43
   262
    <antcall target="compile.complete"/>
asier@43
   263
  </target>
asier@43
   264
ivan@812
   265
  <target name="create.database" depends="init,code.rev">
juanpablo@131
   266
    <antcall target="database.lib"/>
juanpablo@536
   267
    <ant dir="${base.db}" target="create.database" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   268
  </target>
asier@43
   269
juanpablo@131
   270
  <target name="update.database" depends="init">
juanpablo@536
   271
    <ant dir="${base.db}" target="update.database" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   272
  </target>
asier@43
   273
juanpablo@131
   274
  <target name="create.database.structure" depends="init">
juanpablo@536
   275
    <ant dir="${base.db}" target="create.database.structure" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   276
  </target>
asier@43
   277
juanpablo@131
   278
  <target name="update.database.structure" depends="init">
juanpablo@536
   279
    <ant dir="${base.db}" target="update.database.structure" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   280
  </target>
asier@43
   281
juanpablo@131
   282
  <target name="create.database.script" depends="init">
juanpablo@536
   283
    <ant dir="${base.db}" target="create.database.script" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   284
  </target>
asier@43
   285
juanpablo@131
   286
  <target name="update.database.script" depends="init">
juanpablo@536
   287
    <ant dir="${base.db}" target="update.database.script" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   288
  </target>
adrian@97
   289
adrian@164
   290
  <target name="export.database" depends="init">
juanpablo@536
   291
    <ant dir="${base.db}" target="export.database.structure" inheritAll="true" inheritRefs="true"/>
juanpablo@536
   292
    <ant dir="${base.db}" target="export.database.data" inheritAll="true" inheritRefs="true"/>
adrian@164
   293
  </target>
adrian@164
   294
juanpablo@131
   295
  <target name="export.database.structure" depends="init">
juanpablo@536
   296
    <ant dir="${base.db}" target="export.database.structure" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   297
  </target>
asier@43
   298
juanpablo@131
   299
  <target name="export.database.data" depends="init">
juanpablo@536
   300
    <ant dir="${base.db}" target="export.database.data" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   301
  </target>
asier@43
   302
antonio@879
   303
  <target name="import.database.data" depends="init,code.rev">
juanpablo@536
   304
    <ant dir="${base.db}" target="import.database.data" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   305
  </target>
asier@43
   306
juanpablo@131
   307
  <target name="export.database.sampledata" depends="init">
juanpablo@536
   308
    <ant dir="${base.db}" target="export.database.sampledata" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   309
  </target>
asier@43
   310
antonio@879
   311
  <target name="import.database.sampledata" depends="init,code.rev">
juanpablo@536
   312
    <ant dir="${base.db}" target="import.database.sampledata" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   313
  </target>
juanpablo@131
   314
antonio@451
   315
  <target name="export.database.masterdata" depends="init">
juanpablo@536
   316
    <ant dir="${base.db}" target="export.database.masterdata" inheritAll="true" inheritRefs="true"/>
antonio@451
   317
  </target>
antonio@451
   318
antonio@879
   319
  <target name="import.database.masterdata" depends="init,code.rev">
juanpablo@536
   320
    <ant dir="${base.db}" target="import.database.masterdata" inheritAll="true" inheritRefs="true"/>
antonio@451
   321
  </target>
antonio@451
   322
juanpablo@131
   323
  <target name="save.database.model" depends="init">
juanpablo@536
   324
    <ant dir="${base.db}" target="save.database.model" inheritAll="true" inheritRefs="true"/>
juanpablo@131
   325
  </target>
adrian@171
   326
adrian@171
   327
  <target name="compare.database.structure" depends="init">
juanpablo@536
   328
    <ant dir="${base.db}" target="compare.database.structure" inheritAll="true" inheritRefs="true"/>
adrian@171
   329
  </target>
adrian@171
   330
asier@43
   331
</project>