build.xml
author Augusto Mauch <augusto.mauch@openbravo.com>
Mon, 14 Mar 2016 10:42:09 +0100
changeset 28711 8d0b0cebab04
parent 28271 c48840608378
child 28804 a58e284a2ce0
permissions -rw-r--r--
Fixes issue 32460:install.source can be invoked without executing modulescripts

A flag called execute.modulescripts has been added to allow invoking the install.source task without executing the modulescripts. Specifically the flag has been added to the impo
rt.sample.data task, which is invoked from the install.source task. The new parameter is set like this:

ant install.source -Dexecute.modulescripts=false

If the new parameter is not specified, the modulescripts will be executed by default.
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
priya@9072
     5
* Version  1.1  (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.
ggi@6701
    14
* The Initial Developer of the Original Code is Openbravo SLU
asier@25752
    15
* All portions are Copyright (C) 2001-2015 Openbravo SLU
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.
asier@1929
    28
compile.web: refer to compile.web: target of src.
asier@1929
    29
compile.web.development: refer to compile.web.development: target of src.
juanpablo@213
    30
eclipse.compile: refer to eclipse.compile target of src.
juanpablo@213
    31
eclipse.compile.complete: refer to eclipse.compile.complete target of src.
juanpablo@213
    32
compile.src: refer to compile.src target of src.
juanpablo@213
    33
war: refer to build.war target of src.
juanpablo@213
    34
core.docs: refer to doc target of src-core.
juanpablo@213
    35
core.lib: refer to build target of src-core.
juanpablo@213
    36
eclipse.wad.lib: refer to sqlc target of src-wad.
juanpablo@213
    37
wad.docs: refer to doc target of src-wad.
juanpablo@213
    38
wad.lib: refer to build target of src-wad.
juanpablo@213
    39
eclipse.trl.lib: refer to sqlc target of src-trl.
juanpablo@213
    40
trl.docs: refer to doc target of src-trl.
juanpablo@213
    41
trl.lib: refer to build target of src-trl.
juanpablo@213
    42
database.lib: refer to jar target of src-db.
juanpablo@213
    43
clean: refer to clean target of src.
juanpablo@213
    44
trl.clean: refer to trl.clean target of src.
juanpablo@213
    45
translate: refer to translate target of src.
juanpablo@213
    46
installWebService: refer to installWebService target of src.
juanpablo@213
    47
uninstallWebService: refer to uninstallWebService target of src.
juanpablo@2061
    48
deploy.context: deploy the context into Tomcat using the manager
juanpablo@213
    49
install.source: install the ERP from sources (from subversion).
rafael@3544
    50
eclipse.install.source: install the ERP from sources for eclipse (from Mercurial).
juanpablo@213
    51
create.database: refer to create.database target of database.
juanpablo@213
    52
update.database: refer to update.database target of database.
juanpablo@213
    53
create.database.script: refer to create.database.script target of database.
juanpablo@213
    54
update.database.script: refer to update.database.script target of database.
juanpablo@213
    55
export.database: exports database structure and data to xml files.
fernando@202
    56
-->
asier@43
    57
<project name="openbravo" default="compile.complete" basedir=".">
martin@2871
    58
  <property environment="env" />
martin@2871
    59
  <property name="base.config" location="config" />
martin@2871
    60
  <property file="${base.config}/Openbravo.properties" />
martin@2871
    61
  <property file="${base.config}/checksums" />
juanpablo@131
    62
martin@2871
    63
  <property name="base.config" location="config" />
martin@2871
    64
  <property name="base.src" location="src" />
martin@3794
    65
  <property name="base.src.test" location="src-test" />
martin@2871
    66
  <property name="base.src.core" location="src-core" />
martin@2871
    67
  <property name="base.src.db" location="src-db" />
martin@2871
    68
  <property name="base.src.trl" location="src-trl" />
martin@2871
    69
  <property name="base.src.wad" location="src-wad" />
martin@2871
    70
  <property name="base.src.gen" location="src-gen" />
martin@2871
    71
  <property name="base.db" location="src-db/database" />
martin@2871
    72
  <property name="base.web" location="web" />
martin@2871
    73
  <property name="base.context" location="WebContent" />
martin@2871
    74
  <property name="base.design" location="${base.context}/src-loc" />
martin@2871
    75
  <property name="base.lib" location="lib" />
martin@2871
    76
  <property name="base.modules" location="modules" />
martin@2871
    77
  <property name="build" location="build/classes" />
antonio@7541
    78
  <property name="build.apply.module" location="build.apply/classes" />
martin@2871
    79
  <property name="build.AD" location="srcAD" />
martin@2871
    80
  <property name="build.sqlc" location="build/javasqlc" />
martin@2871
    81
  <property name="build.core.lib" location="src-core/lib" />
martin@2871
    82
  <property name="build.trl.lib" location="src-trl/lib" />
martin@2871
    83
  <property name="build.wad.lib" location="src-wad/lib" />
martin@2871
    84
  <property name="build.docs" location="docs/api" />
martin@2871
    85
  <property name="jakarta.home" location="${env.CATALINA_HOME}" />
martin@2871
    86
  <property name="module" value="%" />
antonio@6107
    87
  <property name="apply.on.create" value="false" />
antonio@6108
    88
  <property name="apply.on.update" value="true" />
martin@2871
    89
  <property name="obx.export.RD" value="false" />
martin@2871
    90
  <property name="obx.export.DB" value="false" />
martin@2871
    91
  <property name="obx.export.CS" value="false" />
asier@19231
    92
  <property name="obx.export.validate" value="true" />
asier@19231
    93
  <property name="obx.export.allDeps" value="false" />
martin@2871
    94
  <property name="chekPerms" value="false" />
antonio@2896
    95
  <property name="force" value="false" />
antonio@7709
    96
  <property name="strict.template.application" value="false" />
antonio@4937
    97
  <property name="rd" value="false" />
asier@3008
    98
  <property name="local" value="true" />
asier@3995
    99
  <property name="apply.modules.complete.compilation" value="false" />
martin@14869
   100
  <property name="calculate.core.revision" value="true"/>
martin@14869
   101
  <property name="stopOnWadError" value="false"/>
martin@14869
   102
  <property name="friendlyWarnings" value="false"/>
martin@14869
   103
  <property name="checkTranslationConsistency" value="true"/>
martin@14869
   104
  <property name="buildValidation" value="true"/>
martin@14870
   105
  <property name="disableCheckReferencedOrganizations" value="false"/>
asier@2057
   106
juanpablo@3841
   107
  <available file=".hg" property="is.hg" />
martin@3038
   108
asier@4279
   109
  <condition property="calculate.core.rev">
martin@14869
   110
   <istrue value="${calculate.core.revision}"/>
asier@4279
   111
  </condition>
martin@14869
   112
  
asier@4279
   113
  <condition property="xml.core.rev">
martin@14869
   114
     <isfalse value="${calculate.core.revision}"/>
asier@4279
   115
  </condition>
martin@14869
   116
  
juanpablo@2522
   117
  <condition property="deploy.mode" value="class">
juanpablo@2522
   118
    <not>
juanpablo@2522
   119
      <isset property="${deploy.mode}" />
juanpablo@2522
   120
    </not>
juanpablo@2522
   121
  </condition>
martin@2345
   122
martin@2871
   123
  <condition property="mode.war">
martin@2871
   124
    <equals arg1="war" arg2="${deploy.mode}" />
martin@2871
   125
  </condition>
martin@2345
   126
martin@2871
   127
  <condition property="mode.class">
martin@2871
   128
    <equals arg1="class" arg2="${deploy.mode}" />
martin@2871
   129
  </condition>
martin@2345
   130
martin@2871
   131
  <condition property="apply.modules.on.create">
martin@2871
   132
    <or>
martin@2871
   133
      <equals arg1="yes" arg2="${apply.on.create}" />
martin@2871
   134
      <equals arg1="true" arg2="${apply.on.create}" />
martin@2871
   135
    </or>
martin@2871
   136
  </condition>
martin@2345
   137
antonio@6108
   138
  <condition property="apply.modules.on.update">
antonio@6108
   139
    <or>
antonio@6108
   140
      <equals arg1="yes" arg2="${apply.on.update}" />
antonio@6108
   141
      <equals arg1="true" arg2="${apply.on.update}" />
antonio@6108
   142
    </or>
antonio@6108
   143
  </condition>
antonio@6108
   144
martin@2871
   145
  <condition property="obx.exp.DB">
martin@2871
   146
    <or>
martin@2871
   147
      <equals arg1="yes" arg2="${obx.export.DB}" />
martin@2871
   148
      <equals arg1="true" arg2="${obx.export.DB}" />
martin@2871
   149
    </or>
martin@2871
   150
  </condition>
martin@2345
   151
martin@2871
   152
  <condition property="obx.exp.CS">
martin@2871
   153
    <or>
martin@2871
   154
      <equals arg1="yes" arg2="${obx.export.CS}" />
martin@2871
   155
      <equals arg1="true" arg2="${obx.export.CS}" />
martin@2871
   156
    </or>
martin@2871
   157
  </condition>
asier@19231
   158
  
asier@19231
   159
  <condition property="obx.exp.validate">
asier@19231
   160
    <or>
asier@19231
   161
      <equals arg1="yes" arg2="${obx.export.validate}" />
asier@19231
   162
      <equals arg1="true" arg2="${obx.export.validate}" />
asier@19231
   163
    </or>
asier@19231
   164
  </condition>
asier@43
   165
antonio@3337
   166
  <condition property="timestamp">
antonio@3337
   167
    <or>
antonio@3337
   168
      <equals arg1="no" arg2="${execute.update.build.timestamp}" />
antonio@3337
   169
      <equals arg1="false" arg2="${execute.update.build.timestamp}" />
antonio@3337
   170
    </or>
antonio@3337
   171
  </condition>
antonio@3337
   172
martin@2871
   173
  <condition property="jakarta.base" value="${env.CATALINA_BASE}" else="${jakarta.home}">
martin@2871
   174
    <and>
martin@2871
   175
      <isset property="env.CATALINA_BASE" />
martin@2871
   176
    </and>
martin@2871
   177
  </condition>
martin@2871
   178
  <property name="log.path" location="${jakarta.base}/logs" />
martin@2871
   179
  <property name="lib" location="${jakarta.home}/common" />
martin@2871
   180
  <property name="jakarta.context" location="${jakarta.base}/webapps/${context.name}" />
asier@6240
   181
juanpablo@6241
   182
  <condition property="build.maxmemory" value="1024M" else="512M">
juanpablo@6241
   183
    <or>
juanpablo@6241
   184
      <equals arg1="${os.arch}" arg2="amd64" />
juanpablo@6241
   185
      <equals arg1="${os.arch}" arg2="x86_64" />
juanpablo@6241
   186
      <equals arg1="${os.arch}" arg2="ia64" />
juanpablo@6241
   187
    </or>
asier@6240
   188
  </condition>
stefan@124
   189
juanpablo@7924
   190
  <condition property="allow.root.user" value="true" else="false">
juanpablo@7924
   191
    <or>
juanpablo@7924
   192
      <equals arg1="yes" arg2="${allow.root}" />
juanpablo@7924
   193
      <equals arg1="true" arg2="${allow.root}" />
juanpablo@7924
   194
    </or>
juanpablo@7924
   195
  </condition>
juanpablo@7924
   196
martin@2871
   197
  <condition property="no.java.home" value="true">
martin@2871
   198
    <not>
martin@2871
   199
      <isset property="env.JAVA_HOME" />
martin@2871
   200
    </not>
martin@2871
   201
  </condition>
juanpablo@1548
   202
antonio@2838
   203
  <condition property="bbdd.owner.url" value="${bbdd.url}/${bbdd.sid}" else="${bbdd.url}">
antonio@2838
   204
    <and>
martin@2871
   205
      <equals arg1="${bbdd.rdbms}" arg2="POSTGRE" />
antonio@2838
   206
    </and>
antonio@2838
   207
  </condition>
juanpablo@7924
   208
juanpablo@7924
   209
  <condition property="root.user">
juanpablo@7924
   210
    <and>
juanpablo@7924
   211
      <equals arg1="${user.name}" arg2="root" />
juanpablo@7924
   212
      <not>
juanpablo@7924
   213
        <contains string="${os.name}" substring="Windows" />
juanpablo@7924
   214
      </not>
juanpablo@7924
   215
      <equals arg1="false" arg2="${allow.root.user}" />
juanpablo@7924
   216
    </and>
juanpablo@7924
   217
  </condition>
juanpablo@7924
   218
stefan@9215
   219
  <!-- Minimal classpath used for executing Wad at compile time -->
stefan@9215
   220
  <path id="wad.class.path">
stefan@9215
   221
    <fileset dir="${base.lib}">
stefan@9215
   222
      <include name="**/*.jar" />
stefan@9215
   223
    </fileset>
stefan@9215
   224
    <fileset dir="${build.core.lib}">
stefan@9215
   225
      <include name="openbravo-core.jar" />
stefan@9215
   226
    </fileset>
stefan@9215
   227
    <fileset dir="${build.wad.lib}">
stefan@9215
   228
      <include name="openbravo-wad.jar" />
stefan@9215
   229
    </fileset>
stefan@9215
   230
  </path>
stefan@9215
   231
martin@2871
   232
  <path id="project.class.path">
antonio@7894
   233
    <dirset dir="${base.modules}">
antonio@7894
   234
      <include name="*/build/classes/" />
antonio@7894
   235
    </dirset>
antonio@10098
   236
    <pathelement path="${basedir}/src-util/modulescript/build/classes/" />
martin@2871
   237
    <pathelement path="${build}" />
martin@2871
   238
    <pathelement path="${base.src}" />
martin@2871
   239
    <fileset dir="${base.lib}">
martin@2871
   240
      <include name="**/*.jar" />
martin@2871
   241
    </fileset>
martin@2871
   242
    <fileset dir="${build.core.lib}">
martin@2871
   243
      <include name="openbravo-core.jar" />
martin@2871
   244
    </fileset>
martin@2871
   245
    <fileset dir="${build.trl.lib}">
martin@2871
   246
      <include name="openbravo-trl.jar" />
martin@2871
   247
    </fileset>
martin@2871
   248
    <fileset dir="${build.wad.lib}">
martin@2871
   249
      <include name="openbravo-wad.jar" />
martin@2871
   250
    </fileset>
martin@2871
   251
    <fileset dir="${base.lib}">
martin@2871
   252
      <include name="**/*.jar" />
asier@24247
   253
      <exclude name="**/test/*.jar" />
martin@2871
   254
    </fileset>
martin@2871
   255
    <fileset dir="${base.db}/lib/">
martin@2871
   256
      <include name="**/*.jar" />
martin@2871
   257
    </fileset>
martin@2871
   258
    <fileset dir="${base.modules}">
martin@2871
   259
      <include name="*/lib/**" />
asier@24247
   260
       <exclude name="**/test/*.jar" />
martin@2871
   261
    </fileset>
antonio@7894
   262
  </path>
antonio@7894
   263
antonio@7894
   264
  <!-- This classpath is needed only for the compile.apply.module task-->
antonio@7894
   265
  <path id="apply.module.compile.classpath">
antonio@6886
   266
    <dirset dir="${base.modules}">
antonio@6886
   267
      <include name="*/build/classes/" />
antonio@6886
   268
    </dirset>
antonio@6886
   269
    <pathelement path="${basedir}/../../src-util/modulescript/build/classes/" />
antonio@7543
   270
    <pathelement path="${build.apply.module}" />
antonio@7543
   271
    <pathelement path="${base.src}" />
antonio@7543
   272
    <fileset dir="${base.lib}">
antonio@7543
   273
      <include name="**/*.jar" />
antonio@7543
   274
    </fileset>
antonio@7543
   275
    <fileset dir="${build.core.lib}">
antonio@7543
   276
      <include name="openbravo-core.jar" />
antonio@7543
   277
    </fileset>
antonio@7543
   278
    <fileset dir="${build.trl.lib}">
antonio@7543
   279
      <include name="openbravo-trl.jar" />
antonio@7543
   280
    </fileset>
antonio@7543
   281
    <fileset dir="${build.wad.lib}">
antonio@7543
   282
      <include name="openbravo-wad.jar" />
antonio@7543
   283
    </fileset>
antonio@7543
   284
    <fileset dir="${base.lib}">
antonio@7543
   285
      <include name="**/*.jar" />
antonio@7543
   286
    </fileset>
antonio@7543
   287
    <fileset dir="${base.db}/lib/">
antonio@7543
   288
      <include name="**/*.jar" />
antonio@7543
   289
    </fileset>
antonio@7543
   290
    <fileset dir="${base.modules}">
antonio@7543
   291
      <include name="*/lib/**" />
antonio@7543
   292
    </fileset>
antonio@7894
   293
  </path>
martin@14869
   294
  
antonio@7894
   295
  <!-- This classpath is needed only for the apply.module task-->
antonio@7894
   296
  <path id="apply.module.runtime.classpath">
antonio@7543
   297
    <dirset dir="${base.modules}">
antonio@7543
   298
      <include name="*/build/classes/" />
antonio@7543
   299
    </dirset>
antonio@7543
   300
    <pathelement path="${basedir}/../../src-util/modulescript/build/classes/" />
antonio@7541
   301
    <pathelement path="${build.apply.module}" />
antonio@7543
   302
    <pathelement path="${build}" />
antonio@7541
   303
    <pathelement path="${base.src}" />
antonio@7541
   304
    <fileset dir="${base.lib}">
antonio@7541
   305
      <include name="**/*.jar" />
antonio@7541
   306
    </fileset>
antonio@7541
   307
    <fileset dir="${build.core.lib}">
antonio@7541
   308
      <include name="openbravo-core.jar" />
antonio@7541
   309
    </fileset>
antonio@7541
   310
    <fileset dir="${build.trl.lib}">
antonio@7541
   311
      <include name="openbravo-trl.jar" />
antonio@7541
   312
    </fileset>
antonio@7541
   313
    <fileset dir="${build.wad.lib}">
antonio@7541
   314
      <include name="openbravo-wad.jar" />
antonio@7541
   315
    </fileset>
antonio@7541
   316
    <fileset dir="${base.lib}">
antonio@7541
   317
      <include name="**/*.jar" />
antonio@7541
   318
    </fileset>
antonio@7541
   319
    <fileset dir="${base.db}/lib/">
antonio@7541
   320
      <include name="**/*.jar" />
antonio@7541
   321
    </fileset>
antonio@7541
   322
    <fileset dir="${base.modules}">
antonio@7541
   323
      <include name="*/lib/**" />
antonio@7541
   324
    </fileset>
antonio@7541
   325
  </path>
martin@14869
   326
  
antonio@5617
   327
  <macrodef name="updatesystemstatus">
martin@14869
   328
     <attribute name="v" default="NOT SET"/>
martin@14869
   329
     <sequential>
martin@14869
   330
       <sql driver="${bbdd.driver}" url="${bbdd.owner.url}" userid="${bbdd.user}" password="${bbdd.password}" onerror="continue" autocommit="true">
martin@14869
   331
         <classpath> <fileset dir="${base.lib}"> <include name="**/*.jar"> </include> </fileset> </classpath>
martin@14869
   332
         <transaction> UPDATE ad_system_info SET system_status='@{v}' ;
antonio@5618
   333
                       DELETE FROM ad_error_log where system_status=(select system_status from ad_system_info)
antonio@5618
   334
         </transaction>
martin@14869
   335
       </sql>
martin@14869
   336
     </sequential>
antonio@5617
   337
  </macrodef>
martin@14869
   338
  
antonio@16688
   339
  <macrodef name="updatesystemstatuswhennot">
antonio@16688
   340
    <attribute name="v" default="NOT SET"/>
antonio@16688
   341
    <attribute name="previous" default="NOT SET"/>
antonio@16688
   342
     <sequential>
antonio@16688
   343
       <sql driver="${bbdd.driver}" url="${bbdd.owner.url}" userid="${bbdd.user}" password="${bbdd.password}" onerror="continue" autocommit="true">
antonio@16688
   344
         <classpath> <fileset dir="${base.lib}"> <include name="**/*.jar"> </include> </fileset> </classpath>
antonio@16688
   345
         <transaction> UPDATE ad_system_info SET system_status='@{v}' where system_status!='@{previous}' ;
antonio@16688
   346
                       DELETE FROM ad_error_log where system_status=(select system_status from ad_system_info)
antonio@16688
   347
         </transaction>
antonio@16688
   348
       </sql>
antonio@16688
   349
     </sequential>
antonio@16688
   350
  </macrodef>
antonio@16688
   351
  
martin@2871
   352
  <taskdef resource="axis-tasks.properties" classpathref="project.class.path" />
martin@14869
   353
  
asier@4277
   354
  <target name="init" depends="code.rev">
juanpablo@11541
   355
    <fail if="root.user" message="Don't run ant tasks with the root user" />
martin@2871
   356
    <fail if="no.java.home" message="The environment variable JAVA_HOME is not set." />
martin@2871
   357
  </target>
stefan@124
   358
martin@2871
   359
  <target name="code.rev" depends="set.code.rev">
juanpablo@3841
   360
    <condition property="code.revision" value="${hg.id}" else="0">
juanpablo@3841
   361
      <isset property="hg.id" />
martin@2871
   362
    </condition>
martin@2871
   363
  </target>
ivan@812
   364
juanpablo@3841
   365
  <target name="set.code.rev" if="is.hg">
juanpablo@3841
   366
    <exec executable="hg" outputproperty="hg.id" failifexecutionfails="false">
martin@14869
   367
      <arg value="id"/>
martin@14869
   368
      <arg value="-i"/>
juanpablo@3841
   369
    </exec>
martin@2871
   370
  </target>
asier@43
   371
miguel@16422
   372
  <target name="compile.complete" depends="init, core.lib, wad.lib, trl.lib">
martin@2871
   373
    <ant dir="${base.src}" target="compile.complete" inheritAll="true" inheritRefs="true" />
martin@2871
   374
  </target>
asier@2853
   375
shankar@20726
   376
  <target name="migrate.attachments" depends="init">
shankar@20765
   377
    <taskdef name="MigrateAttachments" classname="org.openbravo.erpCommon.utility.MigrateAttachments" >
shankar@20726
   378
      <classpath refid="project.class.path" />
shankar@20765
   379
    </taskdef>
shankar@20765
   380
    <MigrateAttachments/>
shankar@20726
   381
  </target>
shankar@20726
   382
asier@3013
   383
  <target name="smartbuild" depends="init">
martin@3038
   384
    <property name="smart.mode" value="true" />
antonio@2996
   385
    <property name="onlyIfModified" value="true" />
martin@3038
   386
    <antcall target="core.lib" />
martin@14869
   387
    
asier@4288
   388
    <condition property="no.local">
asier@4288
   389
      <not>
asier@4288
   390
        <istrue value="${local}" />
asier@4288
   391
      </not>
asier@4288
   392
    </condition>
asier@4288
   393
    <antcall target="update.database.if.no.local" />
martin@14869
   394
    
martin@3038
   395
    <antcall target="wad.lib" />
martin@14869
   396
    
asier@5219
   397
    <taskdef name="CheckSumCondition" classname="org.openbravo.utils.CheckSumCondition">
asier@5219
   398
      <classpath refid="project.class.path" />
asier@5219
   399
    </taskdef>
martin@14869
   400
    
martin@14869
   401
    <CheckSumCondition obDir="${basedir}"
martin@14869
   402
                       type="md5.wad"
martin@14869
   403
                       property="test.md5.wad"/>
martin@3038
   404
martin@3038
   405
    <condition property="new.wad">
martin@14869
   406
        <istrue value="${test.md5.wad}"/>
martin@3038
   407
    </condition>
martin@3038
   408
martin@3038
   409
    <antcall target="trl.lib" />
martin@14869
   410
    
asier@3660
   411
    <antcall inheritall="true" inheritrefs="true" target="generate.entities.quick" />
martin@2917
   412
asier@3013
   413
    <ant dir="${base.src}" target="smartbuild" inheritAll="true" inheritRefs="true" />
martin@3038
   414
antonio@5615
   415
    <ant dir="${base.db}" target="setApplied" inheritAll="true" inheritRefs="true" />
antonio@4933
   416
    <antcall target="build.deploy" />
antonio@16688
   417
    <updatesystemstatuswhennot v="RB51" previous="RB12"/>
martin@2917
   418
    <!-- only restart tomcat if the restart prop was set to true -->
martin@2917
   419
    <condition property="dorestart">
martin@2917
   420
      <istrue value="${restart}" />
martin@2917
   421
    </condition>
martin@2917
   422
    <antcall target="if.restart.tomcat" />
martin@2871
   423
  </target>
martin@3038
   424
asier@3008
   425
  <target name="update.database.if.no.local" if="no.local">
asier@3008
   426
    <antcall target="update.database" />
asier@3008
   427
  </target>
antonio@2996
   428
asier@2982
   429
  <target name="build.deploy">
martin@3038
   430
    <antcall target="build.deploy.war" />
martin@3038
   431
    <antcall target="build.deploy.class" />
asier@2982
   432
  </target>
martin@3038
   433
asier@2982
   434
  <target name="build.deploy.class" if="mode.class">
asier@2982
   435
    <ant dir="${base.src}" target="copy.files" inheritAll="true" inheritRefs="true" />
asier@2982
   436
    <mkdir dir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib" />
martin@3038
   437
    <copy todir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib" file="${build.core.lib}/openbravo-core.jar" encoding="UTF-8" />
asier@2982
   438
  </target>
martin@3038
   439
stefan@9978
   440
  <!-- Only needed in special cases. See issue 15709 for details.
stefan@9978
   441
       This task (if deploy.mode=class) does sync jar-files from WebContent -> deployed webapp (& delete orphan jars)
stefan@9978
   442
  -->
stefan@9978
   443
  <target name="copy.files.jarsync" depends="init" if="mode.class">
stefan@9978
   444
    <ant dir="${base.src}" target="copy.files.jarsync.do" inheritAll="true" inheritRefs="true" />
stefan@9978
   445
  </target>
stefan@9978
   446
asier@2982
   447
  <target name="build.deploy.war" if="mode.war">
martin@3038
   448
    <antcall target="war" />
asier@2982
   449
  </target>
martin@2345
   450
martin@2917
   451
  <target name="if.restart.tomcat" if="dorestart">
martin@2917
   452
    <antcall target="tomcat.restart" />
martin@2917
   453
  </target>
martin@2345
   454
miguel@16422
   455
  <target name="compile" depends="init,core.lib, wad.lib, trl.lib">
martin@2871
   456
    <ant dir="${base.src}" target="compile" inheritAll="true" inheritRefs="true" />
martin@2871
   457
  </target>
martin@2345
   458
antonio@6897
   459
  <target name="buildvalidation" depends="init, core.lib">
martin@14869
   460
    <updatesystemstatus v="RB11"/> 
antonio@7925
   461
    <condition property="buildValidation.var">
martin@14869
   462
      <istrue value="${buildValidation}"  />
antonio@7925
   463
    </condition>
antonio@6897
   464
    <ant dir="src-util/buildvalidation" target="buildvalidation" inheritAll="true" inheritRefs="true" />
antonio@6886
   465
  </target>
martin@14869
   466
  
antonio@6886
   467
  <target name="compile.buildvalidation" depends="init, core.lib">
antonio@6886
   468
    <ant dir="src-util/buildvalidation" target="compile" inheritAll="true" inheritRefs="true" />
antonio@6886
   469
  </target>
martin@14869
   470
  
antonio@6886
   471
  <target name="compile.modulescript" depends="init, core.lib">
antonio@6886
   472
    <ant dir="src-util/modulescript" target="compile" inheritAll="true" inheritRefs="true" />
antonio@6886
   473
  </target>
antonio@6886
   474
antonio@7535
   475
  <target name="compile.complete.deploy" depends="compile.complete.development, compile.complete.war">
antonio@7512
   476
asier@5216
   477
    <!-- Calculate wad checksum to enable smartbuild-->
asier@5219
   478
    <taskdef name="CheckSumCondition" classname="org.openbravo.utils.CheckSumCondition">
asier@5219
   479
      <classpath refid="project.class.path" />
asier@5219
   480
    </taskdef>
martin@14869
   481
    
martin@14869
   482
    <CheckSumCondition obDir="${basedir}"
martin@14869
   483
                           type="md5.wad"
martin@14869
   484
                           property="test.md5.wad"/>
martin@2871
   485
  </target>
asier@43
   486
asier@7164
   487
  <target name="compile.complete.development" depends="init" unless="mode.war">
martin@14869
   488
    <updatesystemstatus v="RB43"/>
martin@2871
   489
    <ant dir="${base.src}" target="compile.complete.development" inheritAll="true" inheritRefs="true" />
martin@2871
   490
  </target>
asier@43
   491
martin@2871
   492
  <target name="compile.complete.war" depends="init" if="mode.war">
martin@14869
   493
    <updatesystemstatus v="RB43"/>
martin@2871
   494
    <antcall target="compile.complete" />
martin@2871
   495
    <antcall target="war" />
martin@2871
   496
  </target>
asier@1929
   497
stefan@5405
   498
  <target name="compile.deploy" depends="compile.war, compile.development">
martin@14869
   499
    <updatesystemstatus v="RB51"/>
martin@2871
   500
  </target>
martin@2686
   501
asier@7164
   502
  <target name="compile.development" depends="init" unless="mode.war">
martin@2871
   503
    <ant dir="${base.src}" target="compile.development" inheritAll="true" inheritRefs="true" />
martin@2871
   504
  </target>
martin@2686
   505
martin@2871
   506
  <target name="validate.database">
martin@2871
   507
    <ant dir="${base.src}" target="validate.database" inheritAll="true" inheritRefs="true" />
martin@2871
   508
  </target>
asier@1929
   509
martin@2871
   510
  <target name="validate.modules">
martin@2871
   511
    <ant dir="${base.src}" target="validate.modules" inheritAll="true" inheritRefs="true" />
martin@2871
   512
  </target>
asier@43
   513
martin@2871
   514
  <target name="compile.war" if="mode.war">
asier@7165
   515
    <antcall target="generate.entities" />
martin@2871
   516
    <antcall target="compile" />
martin@2871
   517
    <antcall target="war" />
martin@2871
   518
  </target>
ivan@1738
   519
martin@2871
   520
  <target name="compile.web" depends="init">
martin@2871
   521
    <ant dir="${base.src}" target="compile.web" inheritAll="true" inheritRefs="true" />
martin@2871
   522
  </target>
asier@43
   523
martin@2871
   524
  <target name="compile.web.development" depends="init">
martin@2871
   525
    <ant dir="${base.src}" target="compile.web.development" inheritAll="true" inheritRefs="true" />
martin@2871
   526
  </target>
martin@2245
   527
martin@2871
   528
  <target name="eclipse.compile" depends="init">
ivan@5987
   529
    <fail unless="eclipse.running" message="eclipse.* tasks must be executed inside Eclipse" />
martin@2871
   530
    <ant dir="${base.src.core}" target="build.jar" inheritAll="true" inheritRefs="true" />
martin@2871
   531
    <ant dir="${base.src.trl}" target="build.jar" inheritAll="true" inheritRefs="true" />
martin@2871
   532
    <ant dir="${base.src.wad}" target="build.jar" inheritAll="true" inheritRefs="true" />
martin@2871
   533
    <ant dir="${base.src}" target="eclipse.compile" inheritAll="true" inheritRefs="true" />
ivan@5987
   534
    <echo message="Refreshing project..." level="info" />
martin@2871
   535
    <eclipse.refreshLocal resource="openbravo" depth="infinite" />
ivan@5987
   536
    <echo message="Building project..." level="info" />
martin@2871
   537
    <eclipse.incrementalBuild project="openbravo" kind="incremental" />
martin@2871
   538
  </target>
martin@2284
   539
martin@2871
   540
  <target name="eclipse.compile.complete" depends="init">
ivan@5987
   541
    <fail unless="eclipse.running" message="eclipse.* tasks must be executed inside Eclipse" />
martin@2871
   542
    <ant dir="${base.src.core}" target="build.jar" inheritAll="true" inheritRefs="true" />
martin@2871
   543
    <ant dir="${base.src.trl}" target="build.jar" inheritAll="true" inheritRefs="true" />
martin@2871
   544
    <ant dir="${base.src.wad}" target="build.jar" inheritAll="true" inheritRefs="true" />
martin@2871
   545
    <ant dir="${base.src}" target="eclipse.compile.complete" inheritAll="true" inheritRefs="true" />
ivan@5987
   546
    <echo message="Refreshing project..." level="info" />
martin@2871
   547
    <eclipse.refreshLocal resource="openbravo" depth="infinite" />
ivan@5987
   548
    <echo message="Building project..." level="info" />
martin@2871
   549
    <eclipse.incrementalBuild project="openbravo" kind="full" />
martin@2871
   550
  </target>
asier@43
   551
martin@2871
   552
  <target name="compile.src.gen" depends="init">
martin@2871
   553
    <ant dir="${base.src}" target="compile.src.gen" inheritAll="true" inheritRefs="true" />
martin@2871
   554
  </target>
martin@2830
   555
martin@3794
   556
  <target name="generate.java.doc">
stefan@27905
   557
    <javadoc Windowtitle="${title}" access="protected" Header="${header}" Footer="${footer}" destdir="${build.docs}" maxmemory="1024M">
stefan@27905
   558
      <sourcepath>
stefan@27905
   559
        <pathelement path="${base.src}" />
stefan@27905
   560
        <pathelement path="${base.src.test}/src" />
stefan@27905
   561
        <pathelement path="${build.AD}" />
stefan@27905
   562
        <pathelement path="${base.src.core}/src" />
stefan@27905
   563
        <pathelement path="${base.src.gen}" />
stefan@27905
   564
        <pathelement path="build/javasqlc/src" />
stefan@27905
   565
        <pathelement path="build/javasqlc/srcAD" />
stefan@27905
   566
        <dirset dir="${base.modules}">
stefan@27905
   567
          <include name="*/src" />
stefan@27905
   568
          <include name="*/src-test" />
stefan@27905
   569
        </dirset>
stefan@27905
   570
      </sourcepath>
martin@14869
   571
      <excludepackage name="org.openbravo.erpWindows.*"/>
martin@3794
   572
      <classpath>
martin@14869
   573
        <path refid="project.class.path"/>
martin@3794
   574
        <pathelement path="lib/build/js.jar" />
stefan@27905
   575
        <fileset dir="${base.modules}">
stefan@27905
   576
          <include name="*/lib/test/*.jar" />
stefan@27905
   577
        </fileset>
martin@3794
   578
      </classpath>
stefan@27905
   579
      <link href="http://docs.oracle.com/javase/6/docs/api/"/>
martin@3794
   580
    </javadoc>
martin@3794
   581
  </target>
martin@3794
   582
martin@2871
   583
  <target name="generate.entities">
martin@2871
   584
    <ant dir="${base.src}" target="generate.entities" inheritAll="true" inheritRefs="true" />
martin@2871
   585
  </target>
asier@43
   586
martin@2871
   587
  <target name="generate.entities.quick">
martin@2871
   588
    <ant dir="${base.src}" target="generate.entities.quick" inheritAll="true" inheritRefs="true" />
martin@2871
   589
  </target>
juanpablo@131
   590
stefan@11851
   591
  <!-- build-internal forking helper -->
stefan@11851
   592
  <target name="generate.entities.quick.forked">
stefan@11851
   593
    <ant dir="${base.src}" target="generate.entities.quick.forked" inheritAll="true" inheritRefs="true" />
stefan@11851
   594
  </target>
stefan@11851
   595
asier@24247
   596
  <target name="compile.test" depends="init">
asier@24247
   597
    <ant dir="${base.src.test}" target="compile.test" inheritAll="true" inheritRefs="true" />
asier@24247
   598
  </target>
asier@24247
   599
  
stefan@5674
   600
  <target name="run.tests" depends="init">
asier@24247
   601
    <ant dir="${base.src.test}" target="run.tests" inheritAll="true" inheritRefs="true" />
martin@3625
   602
  </target>
martin@3625
   603
stefan@5674
   604
  <target name="run.all.tests" depends="init">
asier@24247
   605
    <ant dir="${base.src.test}" target="run.all.tests" inheritAll="true" inheritRefs="true" />
martin@3656
   606
  </target>
martin@3656
   607
priya@6927
   608
  <target name="run.webservice.tests" depends="init">
asier@24247
   609
      <ant dir="${base.src.test}" target="run.webservice.tests" inheritAll="true" inheritRefs="true" />
priya@6927
   610
  </target>
priya@6927
   611
stefan@5674
   612
  <target name="run.quick.tests" depends="init">
asier@24247
   613
    <ant dir="${base.src.test}" target="run.quick.tests" inheritAll="true" inheritRefs="true" />
martin@3625
   614
  </target>
martin@3625
   615
asier@27099
   616
  <target name="run.test" depends="init">
asier@27099
   617
    <ant dir="${base.src.test}" target="run.test" inheritAll="true" inheritRefs="true" />
asier@27099
   618
  </target>
asier@27099
   619
stefan@3810
   620
  <target name="run.api.test.javascript">
asier@24993
   621
    <ant dir="${base.src.test}" target="run.api.test.javascript" inheritAll="true" inheritRefs="true" />
ivan@3752
   622
  </target>
martin@14869
   623
  
martin@14869
   624
  <target name="run.api.test.model" 
martin@14869
   625
          description="Checks current xml db model and dictionary API for not-allowed changes. Requires stableDBdir parameter">
stefan@9371
   626
    <taskdef name="checkAPI" classname="org.openbravo.ddlutils.task.CheckAPIDistribution">
asier@3808
   627
      <classpath refid="project.class.path" />
asier@3808
   628
    </taskdef>
martin@14869
   629
    <checkAPI driver="${bbdd.driver}" 
martin@14869
   630
                  url="${bbdd.owner.url}" 
martin@14869
   631
                  user="${bbdd.user}" 
martin@14869
   632
                  password="${bbdd.password}" 
martin@14869
   633
                  stableDBdir="${stableDBdir}"
martin@14869
   634
                  testDBdir="${basedir}"
martin@14869
   635
                  verbosity="${bbdd.verbosity}"
martin@14869
   636
    />    
asier@3808
   637
  </target>
ivan@3752
   638
stefan@20707
   639
  <target name="export.sample.data.old" depends="code.rev">
stefan@20707
   640
    <ant dir="${base.src}" target="export.sample.data.old" inheritAll="true" inheritRefs="true" />
martin@2871
   641
  </target>
juanpablo@131
   642
stefan@20707
   643
  <target name="import.sample.data.old" depends="code.rev">
stefan@20707
   644
    <ant dir="${base.src}" target="import.sample.data.old" inheritAll="true" inheritRefs="true" />
martin@2871
   645
  </target>
juanpablo@131
   646
martin@2871
   647
  <target name="compile.src" depends="init">
martin@2871
   648
    <ant dir="${base.src}" target="compile.src" inheritAll="true" inheritRefs="true" />
martin@2871
   649
  </target>
juanpablo@131
   650
martin@2871
   651
  <target name="war" depends="init">
martin@2871
   652
    <ant dir="${base.src}" target="build.war" inheritAll="true" inheritRefs="true" />
martin@2871
   653
  </target>
juanpablo@131
   654
martin@2871
   655
  <target name="core.docs" depends="init">
martin@2871
   656
    <ant dir="${base.src.core}" target="doc" inheritAll="true" inheritRefs="true" />
martin@2871
   657
  </target>
juanpablo@131
   658
martin@2871
   659
  <target name="core.lib" depends="init">
martin@2871
   660
    <ant dir="${base.src.core}" target="build" inheritAll="true" inheritRefs="true" />
martin@2871
   661
    <antcall target="copy.core.lib" />
martin@2871
   662
  </target>
juanpablo@131
   663
martin@2871
   664
  <target name="copy.core.lib">
asier@2994
   665
    <copy file="${base.src.core}/lib/openbravo-core.jar" todir="${base.lib}/runtime" failonerror="false" />
martin@2871
   666
  </target>
juanpablo@131
   667
martin@2871
   668
  <target name="eclipse.wad.lib" depends="init">
martin@2871
   669
    <ant dir="${base.src.wad}" target="sqlc" inheritAll="true" inheritRefs="true" />
martin@2871
   670
    <eclipse.refreshLocal resource="OpenbravoWAD" depth="infinite" />
martin@2871
   671
    <eclipse.incrementalBuild project="OpenbravoWAD" kind="full" />
martin@2871
   672
  </target>
asier@43
   673
martin@2871
   674
  <target name="wad.docs" depends="init">
martin@2871
   675
    <ant dir="${base.src.wad}" target="doc" inheritAll="true" inheritRefs="true" />
martin@2871
   676
  </target>
juanpablo@179
   677
martin@2871
   678
  <target name="wad.lib" depends="init">
martin@2871
   679
    <ant dir="${base.src.wad}" target="build" inheritAll="true" inheritRefs="true" />
martin@2871
   680
  </target>
juanpablo@179
   681
martin@2871
   682
  <target name="eclipse.trl.lib" depends="init">
martin@2871
   683
    <ant dir="${base.src.trl}" target="sqlc" inheritAll="true" inheritRefs="true" />
martin@2871
   684
    <eclipse.refreshLocal resource="OpenbravoTrl" depth="infinite" />
martin@2871
   685
    <eclipse.incrementalBuild project="OpenbravoTrl" kind="full" />
martin@2871
   686
  </target>
juanpablo@179
   687
martin@2871
   688
  <target name="trl.docs" depends="init">
martin@2871
   689
    <ant dir="${base.src.trl}" target="doc" inheritAll="true" inheritRefs="true" />
martin@2871
   690
  </target>
asier@43
   691
martin@2871
   692
  <target name="trl.lib" depends="init">
martin@2871
   693
    <ant dir="${base.src.trl}" target="build" inheritAll="true" inheritRefs="true" />
martin@2871
   694
  </target>
asier@43
   695
martin@2871
   696
  <target name="database.lib" depends="init">
martin@2871
   697
    <ant dir="${base.src.db}" target="jar" inheritAll="true" inheritRefs="true" />
asier@2995
   698
    <copy file="${base.src.db}/build/lib/dbmanager.jar" todir="${base.db}/lib" failonerror="false" />
martin@2871
   699
  </target>
martin@2345
   700
martin@2871
   701
  <target name="clean" depends="init">
martin@2871
   702
    <ant dir="${base.src}" target="clean" inheritAll="true" inheritRefs="true" />
martin@2871
   703
  </target>
martin@2345
   704
martin@2871
   705
  <target name="trl.clean" depends="init">
martin@2871
   706
    <ant dir="${base.src}" target="trl.clean" inheritAll="true" inheritRefs="true" />
martin@2871
   707
  </target>
martin@2345
   708
stefan@11820
   709
  <target name="trl.remove.unused" depends="init">
stefan@11820
   710
    <ant dir="${base.src}" target="trl.remove.unused" inheritAll="true" inheritRefs="true" />
stefan@11820
   711
  </target>
stefan@11820
   712
martin@2871
   713
  <target name="translate" depends="init">
martin@2871
   714
    <ant dir="${base.src}" target="translate" inheritAll="true" inheritRefs="true" />
martin@2871
   715
  </target>
martin@2686
   716
martin@2871
   717
  <target name="translate.modules" depends="init">
martin@2871
   718
    <ant dir="${base.src}" target="translate.modules" inheritAll="true" inheritRefs="true" />
martin@2871
   719
  </target>
martin@2871
   720
martin@2871
   721
  <target name="installWebService" depends="init">
martin@2871
   722
    <ant dir="${base.src}" target="installWebService" inheritAll="true" inheritRefs="true">
martin@2871
   723
      <property name="wsdd" value="1" />
martin@2871
   724
    </ant>
martin@2871
   725
  </target>
martin@2871
   726
martin@2871
   727
  <target name="uninstallWebService" depends="init">
martin@2871
   728
    <ant dir="${base.src}" target="uninstallWebService" inheritAll="true" inheritRefs="true" />
martin@2871
   729
  </target>
martin@2871
   730
miguel@16113
   731
  <target name="install.source" depends="init, cleanSubfolders, create.database, wad.lib, trl.lib, compile.complete.deploy">
martin@14869
   732
    <echo message="applying modules" />    
antonio@7535
   733
    <antcall inheritall="true" inheritrefs="true" target="apply.module" />
antonio@5615
   734
augusto@28711
   735
    <antcall inheritall="true" target="import.sample.data" />
martin@14869
   736
    <updatesystemstatus v="RB51"/> 
antonio@5626
   737
    <ant dir="${base.db}" target="setApplied" inheritAll="true" inheritRefs="true" />
martin@2871
   738
martin@2871
   739
    <!--
martin@2686
   740
		<antcall target="validate.database" />
martin@2686
   741
		<antcall target="validate.modules" />
martin@2704
   742
		-->
martin@2871
   743
  </target>
juanpablo@131
   744
miguel@16113
   745
  <target name="eclipse.install.source" depends="init, cleanSubfolders, create.database">
ivan@5987
   746
    <fail unless="eclipse.running" message="eclipse.* tasks must be executed inside Eclipse" />
ivan@5987
   747
    <echo message="Building OpenbravoCore project..." level="info" />
martin@14869
   748
    <eclipse.incrementalBuild project="OpenbravoCore" kind="full"/>
martin@14869
   749
    <antcall target="eclipse.wad.lib"/>
martin@14869
   750
    <antcall target="eclipse.trl.lib"/>
martin@14869
   751
    <antcall target="eclipse.compile.complete"/>
martin@14869
   752
    <echo message="applying modules" />    
martin@4287
   753
    <antcall inheritall="true" inheritrefs="true" target="apply.module" />
rafael@3544
   754
    <antcall target="import.sample.data" />
martin@14869
   755
    <updatesystemstatus v="RB51"/>
antonio@6472
   756
    <ant dir="${base.db}" target="setApplied" inheritAll="true" inheritRefs="true" />
martin@2871
   757
  </target>
asier@43
   758
stefan@5405
   759
  <target name="create.database" depends="init, core.lib, database.lib">
martin@2871
   760
    <ant dir="${base.db}" antfile="build-create.xml" target="create.database" inheritAll="true" inheritRefs="true" />
martin@2871
   761
    <antcall target="db.apply.modules.sampledata" />
martin@2871
   762
  </target>
antonio@1335
   763
antonio@6897
   764
  <target name="update.database" depends="init, core.lib, database.lib, buildvalidation">
martin@14869
   765
    <updatesystemstatus v="RB12"/>
antonio@4870
   766
    <ant dir="${base.db}" target="update.database.java" inheritAll="true" inheritRefs="true" />
martin@4287
   767
    <antcall target="generate.entities.quick" />
antonio@7535
   768
    <antcall target="apply.module" />
martin@2871
   769
  </target>
asier@1929
   770
antonio@6897
   771
  <target name="update.database.mod" depends="init, core.lib, database.lib, buildvalidation">
martin@14869
   772
    <updatesystemstatus v="RB12"/>
antonio@7545
   773
    <ant dir="${base.db}" target="update.database.mod.java" inheritAll="true" inheritRefs="true" />
antonio@7535
   774
    <antcall target="generate.entities.quick" />
antonio@7535
   775
    <antcall target="apply.module" />
martin@2871
   776
  </target>
asier@43
   777
stefan@5405
   778
  <target name="create.database.script" depends="init, core.lib">
martin@2871
   779
    <ant dir="${base.db}" target="create.database.script" inheritAll="true" inheritRefs="true" />
martin@2871
   780
  </target>
asier@43
   781
stefan@5405
   782
  <target name="update.database.script" depends="init, core.lib">
martin@2871
   783
    <ant dir="${base.db}" target="update.database.script" inheritAll="true" inheritRefs="true" />
martin@2871
   784
  </target>
adrian@97
   785
antonio@5420
   786
  <target name="export.database" depends="init, core.lib, database.lib, generate.entities.quick">
martin@2871
   787
    <ant dir="${base.db}" target="export.database.structure" inheritAll="true" inheritRefs="true" />
martin@2871
   788
  </target>
adrian@164
   789
stefan@5405
   790
  <target name="export.config.script" depends="init, core.lib">
martin@2871
   791
    <ant dir="${base.db}" target="export.config.script" inheritAll="true" inheritRefs="true" />
martin@2871
   792
  </target>
asier@1929
   793
stefan@20707
   794
  <target name="export.sample.data" depends="init, core.lib">
stefan@20707
   795
    <ant dir="${base.db}" target="export.sample.data" inheritAll="true" inheritRefs="true" />
stefan@20707
   796
  </target>
stefan@20707
   797
stefan@20707
   798
  <target name="import.sample.data" depends="init, core.lib">
stefan@20707
   799
    <ant dir="${base.db}" target="import.sample.data" inheritAll="true" inheritRefs="true" />
stefan@20707
   800
  </target>
stefan@20707
   801
antonio@6108
   802
  <target name="db.apply.modules" if="apply.modules.on.update">
antonio@6074
   803
    <antcall inheritall="true" inheritrefs="true" target="apply.module" />
antonio@6074
   804
  </target>
antonio@6074
   805
martin@2871
   806
  <target name="db.apply.modules.sampledata" if="apply.modules.on.create">
antonio@5077
   807
    <antcall target="generate.entities" />
martin@4287
   808
    <antcall inheritall="true" inheritrefs="true" target="apply.module" />
martin@2871
   809
    <antcall target="import.sample.data" />
martin@2871
   810
  </target>
martin@2345
   811
martin@4287
   812
antonio@8501
   813
  <target name="apply.modules">
martin@4287
   814
asier@3995
   815
    <condition property="apply.modules.complete.compilation.var">
martin@14869
   816
      <istrue value="${apply.modules.complete.compilation}"  />
asier@3995
   817
    </condition>
martin@14869
   818
    
asier@3995
   819
    <condition property="apply.modules.simple.compilation.var">
asier@3995
   820
      <isfalse value="${apply.modules.complete.compilation.var}" />
asier@3995
   821
    </condition>
antonio@7516
   822
martin@14869
   823
    <updatesystemstatus v="RB43"/>
martin@14869
   824
    <antcall target="apply.modules.compile"/>
antonio@7516
   825
antonio@5611
   826
    <ant dir="${base.db}" target="setApplied" inheritAll="true" inheritRefs="true" />
antonio@7516
   827
asier@3995
   828
  </target>
martin@14869
   829
  
martin@4287
   830
  <target name="apply.module.forked">
martin@4287
   831
    <!-- 
martin@4287
   832
    Note: set reinitializeModel to false because otherwise the dal is re-initialized with classes and a model
martin@4287
   833
    which are not in sync (see issue: https://issues.openbravo.com/view.php?id=9376)
martin@4287
   834
    Note: applyModule can also be moved to a java task to fork it (to prevent this from occuring)
martin@4287
   835
    but then no output is visible for the user.
martin@4287
   836
    -->
martin@4287
   837
    <taskdef name="applyModule" classname="org.openbravo.erpCommon.modules.ApplyModuleTask">
martin@4287
   838
      <classpath refid="project.class.path" />
martin@4287
   839
    </taskdef>
antonio@15503
   840
    <applyModule userId="0" adminMode="true" forceRefData="${forceRefData}" propertiesFile="${base.config}/Openbravo.properties"/>
martin@4287
   841
  </target>
martin@14869
   842
  
antonio@7535
   843
  <target name="compile.apply.module" depends="init">
martin@14869
   844
    <updatesystemstatus v="RB31"/>
antonio@7535
   845
    <ant dir="${base.src}" target="compile.apply.module" inheritAll="true" inheritRefs="true" />
antonio@7535
   846
  </target>
martin@14869
   847
  
antonio@7541
   848
  <!--
antonio@7541
   849
  This task uses a special classpath.
antonio@7541
   850
  This classpath is equivalent to the normal project.class.path, except for the fact that that the normal build folder
antonio@7541
   851
  is replaced by the apply.module.build folder, in which the ApplyModule task related classes will be compiled.
antonio@7541
   852
  This is done to workaround the fact that the javac task needs to compile all the related classes when upgrading openbravo
antonio@7541
   853
  and if the normal build folder is included, none of them are recompiled by default unless the whole build directory is specified.
antonio@7541
   854
  -->
antonio@7535
   855
  <target name="apply.module" depends="compile.apply.module">
antonio@6492
   856
    <java classname="org.openbravo.erpCommon.modules.ApplyModuleTask" fork="true" maxmemory="${build.maxmemory}" failonerror="true">
antonio@15503
   857
      <arg line="'${base.src}' '${friendlyWarnings}' '${forceRefData}'" />
antonio@7543
   858
      <classpath refid="apply.module.runtime.classpath" />
martin@4287
   859
    </java>
martin@14869
   860
   <delete includeEmptyDirs="true"  dir="${build.apply.module}" />
martin@4287
   861
  </target>
martin@14869
   862
  
asier@6221
   863
  <target name="apply.modules.compile" depends="wad.lib">
martin@14869
   864
    <antcall target="apply.modules.compile.simple"/>
martin@14869
   865
    <antcall target="apply.modules.compile.complete"/>
asier@3995
   866
  </target>
martin@14869
   867
  
asier@3995
   868
  <target name="apply.modules.compile.simple" if="apply.modules.simple.compilation.var">
martin@2871
   869
    <antcall target="compile.deploy" />
asier@3995
   870
  </target>
martin@14869
   871
  
asier@3995
   872
  <target name="apply.modules.compile.complete" if="apply.modules.complete.compilation.var">
martin@14869
   873
     <antcall target="compile.complete.deploy" />
martin@2871
   874
  </target>
martin@14869
   875
  
martin@2871
   876
  <!-- 
martin@2345
   877
		apparently this does not overwrite the default catalina_opts, only
martin@2345
   878
		if it is not set will it be set to the value below 
martin@2345
   879
	-->
martin@2871
   880
  <property name="env.CATALINA_OPTS" value="-XX:MaxPermSize=128M" />
martin@2345
   881
martin@2871
   882
  <!-- 
martin@2345
   883
		This task is called from the Openbravo ui, it spawns a java call which again
martin@2345
   884
		calls the restart.tomcat.do task as a spawned task.
martin@2345
   885
	-->
martin@2871
   886
  <target name="tomcat.restart" description="Restart the tomcat server process">
martin@2917
   887
    <echo message="Restarting tomcat..." />
martin@2871
   888
    <java classname="org.openbravo.service.system.RestartTomcat" spawn="true" fork="true" maxmemory="${build.maxmemory}">
martin@2871
   889
      <arg line="${base.src}" />
martin@2871
   890
      <classpath refid="project.class.path" />
martin@2871
   891
    </java>
martin@2871
   892
  </target>
martin@2345
   893
martin@2871
   894
  <!--
martin@2345
   895
		Is called by the org.openbravo.service.system.RestartTomcat class.
martin@2345
   896
	-->
martin@2871
   897
  <target name="tomcat.restart.do" description="Restart the tomcat server process">
martin@2871
   898
    <echo message="Restarting Tomcat at ${env.CATALINA_HOME}" />
martin@2871
   899
    <java classname="org.apache.catalina.startup.Bootstrap" fork="true">
asier@25200
   900
      <classpath path=":${env.CATALINA_HOME}/bin/bootstrap.jar:${env.CATALINA_HOME}/bin/commons-logging-api.jar:${env.CATALINA_HOME}/bin/tomcat-juli.jar" />
martin@2871
   901
      <jvmarg value="-Dcatalina.home=${env.CATALINA_HOME}" />
martin@2871
   902
      <jvmarg value="-Dcatalina.base=${env.CATALINA_BASE}" />
martin@2871
   903
      <arg line="stop" />
martin@2871
   904
    </java>
martin@2871
   905
    <sleep description="Wait to give tomcat time to stop" seconds="20" />
stefan@9978
   906
stefan@9978
   907
    <!-- if deploy.mode=class this will sync (& delete orphan) jarfiles from WebContent -> tomcat-->
martin@14869
   908
    <antcall target="copy.files.jarsync"/>
stefan@9978
   909
stefan@9978
   910
    <java classname="org.apache.catalina.startup.Bootstrap" fork="true" spawn="true">
asier@25200
   911
      <classpath path=":${env.CATALINA_HOME}/bin/bootstrap.jar:${env.CATALINA_HOME}/bin/commons-logging-api.jar:${env.CATALINA_HOME}/bin/tomcat-juli.jar" />
martin@2871
   912
      <!-- note because CATALINA_OPTS can be multi argument the line attribute has to be used! -->
martin@2871
   913
      <jvmarg line="${env.CATALINA_OPTS}" />
martin@2871
   914
      <jvmarg value="-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager" />
martin@2871
   915
      <jvmarg value="-Djava.util.logging.config.file=${env.CATALINA_BASE}/conf/logging.properties" />
martin@2871
   916
      <jvmarg value="-Djava.endorsed.dirs=${env.CATALINA_HOME}/endorsed" />
martin@2871
   917
      <jvmarg value="-Dcatalina.base=${env.CATALINA_BASE}" />
martin@2871
   918
      <jvmarg value="-Dcatalina.home=${env.CATALINA_HOME}" />
martin@2871
   919
      <jvmarg value="-Djava.io.tmpdir=${env.CATALINA_BASE}/temp" />
martin@2871
   920
      <arg line="start" />
martin@2871
   921
    </java>
martin@2871
   922
  </target>
martin@2345
   923
martin@2871
   924
  <!-- 
martin@2345
   925
		This task is called from the Openbravo ui, it spawns a java call which again
martin@2345
   926
		calls the tomcat.reload.do task as a spawned task.
martin@2345
   927
	-->
martin@2871
   928
  <target name="tomcat.reload" description="Reload the Openbravo context">
martin@2917
   929
    <echo message="Reloading webapp..." />
martin@2871
   930
    <java classname="org.openbravo.service.system.ReloadContext" jvm="${env.JAVA_HOME}/bin/java" maxmemory="${build.maxmemory}" spawn="true" fork="true">
martin@2871
   931
      <arg line="${base.src}" />
martin@2871
   932
      <classpath refid="project.class.path" />
martin@2871
   933
    </java>
martin@2871
   934
  </target>
martin@2345
   935
martin@2871
   936
  <target name="tomcat.reload.do">
martin@2871
   937
    <taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask">
martin@2871
   938
      <classpath refid="project.class.path" />
martin@2871
   939
    </taskdef>
martin@2871
   940
    <reload url="${tomcat.manager.url}" username="${tomcat.manager.username}" password="${tomcat.manager.password}" path="/${context.name}" />
martin@2871
   941
  </target>
adrian@171
   942
martin@2871
   943
  <target name="tomcat.list">
martin@2871
   944
    <taskdef name="list" classname="org.apache.catalina.ant.ListTask">
martin@2871
   945
      <classpath refid="project.class.path" />
martin@2871
   946
    </taskdef>
martin@2871
   947
    <list url="${tomcat.manager.url}" username="${tomcat.manager.username}" password="${tomcat.manager.password}" />
martin@2871
   948
  </target>
martin@2345
   949
martin@2871
   950
  <target name="deploy.context">
martin@2871
   951
    <taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask">
martin@2871
   952
      <classpath refid="project.class.path" />
martin@2871
   953
    </taskdef>
martin@2871
   954
    <taskdef name="deploy.tomcat" classname="org.apache.catalina.ant.DeployTask">
martin@2871
   955
      <classpath refid="project.class.path" />
martin@2871
   956
    </taskdef>
martin@2871
   957
    <taskdef name="start" classname="org.apache.catalina.ant.StartTask">
martin@2871
   958
      <classpath refid="project.class.path" />
martin@2871
   959
    </taskdef>
martin@2345
   960
martin@2871
   961
    <undeploy url="${tomcat.manager.url}" username="${tomcat.manager.username}" password="${tomcat.manager.password}" path="/${context.name}" failonerror="false" />
martin@2871
   962
    <deploy.tomcat url="${tomcat.manager.url}" username="${tomcat.manager.username}" password="${tomcat.manager.password}" path="/${context.name}" war="file:${base.lib}/${context.name}.war" />
martin@2871
   963
    <start url="${tomcat.manager.url}" username="${tomcat.manager.username}" password="${tomcat.manager.password}" path="/${context.name}" />
martin@2871
   964
  </target>
martin@2345
   965
martin@2871
   966
  <target name="generate-wsdd">
martin@2871
   967
    <ant dir="${base.src}" target="generate-wsdd" inheritAll="true" inheritRefs="true" />
martin@2871
   968
  </target>
martin@2345
   969
martin@2871
   970
  <target name="obx.export.database" if="obx.exp.DB">
martin@2871
   971
    <antcall target="export.database" />
martin@2871
   972
  </target>
martin@2345
   973
martin@2871
   974
  <target name="obx.export.config.script" if="obx.exp.CS">
martin@2871
   975
    <antcall target="export.config.script" />
martin@2871
   976
  </target>
martin@2345
   977
asier@19231
   978
  <target name="obx.export.validateModules" if="obx.exp.validate">
asier@19231
   979
    <taskdef name="validateModules" classname="org.openbravo.service.system.SystemValidationTask">
martin@2871
   980
      <classpath refid="project.class.path" />
martin@2871
   981
    </taskdef>
martin@2345
   982
asier@5560
   983
    <taskdef name="WADValidation" classname="org.openbravo.wad.validation.WADValidatorTask">
asier@5533
   984
      <classpath refid="project.class.path" />
asier@5533
   985
    </taskdef>
asier@19231
   986
asier@5533
   987
    <echo message="Validating Module..." />
asier@19231
   988
martin@14869
   989
    <WADValidation propertiesFile="${base.config}/Openbravo.properties"
martin@14869
   990
                   modules="${module}"
martin@14869
   991
                   stoponerror="true"/>
martin@3038
   992
asier@11044
   993
    <validateModules moduleJavaPackage="${module}" failOnError="true" userId="0" adminMode="true" propertiesFile="${base.config}/Openbravo.properties" type="module" />
asier@19231
   994
  </target>
asier@19231
   995
  
asier@19231
   996
  <target name="package.module">
asier@19231
   997
    <taskdef name="extractModule" classname="org.openbravo.erpCommon.modules.ExtractModuleTask">
asier@19231
   998
      <classpath refid="project.class.path" />
asier@19231
   999
    </taskdef>
asier@19231
  1000
    
asier@19231
  1001
    <antcall target="obx.export.validateModules" />
martin@2871
  1002
    <antcall target="obx.export.database" />
martin@2871
  1003
    <antcall target="obx.export.config.script" />
juanpablo@2691
  1004
asier@19231
  1005
    <extractModule moduleName="${module}" 
asier@19231
  1006
                   userId="0" 
asier@19231
  1007
                   adminMode="true" 
asier@19231
  1008
                   propertiesFile="${base.config}/Openbravo.properties" 
asier@19231
  1009
                   exportRD="${obx.export.RD}" 
asier@19231
  1010
                   addAllDependencies="${obx.export.allDeps}"/>
martin@2871
  1011
  </target>
juanpablo@2691
  1012
martin@2871
  1013
  <target name="diagnostic">
antonio@6886
  1014
    <ant dir="src-util/diagnostic" antfile="build-create.xml" target="build" />
antonio@6886
  1015
    <ant dir="src-util/diagnostic" target="check.all" />
martin@2871
  1016
  </target>
inigo@25249
  1017
  
inigo@25249
  1018
  <target name="setup.compile">
inigo@25519
  1019
	<mkdir dir="build/classes" />
inigo@25525
  1020
    <javac srcdir="src/org/openbravo/configuration" destdir="build/classes" fork="true" deprecation="off" encoding="UTF-8" debug="true" debuglevel="lines,vars,source" includeantruntime="false">
inigo@25519
  1021
      <classpath refid="project.class.path"/>  
inigo@25519
  1022
    </javac>
martin@2871
  1023
  </target>
juanpablo@2706
  1024
inigo@25525
  1025
  <target name="setup" depends="init, setup.compile">
inigo@25519
  1026
    <echo message="Launching configuration application..."/>
inigo@25519
  1027
    <taskdef name="configurationApp" classname="org.openbravo.configuration.ConfigurationApp">
inigo@25519
  1028
      <classpath refid="project.class.path" />
inigo@25519
  1029
    </taskdef>
inigo@25519
  1030
    <configurationApp/>
inigo@25249
  1031
    </target>
inigo@25249
  1032
  
asier@4280
  1033
  <target name="package.core" depends="init, set.version.number">
martin@14869
  1034
	<property name="tmpdir" value="${java.io.tmpdir}/ob.core${core.rev}" />
martin@14869
  1035
   
martin@14869
  1036
  	<exec executable="hg" >
martin@14869
  1037
  		<arg value="archive"/>
martin@14869
  1038
  		<arg value="${tmpdir}"/>
martin@14869
  1039
  	</exec>
martin@14869
  1040
  	
martin@14869
  1041
  	<replaceregexp file="${tmpdir}/src-db/database/sourcedata/AD_MODULE.xml"
martin@14869
  1042
                   match="(VERSION.*\[CDATA\[).*\..*\.(.*)(\]\])"
martin@14869
  1043
                   replace="\1${core.rev}\3"
martin@14869
  1044
                   byline="true"/>
martin@14869
  1045
    
martin@14869
  1046
    <echo message="${hg.id}" file="${tmpdir}/config/instance.revision"/>
martin@14869
  1047
	
martin@14869
  1048
    <delete includeEmptyDirs="true">
martin@14869
  1049
      <fileset dir="${tmpdir}/modules" includes="**/*" defaultexcludes="no"/>
martin@14869
  1050
    </delete>
martin@14869
  1051
    
martin@14869
  1052
    <zip destfile="${basedir}/core-${core.rev}.obx" basedir="${tmpdir}"/>
martin@14869
  1053
    
martin@14869
  1054
    <delete dir="${tmpdir}"/>
martin@14868
  1055
martin@14869
  1056
   </target>
martin@14869
  1057
 
martin@14869
  1058
  <target name="set.version.number" depends="set.version.from.file, set.version.calculated"/>
martin@14869
  1059
  
asier@4279
  1060
  <target name="set.version.calculated" if="calculate.core.rev">
martin@14869
  1061
    <echo message="calculating core revision..."/>
asier@4279
  1062
    <exec executable="hg" outputproperty="hg.idno" failifexecutionfails="false">
martin@14869
  1063
      <arg value="id"/>
martin@14869
  1064
      <arg value="-n"/>
asier@4279
  1065
    </exec>
guillermo@15690
  1066
        <propertyfile file="currentRevision.tmp">
guillermo@15690
  1067
          <entry key="core.rev" value="3.0.${hg.idno}"/>
guillermo@15690
  1068
        </propertyfile>
guillermo@15690
  1069
        <replaceregexp file="currentRevision.tmp"
guillermo@15690
  1070
                       match="\+"
guillermo@15690
  1071
                       replace=""
guillermo@15690
  1072
                       byline="true"
guillermo@15690
  1073
        />
guillermo@15690
  1074
        <loadproperties> 
guillermo@15690
  1075
          <file file="currentRevision.tmp"/> 
guillermo@15690
  1076
        </loadproperties>
guillermo@15690
  1077
        <delete file="currentRevision.tmp"/>
asier@4279
  1078
  </target>
martin@14869
  1079
  
asier@4279
  1080
  <target name="set.version.from.file" if="xml.core.rev">
martin@14869
  1081
    <echo message="reading core revision from xml file..."/>
asier@4279
  1082
    <loadfile property="core.rev" srcfile="${basedir}/src-db/database/sourcedata/AD_MODULE.xml">
asier@4279
  1083
      <filterchain>
asier@4279
  1084
        <linecontains>
martin@14869
  1085
          <contains value="VERSION>"/>
asier@4279
  1086
        </linecontains>
asier@4279
  1087
        <tokenfilter>
martin@14869
  1088
            <replaceregex pattern="(.*VERSION.*\[CDATA\[)(.*\..*\..*)(\]\].*)" replace="\2"/>
asier@4279
  1089
        </tokenfilter>
martin@14869
  1090
        <striplinebreaks/>
asier@4279
  1091
      </filterchain>
asier@4279
  1092
    </loadfile>
asier@4279
  1093
  </target>
martin@14869
  1094
  
asier@5536
  1095
  <target name="validate.wad">
asier@5536
  1096
    <ant dir="${base.src}" target="wadvalidation" inheritAll="true" inheritRefs="true" />
asier@5536
  1097
  </target>
martin@14869
  1098
  
antonio@7476
  1099
  <target name="UIrebuild" depends="core.lib">
antonio@7476
  1100
    <java classname="org.openbravo.base.BuildTask" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
antonio@7476
  1101
      <arg line="'${base.config}/Openbravo.properties' ${logFileName}" />
antonio@7476
  1102
      <classpath>
antonio@7476
  1103
        <pathelement path="${build.core.lib}/openbravo-core.jar" />
stefan@11940
  1104
        <pathelement path="${base.lib}/runtime/log4j-1.2.16.jar" />
stefan@11940
  1105
        <pathelement path="${base.lib}/runtime/commons-pool-1.5.6.jar" />
stefan@11940
  1106
        <pathelement path="${base.lib}/runtime/commons-dbcp-1.4.jar" />
carlos@28271
  1107
        <pathelement path="${base.lib}/runtime/postgresql-9.4.1207.jre6.jar" />
antonio@7476
  1108
        <pathelement path="${base.lib}/runtime/ojdbc6.jar" />
stefan@11940
  1109
        <pathelement path="${base.lib}/runtime/commons-collectionsi-3.2.1.jar" />
augusto@24383
  1110
        <pathelement path="${base.lib}/runtime/ant-1.9.2.jar" />
augusto@24383
  1111
        <pathelement path="${base.lib}/runtime/ant-launcher-1.9.2.jar" />
augusto@24383
  1112
        <pathelement path="${base.lib}/runtime/ant-apache-log4j-1.9.2.jar" />
antonio@7476
  1113
        <pathelement path="${base.lib}/runtime/ant-nodeps.jar" />
antonio@7476
  1114
      </classpath>
antonio@7476
  1115
    </java>
antonio@7476
  1116
  </target>
martin@14869
  1117
  
asier@8876
  1118
  <target name="check.module.consistency">
asier@8876
  1119
    <taskdef name="checkConsistency" classname="org.openbravo.erpCommon.modules.CheckLocalConsistency">
asier@8876
  1120
      <classpath refid="project.class.path" />
asier@8876
  1121
    </taskdef>
martin@14869
  1122
    <checkConsistency userId="0" adminMode="true" propertiesFile="${base.config}/Openbravo.properties"/>
asier@8876
  1123
  </target>
martin@14869
  1124
  
antonio@11114
  1125
  <target name="check.window.compatibility">
antonio@11114
  1126
    <taskdef name="showclassicwindows" classname="org.openbravo.client.application.WindowsInClassicModeTask">
antonio@11114
  1127
      <classpath refid="project.class.path" />
antonio@11114
  1128
    </taskdef>
martin@14869
  1129
    <showclassicwindows userId="0" adminMode="true" propertiesFile="${base.config}/Openbravo.properties"/>
antonio@11114
  1130
  </target>
miguel@16113
  1131
  
miguel@16113
  1132
  <target name="cleanSubfolders" depends="init">
miguel@16113
  1133
      <ant dir="${base.src.core}" target="clean" inheritAll="true" inheritRefs="true" />
miguel@16113
  1134
      <ant dir="${base.src.trl}" target="clean" inheritAll="true" inheritRefs="true" />
miguel@16113
  1135
      <ant dir="${base.src.wad}" target="clean" inheritAll="true" inheritRefs="true" />
asier@16641
  1136
  </target>
asier@16641
  1137
  
asier@16641
  1138
  <target name="activate.instance" depends="init"
asier@16641
  1139
          description="Activates the instance with the provided public key">
asier@16641
  1140
   <taskdef name="activateInstace" classname="org.openbravo.erpCommon.obps.ActivationTask">
asier@16641
  1141
     <classpath refid="project.class.path" />
asier@16641
  1142
   </taskdef>
asier@16641
  1143
   <property name="purpose" value="" />
asier@16641
  1144
   <property name="publicKey" value="" />
asier@16641
  1145
   <property name="publicKeyFile" value="" />
asier@16641
  1146
    
asier@16641
  1147
   <activateInstace purpose="${purpose}"
asier@16641
  1148
                    publicKey="${publicKey}"
asier@16641
  1149
                    publicKeyFile="${publicKeyFile}"
asier@16641
  1150
                    userId="0" 
asier@16641
  1151
                    adminMode="true" 
asier@16641
  1152
                    propertiesFile="${base.config}/Openbravo.properties"/>
asier@16641
  1153
  </target>
miguel@16113
  1154
  
asier@25752
  1155
  <target name="host.name"
asier@25752
  1156
          description="Prints this machine's name. This name can be used to overwrite common Openbravo.properties by machine.name.Openbravo properties file">
asier@25753
  1157
    <mkdir dir="build/classes"/>
asier@25752
  1158
    <javac srcdir="src/org/openbravo/base/session" includes="HostNameTask.java" destdir="build/classes" fork="true" deprecation="off" encoding="UTF-8" debug="true" debuglevel="lines,vars,source" includeantruntime="false">
asier@25752
  1159
      <classpath refid="project.class.path"/>
asier@25752
  1160
    </javac>
asier@25752
  1161
    <taskdef name="hostName" classname="org.openbravo.base.session.HostNameTask">
asier@25752
  1162
      <classpath refid="project.class.path"/>
asier@25752
  1163
    </taskdef>
asier@25752
  1164
    <hostName/>
asier@25752
  1165
  </target>
asier@43
  1166
</project>