build.xml
author Cristian Berner <cristian.berner@openbravo.com>
Wed, 19 Aug 2020 14:42:22 +0200
changeset 37514 36f6383d31fc
parent 37377 1c1ba90c4ba5
permissions -rw-r--r--
Fixes ISSUE-44832: Update postgresql driver to support scram password encrypt

Postgresql version >= 42.2.x is needed to support scram-sha-256 postgres
password encryption. This exists since postgres 11 and it requires
updating the client driver. Note, jre7 42.2.2 version didn't have this
feature included.

This updated driver also fixes several security issues and vulnerabilities.

Updated postgresql driver 42.2.2.jre7 -> 42.2.16
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
stefan@37302
    15
* All portions are Copyright (C) 2001-2020 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
compile.src: refer to compile.src target of src.
juanpablo@213
    31
war: refer to build.war target of src.
juanpablo@213
    32
core.lib: refer to build target of src-core.
juanpablo@213
    33
wad.lib: refer to build target of src-wad.
juanpablo@213
    34
trl.lib: refer to build target of src-trl.
juanpablo@213
    35
database.lib: refer to jar target of src-db.
juanpablo@213
    36
clean: refer to clean target of src.
juanpablo@213
    37
trl.clean: refer to trl.clean target of src.
juanpablo@213
    38
translate: refer to translate target of src.
juanpablo@2061
    39
deploy.context: deploy the context into Tomcat using the manager
juanpablo@213
    40
install.source: install the ERP from sources (from subversion).
juanpablo@213
    41
create.database: refer to create.database target of database.
juanpablo@213
    42
update.database: refer to update.database target of database.
juanpablo@213
    43
create.database.script: refer to create.database.script target of database.
juanpablo@213
    44
update.database.script: refer to update.database.script target of database.
juanpablo@213
    45
export.database: exports database structure and data to xml files.
fernando@202
    46
-->
asier@43
    47
<project name="openbravo" default="compile.complete" basedir=".">
martin@2871
    48
  <property environment="env" />
martin@2871
    49
  <property name="base.config" location="config" />
martin@2871
    50
  <property file="${base.config}/Openbravo.properties" />
martin@2871
    51
  <property file="${base.config}/checksums" />
juanpablo@131
    52
martin@2871
    53
  <property name="base.config" location="config" />
martin@2871
    54
  <property name="base.src" location="src" />
martin@3794
    55
  <property name="base.src.test" location="src-test" />
martin@2871
    56
  <property name="base.src.core" location="src-core" />
martin@2871
    57
  <property name="base.src.db" location="src-db" />
martin@2871
    58
  <property name="base.src.trl" location="src-trl" />
martin@2871
    59
  <property name="base.src.wad" location="src-wad" />
martin@2871
    60
  <property name="base.src.gen" location="src-gen" />
martin@2871
    61
  <property name="base.db" location="src-db/database" />
martin@2871
    62
  <property name="base.web" location="web" />
martin@2871
    63
  <property name="base.context" location="WebContent" />
martin@2871
    64
  <property name="base.design" location="${base.context}/src-loc" />
martin@2871
    65
  <property name="base.lib" location="lib" />
martin@2871
    66
  <property name="base.modules" location="modules" />
martin@2871
    67
  <property name="build" location="build/classes" />
antonio@7541
    68
  <property name="build.apply.module" location="build.apply/classes" />
martin@2871
    69
  <property name="build.AD" location="srcAD" />
martin@2871
    70
  <property name="build.sqlc" location="build/javasqlc" />
martin@2871
    71
  <property name="build.core.lib" location="src-core/lib" />
martin@2871
    72
  <property name="build.trl.lib" location="src-trl/lib" />
martin@2871
    73
  <property name="build.wad.lib" location="src-wad/lib" />
martin@2871
    74
  <property name="build.docs" location="docs/api" />
martin@2871
    75
  <property name="jakarta.home" location="${env.CATALINA_HOME}" />
martin@2871
    76
  <property name="module" value="%" />
antonio@6107
    77
  <property name="apply.on.create" value="false" />
martin@2871
    78
  <property name="obx.export.RD" value="false" />
martin@2871
    79
  <property name="obx.export.DB" value="false" />
martin@2871
    80
  <property name="obx.export.CS" value="false" />
asier@19231
    81
  <property name="obx.export.validate" value="true" />
asier@19231
    82
  <property name="obx.export.allDeps" value="false" />
martin@2871
    83
  <property name="chekPerms" value="false" />
antonio@2896
    84
  <property name="force" value="false" />
antonio@7709
    85
  <property name="strict.template.application" value="false" />
antonio@4937
    86
  <property name="rd" value="false" />
asier@3008
    87
  <property name="local" value="true" />
asier@3995
    88
  <property name="apply.modules.complete.compilation" value="false" />
martin@14869
    89
  <property name="stopOnWadError" value="false"/>
martin@14869
    90
  <property name="friendlyWarnings" value="false"/>
martin@14869
    91
  <property name="checkTranslationConsistency" value="true"/>
martin@14869
    92
  <property name="buildValidation" value="true"/>
antonio@29768
    93
  <property name="modules" value=""/> 
antonio@29768
    94
 
carlos@34282
    95
  <condition property="html.version" value="-html5" else="">
carlos@34282
    96
    <not>
stefan@37303
    97
      <equals arg1="${ant.java.version}" arg2="1.8"/>
carlos@34282
    98
    </not>
carlos@34282
    99
  </condition>
carlos@34282
   100
juanpablo@2522
   101
  <condition property="deploy.mode" value="class">
juanpablo@2522
   102
    <not>
juanpablo@2522
   103
      <isset property="${deploy.mode}" />
juanpablo@2522
   104
    </not>
juanpablo@2522
   105
  </condition>
martin@2345
   106
martin@2871
   107
  <condition property="mode.war">
martin@2871
   108
    <equals arg1="war" arg2="${deploy.mode}" />
martin@2871
   109
  </condition>
martin@2345
   110
martin@2871
   111
  <condition property="mode.class">
martin@2871
   112
    <equals arg1="class" arg2="${deploy.mode}" />
martin@2871
   113
  </condition>
martin@2345
   114
martin@2871
   115
  <condition property="apply.modules.on.create">
martin@2871
   116
    <or>
martin@2871
   117
      <equals arg1="yes" arg2="${apply.on.create}" />
martin@2871
   118
      <equals arg1="true" arg2="${apply.on.create}" />
martin@2871
   119
    </or>
martin@2871
   120
  </condition>
martin@2345
   121
martin@2871
   122
  <condition property="obx.exp.DB">
martin@2871
   123
    <or>
martin@2871
   124
      <equals arg1="yes" arg2="${obx.export.DB}" />
martin@2871
   125
      <equals arg1="true" arg2="${obx.export.DB}" />
martin@2871
   126
    </or>
martin@2871
   127
  </condition>
martin@2345
   128
martin@2871
   129
  <condition property="obx.exp.CS">
martin@2871
   130
    <or>
martin@2871
   131
      <equals arg1="yes" arg2="${obx.export.CS}" />
martin@2871
   132
      <equals arg1="true" arg2="${obx.export.CS}" />
martin@2871
   133
    </or>
martin@2871
   134
  </condition>
asier@19231
   135
  
asier@19231
   136
  <condition property="obx.exp.validate">
asier@19231
   137
    <or>
asier@19231
   138
      <equals arg1="yes" arg2="${obx.export.validate}" />
asier@19231
   139
      <equals arg1="true" arg2="${obx.export.validate}" />
asier@19231
   140
    </or>
asier@19231
   141
  </condition>
asier@43
   142
antonio@3337
   143
  <condition property="timestamp">
antonio@3337
   144
    <or>
antonio@3337
   145
      <equals arg1="no" arg2="${execute.update.build.timestamp}" />
antonio@3337
   146
      <equals arg1="false" arg2="${execute.update.build.timestamp}" />
antonio@3337
   147
    </or>
antonio@3337
   148
  </condition>
antonio@3337
   149
martin@2871
   150
  <condition property="jakarta.base" value="${env.CATALINA_BASE}" else="${jakarta.home}">
martin@2871
   151
    <and>
martin@2871
   152
      <isset property="env.CATALINA_BASE" />
martin@2871
   153
    </and>
martin@2871
   154
  </condition>
martin@2871
   155
  <property name="log.path" location="${jakarta.base}/logs" />
martin@2871
   156
  <property name="lib" location="${jakarta.home}/common" />
martin@2871
   157
  <property name="jakarta.context" location="${jakarta.base}/webapps/${context.name}" />
asier@6240
   158
juanpablo@6241
   159
  <condition property="build.maxmemory" value="1024M" else="512M">
juanpablo@6241
   160
    <or>
juanpablo@6241
   161
      <equals arg1="${os.arch}" arg2="amd64" />
juanpablo@6241
   162
      <equals arg1="${os.arch}" arg2="x86_64" />
juanpablo@6241
   163
      <equals arg1="${os.arch}" arg2="ia64" />
juanpablo@6241
   164
    </or>
asier@6240
   165
  </condition>
stefan@124
   166
juanpablo@7924
   167
  <condition property="allow.root.user" value="true" else="false">
juanpablo@7924
   168
    <or>
juanpablo@7924
   169
      <equals arg1="yes" arg2="${allow.root}" />
juanpablo@7924
   170
      <equals arg1="true" arg2="${allow.root}" />
juanpablo@7924
   171
    </or>
juanpablo@7924
   172
  </condition>
juanpablo@7924
   173
martin@2871
   174
  <condition property="no.java.home" value="true">
martin@2871
   175
    <not>
martin@2871
   176
      <isset property="env.JAVA_HOME" />
martin@2871
   177
    </not>
martin@2871
   178
  </condition>
juanpablo@1548
   179
antonio@2838
   180
  <condition property="bbdd.owner.url" value="${bbdd.url}/${bbdd.sid}" else="${bbdd.url}">
antonio@2838
   181
    <and>
martin@2871
   182
      <equals arg1="${bbdd.rdbms}" arg2="POSTGRE" />
antonio@2838
   183
    </and>
antonio@2838
   184
  </condition>
juanpablo@7924
   185
juanpablo@7924
   186
  <condition property="root.user">
juanpablo@7924
   187
    <and>
juanpablo@7924
   188
      <equals arg1="${user.name}" arg2="root" />
juanpablo@7924
   189
      <not>
juanpablo@7924
   190
        <contains string="${os.name}" substring="Windows" />
juanpablo@7924
   191
      </not>
juanpablo@7924
   192
      <equals arg1="false" arg2="${allow.root.user}" />
juanpablo@7924
   193
    </and>
juanpablo@7924
   194
  </condition>
juanpablo@7924
   195
stefan@9215
   196
  <!-- Minimal classpath used for executing Wad at compile time -->
stefan@9215
   197
  <path id="wad.class.path">
stefan@9215
   198
    <fileset dir="${base.lib}">
stefan@9215
   199
      <include name="**/*.jar" />
stefan@9215
   200
    </fileset>
stefan@9215
   201
    <fileset dir="${build.core.lib}">
stefan@9215
   202
      <include name="openbravo-core.jar" />
stefan@9215
   203
    </fileset>
stefan@9215
   204
    <fileset dir="${build.wad.lib}">
stefan@9215
   205
      <include name="openbravo-wad.jar" />
stefan@9215
   206
    </fileset>
javier@34968
   207
    <pathelement path="${base.config}" />
stefan@9215
   208
  </path>
stefan@9215
   209
martin@2871
   210
  <path id="project.class.path">
antonio@7894
   211
    <dirset dir="${base.modules}">
antonio@7894
   212
      <include name="*/build/classes/" />
antonio@7894
   213
    </dirset>
antonio@10098
   214
    <pathelement path="${basedir}/src-util/modulescript/build/classes/" />
javier@34968
   215
    <pathelement path="${base.config}" />
martin@2871
   216
    <pathelement path="${build}" />
martin@2871
   217
    <pathelement path="${base.src}" />
martin@2871
   218
    <fileset dir="${base.lib}">
martin@2871
   219
      <include name="**/*.jar" />
martin@2871
   220
    </fileset>
martin@2871
   221
    <fileset dir="${build.core.lib}">
martin@2871
   222
      <include name="openbravo-core.jar" />
martin@2871
   223
    </fileset>
martin@2871
   224
    <fileset dir="${build.trl.lib}">
martin@2871
   225
      <include name="openbravo-trl.jar" />
martin@2871
   226
    </fileset>
martin@2871
   227
    <fileset dir="${build.wad.lib}">
martin@2871
   228
      <include name="openbravo-wad.jar" />
martin@2871
   229
    </fileset>
martin@2871
   230
    <fileset dir="${base.lib}">
martin@2871
   231
      <include name="**/*.jar" />
asier@24247
   232
      <exclude name="**/test/*.jar" />
martin@2871
   233
    </fileset>
martin@2871
   234
    <fileset dir="${base.db}/lib/">
martin@2871
   235
      <include name="**/*.jar" />
martin@2871
   236
    </fileset>
martin@2871
   237
    <fileset dir="${base.modules}">
martin@2871
   238
      <include name="*/lib/**" />
asier@24247
   239
       <exclude name="**/test/*.jar" />
martin@2871
   240
    </fileset>
antonio@7894
   241
  </path>
antonio@7894
   242
antonio@7894
   243
  <!-- This classpath is needed only for the compile.apply.module task-->
antonio@7894
   244
  <path id="apply.module.compile.classpath">
antonio@6886
   245
    <dirset dir="${base.modules}">
antonio@6886
   246
      <include name="*/build/classes/" />
antonio@6886
   247
    </dirset>
antonio@6886
   248
    <pathelement path="${basedir}/../../src-util/modulescript/build/classes/" />
antonio@7543
   249
    <pathelement path="${build.apply.module}" />
javier@34968
   250
    <pathelement path="${base.config}" />
antonio@7543
   251
    <pathelement path="${base.src}" />
antonio@7543
   252
    <fileset dir="${base.lib}">
antonio@7543
   253
      <include name="**/*.jar" />
antonio@7543
   254
    </fileset>
antonio@7543
   255
    <fileset dir="${build.core.lib}">
antonio@7543
   256
      <include name="openbravo-core.jar" />
antonio@7543
   257
    </fileset>
antonio@7543
   258
    <fileset dir="${build.trl.lib}">
antonio@7543
   259
      <include name="openbravo-trl.jar" />
antonio@7543
   260
    </fileset>
antonio@7543
   261
    <fileset dir="${build.wad.lib}">
antonio@7543
   262
      <include name="openbravo-wad.jar" />
antonio@7543
   263
    </fileset>
antonio@7543
   264
    <fileset dir="${base.lib}">
antonio@7543
   265
      <include name="**/*.jar" />
antonio@7543
   266
    </fileset>
antonio@7543
   267
    <fileset dir="${base.db}/lib/">
antonio@7543
   268
      <include name="**/*.jar" />
antonio@7543
   269
    </fileset>
antonio@7543
   270
    <fileset dir="${base.modules}">
antonio@7543
   271
      <include name="*/lib/**" />
antonio@7543
   272
    </fileset>
antonio@7894
   273
  </path>
martin@14869
   274
  
antonio@7894
   275
  <!-- This classpath is needed only for the apply.module task-->
antonio@7894
   276
  <path id="apply.module.runtime.classpath">
antonio@7543
   277
    <dirset dir="${base.modules}">
antonio@7543
   278
      <include name="*/build/classes/" />
antonio@7543
   279
    </dirset>
antonio@7543
   280
    <pathelement path="${basedir}/../../src-util/modulescript/build/classes/" />
javier@34968
   281
    <pathelement path="${base.config}" />
antonio@7541
   282
    <pathelement path="${build.apply.module}" />
antonio@7543
   283
    <pathelement path="${build}" />
antonio@7541
   284
    <pathelement path="${base.src}" />
antonio@7541
   285
    <fileset dir="${base.lib}">
antonio@7541
   286
      <include name="**/*.jar" />
antonio@7541
   287
    </fileset>
antonio@7541
   288
    <fileset dir="${build.core.lib}">
antonio@7541
   289
      <include name="openbravo-core.jar" />
antonio@7541
   290
    </fileset>
antonio@7541
   291
    <fileset dir="${build.trl.lib}">
antonio@7541
   292
      <include name="openbravo-trl.jar" />
antonio@7541
   293
    </fileset>
antonio@7541
   294
    <fileset dir="${build.wad.lib}">
antonio@7541
   295
      <include name="openbravo-wad.jar" />
antonio@7541
   296
    </fileset>
antonio@7541
   297
    <fileset dir="${base.lib}">
antonio@7541
   298
      <include name="**/*.jar" />
antonio@7541
   299
    </fileset>
antonio@7541
   300
    <fileset dir="${base.db}/lib/">
antonio@7541
   301
      <include name="**/*.jar" />
antonio@7541
   302
    </fileset>
antonio@7541
   303
    <fileset dir="${base.modules}">
antonio@7541
   304
      <include name="*/lib/**" />
antonio@7541
   305
    </fileset>
antonio@7541
   306
  </path>
martin@14869
   307
  
antonio@5617
   308
  <macrodef name="updatesystemstatus">
martin@14869
   309
     <attribute name="v" default="NOT SET"/>
martin@14869
   310
     <sequential>
martin@14869
   311
       <sql driver="${bbdd.driver}" url="${bbdd.owner.url}" userid="${bbdd.user}" password="${bbdd.password}" onerror="continue" autocommit="true">
martin@14869
   312
         <classpath> <fileset dir="${base.lib}"> <include name="**/*.jar"> </include> </fileset> </classpath>
martin@14869
   313
         <transaction> UPDATE ad_system_info SET system_status='@{v}' ;
antonio@5618
   314
                       DELETE FROM ad_error_log where system_status=(select system_status from ad_system_info)
antonio@5618
   315
         </transaction>
martin@14869
   316
       </sql>
martin@14869
   317
     </sequential>
antonio@5617
   318
  </macrodef>
martin@14869
   319
  
antonio@16688
   320
  <macrodef name="updatesystemstatuswhennot">
antonio@16688
   321
    <attribute name="v" default="NOT SET"/>
antonio@16688
   322
    <attribute name="previous" default="NOT SET"/>
antonio@16688
   323
     <sequential>
antonio@16688
   324
       <sql driver="${bbdd.driver}" url="${bbdd.owner.url}" userid="${bbdd.user}" password="${bbdd.password}" onerror="continue" autocommit="true">
antonio@16688
   325
         <classpath> <fileset dir="${base.lib}"> <include name="**/*.jar"> </include> </fileset> </classpath>
antonio@16688
   326
         <transaction> UPDATE ad_system_info SET system_status='@{v}' where system_status!='@{previous}' ;
antonio@16688
   327
                       DELETE FROM ad_error_log where system_status=(select system_status from ad_system_info)
antonio@16688
   328
         </transaction>
antonio@16688
   329
       </sql>
antonio@16688
   330
     </sequential>
antonio@16688
   331
  </macrodef>
antonio@16688
   332
  
stefan@33879
   333
  <target name="init">
juanpablo@11541
   334
    <fail if="root.user" message="Don't run ant tasks with the root user" />
martin@2871
   335
    <fail if="no.java.home" message="The environment variable JAVA_HOME is not set." />
asier@34303
   336
    <fail message="Unsupported Java version ${ant.java.version}. Minimum required is 8 (1.8).">
asier@33930
   337
      <condition>
asier@34305
   338
        <or>
asier@34305
   339
          <equals arg1="${ant.java.version}" arg2="1.6"/>
asier@34305
   340
          <equals arg1="${ant.java.version}" arg2="1.7"/>
asier@34305
   341
        </or>
asier@33930
   342
      </condition>
asier@33930
   343
    </fail>
asier@33931
   344
    <antversion property="min.ant.version" atleast="1.9.2" />
asier@33931
   345
    <antversion property="actual.ant.version" />
asier@33931
   346
    <fail message="Unsupported ant version ${actual.ant.version}. Minimum required is 1.9.2.">
asier@33931
   347
      <condition>
asier@33931
   348
        <not>
asier@33931
   349
          <isset property="min.ant.version"/>
asier@33931
   350
        </not>
asier@33931
   351
      </condition>
asier@33931
   352
    </fail>
martin@2871
   353
  </target>
stefan@124
   354
miguel@16422
   355
  <target name="compile.complete" depends="init, core.lib, wad.lib, trl.lib">
martin@2871
   356
    <ant dir="${base.src}" target="compile.complete" inheritAll="true" inheritRefs="true" />
martin@2871
   357
  </target>
asier@2853
   358
shankar@20726
   359
  <target name="migrate.attachments" depends="init">
shankar@20765
   360
    <taskdef name="MigrateAttachments" classname="org.openbravo.erpCommon.utility.MigrateAttachments" >
shankar@20726
   361
      <classpath refid="project.class.path" />
shankar@20765
   362
    </taskdef>
shankar@20765
   363
    <MigrateAttachments/>
shankar@20726
   364
  </target>
shankar@20726
   365
stefan@37304
   366
  <target name="smartbuild" depends="init, core.lib">
martin@3038
   367
    <property name="smart.mode" value="true" />
martin@14869
   368
    
asier@4288
   369
    <condition property="no.local">
asier@4288
   370
      <not>
asier@4288
   371
        <istrue value="${local}" />
asier@4288
   372
      </not>
asier@4288
   373
    </condition>
asier@4288
   374
    <antcall target="update.database.if.no.local" />
martin@14869
   375
    
martin@3038
   376
    <antcall target="wad.lib" />
martin@14869
   377
    
asier@5219
   378
    <taskdef name="CheckSumCondition" classname="org.openbravo.utils.CheckSumCondition">
asier@5219
   379
      <classpath refid="project.class.path" />
asier@5219
   380
    </taskdef>
martin@14869
   381
    
martin@14869
   382
    <CheckSumCondition obDir="${basedir}"
martin@14869
   383
                       type="md5.wad"
martin@14869
   384
                       property="test.md5.wad"/>
martin@3038
   385
martin@3038
   386
    <condition property="new.wad">
martin@14869
   387
        <istrue value="${test.md5.wad}"/>
martin@3038
   388
    </condition>
martin@3038
   389
martin@3038
   390
    <antcall target="trl.lib" />
martin@14869
   391
    
asier@3660
   392
    <antcall inheritall="true" inheritrefs="true" target="generate.entities.quick" />
martin@2917
   393
asier@3013
   394
    <ant dir="${base.src}" target="smartbuild" inheritAll="true" inheritRefs="true" />
martin@3038
   395
antonio@5615
   396
    <ant dir="${base.db}" target="setApplied" inheritAll="true" inheritRefs="true" />
antonio@4933
   397
    <antcall target="build.deploy" />
antonio@16688
   398
    <updatesystemstatuswhennot v="RB51" previous="RB12"/>
martin@2871
   399
  </target>
martin@3038
   400
asier@3008
   401
  <target name="update.database.if.no.local" if="no.local">
asier@3008
   402
    <antcall target="update.database" />
asier@3008
   403
  </target>
antonio@2996
   404
asier@2982
   405
  <target name="build.deploy">
martin@3038
   406
    <antcall target="build.deploy.war" />
martin@3038
   407
    <antcall target="build.deploy.class" />
asier@2982
   408
  </target>
martin@3038
   409
asier@2982
   410
  <target name="build.deploy.class" if="mode.class">
asier@2982
   411
    <ant dir="${base.src}" target="copy.files" inheritAll="true" inheritRefs="true" />
asier@2982
   412
    <mkdir dir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib" />
martin@3038
   413
    <copy todir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib" file="${build.core.lib}/openbravo-core.jar" encoding="UTF-8" />
asier@2982
   414
  </target>
martin@3038
   415
stefan@9978
   416
  <!-- Only needed in special cases. See issue 15709 for details.
stefan@9978
   417
       This task (if deploy.mode=class) does sync jar-files from WebContent -> deployed webapp (& delete orphan jars)
stefan@9978
   418
  -->
stefan@9978
   419
  <target name="copy.files.jarsync" depends="init" if="mode.class">
stefan@9978
   420
    <ant dir="${base.src}" target="copy.files.jarsync.do" inheritAll="true" inheritRefs="true" />
stefan@9978
   421
  </target>
stefan@9978
   422
asier@2982
   423
  <target name="build.deploy.war" if="mode.war">
martin@3038
   424
    <antcall target="war" />
asier@2982
   425
  </target>
martin@2345
   426
miguel@16422
   427
  <target name="compile" depends="init,core.lib, wad.lib, trl.lib">
martin@2871
   428
    <ant dir="${base.src}" target="compile" inheritAll="true" inheritRefs="true" />
martin@2871
   429
  </target>
martin@2345
   430
antonio@6897
   431
  <target name="buildvalidation" depends="init, core.lib">
martin@14869
   432
    <updatesystemstatus v="RB11"/> 
antonio@7925
   433
    <condition property="buildValidation.var">
martin@14869
   434
      <istrue value="${buildValidation}"  />
antonio@7925
   435
    </condition>
antonio@6897
   436
    <ant dir="src-util/buildvalidation" target="buildvalidation" inheritAll="true" inheritRefs="true" />
antonio@6886
   437
  </target>
martin@14869
   438
  
antonio@6886
   439
  <target name="compile.buildvalidation" depends="init, core.lib">
antonio@6886
   440
    <ant dir="src-util/buildvalidation" target="compile" inheritAll="true" inheritRefs="true" />
antonio@6886
   441
  </target>
martin@14869
   442
  
antonio@6886
   443
  <target name="compile.modulescript" depends="init, core.lib">
antonio@6886
   444
    <ant dir="src-util/modulescript" target="compile" inheritAll="true" inheritRefs="true" />
antonio@6886
   445
  </target>
antonio@6886
   446
antonio@7535
   447
  <target name="compile.complete.deploy" depends="compile.complete.development, compile.complete.war">
antonio@7512
   448
asier@5216
   449
    <!-- Calculate wad checksum to enable smartbuild-->
asier@5219
   450
    <taskdef name="CheckSumCondition" classname="org.openbravo.utils.CheckSumCondition">
asier@5219
   451
      <classpath refid="project.class.path" />
asier@5219
   452
    </taskdef>
martin@14869
   453
    
martin@14869
   454
    <CheckSumCondition obDir="${basedir}"
martin@14869
   455
                           type="md5.wad"
martin@14869
   456
                           property="test.md5.wad"/>
martin@2871
   457
  </target>
asier@43
   458
inigo@31982
   459
  <target name="compile.complete.development" depends="init, core.lib, wad.lib, trl.lib" unless="mode.war">
martin@14869
   460
    <updatesystemstatus v="RB43"/>
martin@2871
   461
    <ant dir="${base.src}" target="compile.complete.development" inheritAll="true" inheritRefs="true" />
martin@2871
   462
  </target>
asier@43
   463
martin@2871
   464
  <target name="compile.complete.war" depends="init" if="mode.war">
martin@14869
   465
    <updatesystemstatus v="RB43"/>
martin@2871
   466
    <antcall target="compile.complete" />
martin@2871
   467
    <antcall target="war" />
martin@2871
   468
  </target>
asier@1929
   469
stefan@5405
   470
  <target name="compile.deploy" depends="compile.war, compile.development">
martin@14869
   471
    <updatesystemstatus v="RB51"/>
martin@2871
   472
  </target>
martin@2686
   473
asier@7164
   474
  <target name="compile.development" depends="init" unless="mode.war">
martin@2871
   475
    <ant dir="${base.src}" target="compile.development" inheritAll="true" inheritRefs="true" />
martin@2871
   476
  </target>
martin@2686
   477
martin@2871
   478
  <target name="validate.database">
martin@2871
   479
    <ant dir="${base.src}" target="validate.database" inheritAll="true" inheritRefs="true" />
martin@2871
   480
  </target>
asier@1929
   481
martin@2871
   482
  <target name="validate.modules">
martin@2871
   483
    <ant dir="${base.src}" target="validate.modules" inheritAll="true" inheritRefs="true" />
martin@2871
   484
  </target>
asier@43
   485
martin@2871
   486
  <target name="compile.war" if="mode.war">
asier@7165
   487
    <antcall target="generate.entities" />
martin@2871
   488
    <antcall target="compile" />
martin@2871
   489
    <antcall target="war" />
martin@2871
   490
  </target>
ivan@1738
   491
martin@2871
   492
  <target name="compile.web" depends="init">
martin@2871
   493
    <ant dir="${base.src}" target="compile.web" inheritAll="true" inheritRefs="true" />
martin@2871
   494
  </target>
asier@43
   495
martin@2871
   496
  <target name="compile.web.development" depends="init">
martin@2871
   497
    <ant dir="${base.src}" target="compile.web.development" inheritAll="true" inheritRefs="true" />
martin@2871
   498
  </target>
martin@2245
   499
martin@2871
   500
  <target name="compile.src.gen" depends="init">
martin@2871
   501
    <ant dir="${base.src}" target="compile.src.gen" inheritAll="true" inheritRefs="true" />
martin@2871
   502
  </target>
martin@2830
   503
stefan@37303
   504
  <target name="generate.java.doc" depends="init">
stefan@37303
   505
    <javadoc Windowtitle="${title}" access="protected" Header="${header}" Footer="${footer}" destdir="${build.docs}" maxmemory="1024M" failonerror="yes" additionalparam="-Xdoclint:-missing ${html.version}" source="8">
stefan@27905
   506
      <sourcepath>
stefan@27905
   507
        <pathelement path="${base.src}" />
stefan@27905
   508
        <pathelement path="${base.src.test}/src" />
stefan@27905
   509
        <pathelement path="${build.AD}" />
stefan@27905
   510
        <pathelement path="${base.src.core}/src" />
stefan@27905
   511
        <pathelement path="${base.src.gen}" />
stefan@27905
   512
        <pathelement path="build/javasqlc/src" />
stefan@27905
   513
        <pathelement path="build/javasqlc/srcAD" />
stefan@27905
   514
        <dirset dir="${base.modules}">
stefan@27905
   515
          <include name="*/src" />
stefan@27905
   516
          <include name="*/src-test" />
stefan@27905
   517
        </dirset>
stefan@27905
   518
      </sourcepath>
martin@14869
   519
      <excludepackage name="org.openbravo.erpWindows.*"/>
martin@3794
   520
      <classpath>
martin@14869
   521
        <path refid="project.class.path"/>
martin@3794
   522
        <pathelement path="lib/build/js.jar" />
stefan@27905
   523
        <fileset dir="${base.modules}">
stefan@27905
   524
          <include name="*/lib/test/*.jar" />
stefan@27905
   525
        </fileset>
martin@3794
   526
      </classpath>
stefan@34510
   527
      <link href="https://docs.oracle.com/javase/8/docs/api/"/>
martin@3794
   528
    </javadoc>
martin@3794
   529
  </target>
martin@3794
   530
martin@2871
   531
  <target name="generate.entities">
martin@2871
   532
    <ant dir="${base.src}" target="generate.entities" inheritAll="true" inheritRefs="true" />
martin@2871
   533
  </target>
asier@43
   534
martin@2871
   535
  <target name="generate.entities.quick">
martin@2871
   536
    <ant dir="${base.src}" target="generate.entities.quick" inheritAll="true" inheritRefs="true" />
martin@2871
   537
  </target>
juanpablo@131
   538
stefan@11851
   539
  <!-- build-internal forking helper -->
stefan@11851
   540
  <target name="generate.entities.quick.forked">
stefan@11851
   541
    <ant dir="${base.src}" target="generate.entities.quick.forked" inheritAll="true" inheritRefs="true" />
stefan@11851
   542
  </target>
stefan@11851
   543
asier@24247
   544
  <target name="compile.test" depends="init">
asier@24247
   545
    <ant dir="${base.src.test}" target="compile.test" inheritAll="true" inheritRefs="true" />
asier@24247
   546
  </target>
asier@24247
   547
  
stefan@5674
   548
  <target name="run.tests" depends="init">
asier@24247
   549
    <ant dir="${base.src.test}" target="run.tests" inheritAll="true" inheritRefs="true" />
martin@3625
   550
  </target>
martin@3625
   551
stefan@5674
   552
  <target name="run.all.tests" depends="init">
asier@24247
   553
    <ant dir="${base.src.test}" target="run.all.tests" inheritAll="true" inheritRefs="true" />
martin@3656
   554
  </target>
martin@3656
   555
priya@6927
   556
  <target name="run.webservice.tests" depends="init">
asier@24247
   557
      <ant dir="${base.src.test}" target="run.webservice.tests" inheritAll="true" inheritRefs="true" />
priya@6927
   558
  </target>
priya@6927
   559
stefan@5674
   560
  <target name="run.quick.tests" depends="init">
asier@24247
   561
    <ant dir="${base.src.test}" target="run.quick.tests" inheritAll="true" inheritRefs="true" />
martin@3625
   562
  </target>
martin@3625
   563
asier@32457
   564
  <target name="run.test" depends="init">
asier@32457
   565
    <ant dir="${base.src.test}" target="run.test" inheritAll="true" inheritRefs="true" />
ivan@3752
   566
  </target>
martin@14869
   567
  
martin@14869
   568
  <target name="run.api.test.model" 
martin@14869
   569
          description="Checks current xml db model and dictionary API for not-allowed changes. Requires stableDBdir parameter">
stefan@9371
   570
    <taskdef name="checkAPI" classname="org.openbravo.ddlutils.task.CheckAPIDistribution">
asier@3808
   571
      <classpath refid="project.class.path" />
asier@3808
   572
    </taskdef>
martin@14869
   573
    <checkAPI driver="${bbdd.driver}" 
martin@14869
   574
                  url="${bbdd.owner.url}" 
martin@14869
   575
                  user="${bbdd.user}" 
martin@14869
   576
                  password="${bbdd.password}" 
martin@14869
   577
                  stableDBdir="${stableDBdir}"
martin@14869
   578
                  testDBdir="${basedir}"
antonio@29768
   579
                  modules="${modules}"
martin@14869
   580
    />    
asier@3808
   581
  </target>
antonio@29768
   582
  
martin@2871
   583
  <target name="compile.src" depends="init">
martin@2871
   584
    <ant dir="${base.src}" target="compile.src" inheritAll="true" inheritRefs="true" />
martin@2871
   585
  </target>
juanpablo@131
   586
martin@2871
   587
  <target name="war" depends="init">
martin@2871
   588
    <ant dir="${base.src}" target="build.war" inheritAll="true" inheritRefs="true" />
martin@2871
   589
  </target>
juanpablo@131
   590
martin@2871
   591
  <target name="core.lib" depends="init">
martin@2871
   592
    <ant dir="${base.src.core}" target="build" inheritAll="true" inheritRefs="true" />
asier@2994
   593
    <copy file="${base.src.core}/lib/openbravo-core.jar" todir="${base.lib}/runtime" failonerror="false" />
martin@2871
   594
  </target>
juanpablo@131
   595
martin@2871
   596
  <target name="wad.lib" depends="init">
martin@2871
   597
    <ant dir="${base.src.wad}" target="build" inheritAll="true" inheritRefs="true" />
martin@2871
   598
  </target>
juanpablo@179
   599
martin@2871
   600
  <target name="trl.lib" depends="init">
martin@2871
   601
    <ant dir="${base.src.trl}" target="build" inheritAll="true" inheritRefs="true" />
martin@2871
   602
  </target>
asier@43
   603
martin@2871
   604
  <target name="database.lib" depends="init">
martin@2871
   605
    <ant dir="${base.src.db}" target="jar" inheritAll="true" inheritRefs="true" />
asier@2995
   606
    <copy file="${base.src.db}/build/lib/dbmanager.jar" todir="${base.db}/lib" failonerror="false" />
martin@2871
   607
  </target>
martin@2345
   608
martin@2871
   609
  <target name="clean" depends="init">
martin@2871
   610
    <ant dir="${base.src}" target="clean" inheritAll="true" inheritRefs="true" />
martin@2871
   611
  </target>
martin@2345
   612
martin@2871
   613
  <target name="trl.clean" depends="init">
martin@2871
   614
    <ant dir="${base.src}" target="trl.clean" inheritAll="true" inheritRefs="true" />
martin@2871
   615
  </target>
martin@2345
   616
stefan@11820
   617
  <target name="trl.remove.unused" depends="init">
stefan@11820
   618
    <ant dir="${base.src}" target="trl.remove.unused" inheritAll="true" inheritRefs="true" />
stefan@11820
   619
  </target>
stefan@11820
   620
martin@2871
   621
  <target name="translate" depends="init">
martin@2871
   622
    <ant dir="${base.src}" target="translate" inheritAll="true" inheritRefs="true" />
martin@2871
   623
  </target>
martin@2686
   624
stefan@37304
   625
  <target name="install.source" depends="init, cleanSubfolders, create.database, wad.lib, trl.lib, compile.complete.deploy, apply.module, import.sample.data">
martin@14869
   626
    <updatesystemstatus v="RB51"/> 
antonio@5626
   627
    <ant dir="${base.db}" target="setApplied" inheritAll="true" inheritRefs="true" />
martin@2871
   628
martin@2871
   629
    <!--
martin@2686
   630
		<antcall target="validate.database" />
martin@2686
   631
		<antcall target="validate.modules" />
martin@2704
   632
		-->
martin@2871
   633
  </target>
juanpablo@131
   634
stefan@5405
   635
  <target name="create.database" depends="init, core.lib, database.lib">
martin@2871
   636
    <ant dir="${base.db}" antfile="build-create.xml" target="create.database" inheritAll="true" inheritRefs="true" />
martin@2871
   637
    <antcall target="db.apply.modules.sampledata" />
martin@2871
   638
  </target>
antonio@1335
   639
antonio@6897
   640
  <target name="update.database" depends="init, core.lib, database.lib, buildvalidation">
martin@14869
   641
    <updatesystemstatus v="RB12"/>
antonio@4870
   642
    <ant dir="${base.db}" target="update.database.java" inheritAll="true" inheritRefs="true" />
martin@4287
   643
    <antcall target="generate.entities.quick" />
antonio@7535
   644
    <antcall target="apply.module" />
martin@2871
   645
  </target>
asier@1929
   646
stefan@5405
   647
  <target name="create.database.script" depends="init, core.lib">
martin@2871
   648
    <ant dir="${base.db}" target="create.database.script" inheritAll="true" inheritRefs="true" />
martin@2871
   649
  </target>
asier@43
   650
stefan@5405
   651
  <target name="update.database.script" depends="init, core.lib">
martin@2871
   652
    <ant dir="${base.db}" target="update.database.script" inheritAll="true" inheritRefs="true" />
martin@2871
   653
  </target>
adrian@97
   654
antonio@5420
   655
  <target name="export.database" depends="init, core.lib, database.lib, generate.entities.quick">
martin@2871
   656
    <ant dir="${base.db}" target="export.database.structure" inheritAll="true" inheritRefs="true" />
martin@2871
   657
  </target>
adrian@164
   658
stefan@5405
   659
  <target name="export.config.script" depends="init, core.lib">
martin@2871
   660
    <ant dir="${base.db}" target="export.config.script" inheritAll="true" inheritRefs="true" />
martin@2871
   661
  </target>
asier@1929
   662
stefan@20707
   663
  <target name="export.sample.data" depends="init, core.lib">
stefan@20707
   664
    <ant dir="${base.db}" target="export.sample.data" inheritAll="true" inheritRefs="true" />
stefan@20707
   665
  </target>
stefan@20707
   666
stefan@20707
   667
  <target name="import.sample.data" depends="init, core.lib">
stefan@20707
   668
    <ant dir="${base.db}" target="import.sample.data" inheritAll="true" inheritRefs="true" />
stefan@20707
   669
  </target>
stefan@20707
   670
martin@2871
   671
  <target name="db.apply.modules.sampledata" if="apply.modules.on.create">
antonio@5077
   672
    <antcall target="generate.entities" />
martin@4287
   673
    <antcall inheritall="true" inheritrefs="true" target="apply.module" />
martin@2871
   674
    <antcall target="import.sample.data" />
martin@2871
   675
  </target>
martin@2345
   676
martin@4287
   677
antonio@8501
   678
  <target name="apply.modules">
martin@4287
   679
asier@3995
   680
    <condition property="apply.modules.complete.compilation.var">
martin@14869
   681
      <istrue value="${apply.modules.complete.compilation}"  />
asier@3995
   682
    </condition>
martin@14869
   683
    
asier@3995
   684
    <condition property="apply.modules.simple.compilation.var">
asier@3995
   685
      <isfalse value="${apply.modules.complete.compilation.var}" />
asier@3995
   686
    </condition>
antonio@7516
   687
martin@14869
   688
    <updatesystemstatus v="RB43"/>
martin@14869
   689
    <antcall target="apply.modules.compile"/>
antonio@7516
   690
antonio@5611
   691
    <ant dir="${base.db}" target="setApplied" inheritAll="true" inheritRefs="true" />
antonio@7516
   692
asier@3995
   693
  </target>
martin@14869
   694
  
martin@4287
   695
  <target name="apply.module.forked">
martin@4287
   696
    <!-- 
martin@4287
   697
    Note: set reinitializeModel to false because otherwise the dal is re-initialized with classes and a model
martin@4287
   698
    which are not in sync (see issue: https://issues.openbravo.com/view.php?id=9376)
martin@4287
   699
    Note: applyModule can also be moved to a java task to fork it (to prevent this from occuring)
martin@4287
   700
    but then no output is visible for the user.
martin@4287
   701
    -->
martin@4287
   702
    <taskdef name="applyModule" classname="org.openbravo.erpCommon.modules.ApplyModuleTask">
martin@4287
   703
      <classpath refid="project.class.path" />
martin@4287
   704
    </taskdef>
antonio@15503
   705
    <applyModule userId="0" adminMode="true" forceRefData="${forceRefData}" propertiesFile="${base.config}/Openbravo.properties"/>
martin@4287
   706
  </target>
martin@14869
   707
  
antonio@7535
   708
  <target name="compile.apply.module" depends="init">
martin@14869
   709
    <updatesystemstatus v="RB31"/>
antonio@7535
   710
    <ant dir="${base.src}" target="compile.apply.module" inheritAll="true" inheritRefs="true" />
antonio@7535
   711
  </target>
martin@14869
   712
  
antonio@7541
   713
  <!--
antonio@7541
   714
  This task uses a special classpath.
antonio@7541
   715
  This classpath is equivalent to the normal project.class.path, except for the fact that that the normal build folder
antonio@7541
   716
  is replaced by the apply.module.build folder, in which the ApplyModule task related classes will be compiled.
antonio@7541
   717
  This is done to workaround the fact that the javac task needs to compile all the related classes when upgrading openbravo
antonio@7541
   718
  and if the normal build folder is included, none of them are recompiled by default unless the whole build directory is specified.
antonio@7541
   719
  -->
antonio@7535
   720
  <target name="apply.module" depends="compile.apply.module">
antonio@6492
   721
    <java classname="org.openbravo.erpCommon.modules.ApplyModuleTask" fork="true" maxmemory="${build.maxmemory}" failonerror="true">
antonio@15503
   722
      <arg line="'${base.src}' '${friendlyWarnings}' '${forceRefData}'" />
antonio@7543
   723
      <classpath refid="apply.module.runtime.classpath" />
martin@4287
   724
    </java>
martin@14869
   725
   <delete includeEmptyDirs="true"  dir="${build.apply.module}" />
martin@4287
   726
  </target>
martin@14869
   727
  
asier@6221
   728
  <target name="apply.modules.compile" depends="wad.lib">
martin@14869
   729
    <antcall target="apply.modules.compile.simple"/>
martin@14869
   730
    <antcall target="apply.modules.compile.complete"/>
asier@3995
   731
  </target>
martin@14869
   732
  
asier@3995
   733
  <target name="apply.modules.compile.simple" if="apply.modules.simple.compilation.var">
martin@2871
   734
    <antcall target="compile.deploy" />
asier@3995
   735
  </target>
martin@14869
   736
  
asier@3995
   737
  <target name="apply.modules.compile.complete" if="apply.modules.complete.compilation.var">
martin@14869
   738
     <antcall target="compile.complete.deploy" />
martin@2871
   739
  </target>
martin@14869
   740
  
martin@2871
   741
  <!-- 
martin@2345
   742
		apparently this does not overwrite the default catalina_opts, only
martin@2345
   743
		if it is not set will it be set to the value below 
martin@2345
   744
	-->
martin@2871
   745
  <property name="env.CATALINA_OPTS" value="-XX:MaxPermSize=128M" />
martin@2345
   746
martin@2871
   747
  <!-- 
martin@2345
   748
		This task is called from the Openbravo ui, it spawns a java call which again
martin@2345
   749
		calls the restart.tomcat.do task as a spawned task.
martin@2345
   750
	-->
asier@34839
   751
  <target name="tomcat.restart">
martin@2917
   752
    <echo message="Restarting tomcat..." />
martin@2871
   753
    <java classname="org.openbravo.service.system.RestartTomcat" spawn="true" fork="true" maxmemory="${build.maxmemory}">
martin@2871
   754
      <arg line="${base.src}" />
martin@2871
   755
      <classpath refid="project.class.path" />
martin@2871
   756
    </java>
martin@2871
   757
  </target>
martin@2345
   758
martin@2871
   759
  <!--
martin@2345
   760
		Is called by the org.openbravo.service.system.RestartTomcat class.
martin@2345
   761
	-->
asier@34839
   762
  <target name="tomcat.restart.do">
martin@2871
   763
    <echo message="Restarting Tomcat at ${env.CATALINA_HOME}" />
martin@2871
   764
    <java classname="org.apache.catalina.startup.Bootstrap" fork="true">
asier@25200
   765
      <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
   766
      <jvmarg value="-Dcatalina.home=${env.CATALINA_HOME}" />
martin@2871
   767
      <jvmarg value="-Dcatalina.base=${env.CATALINA_BASE}" />
martin@2871
   768
      <arg line="stop" />
martin@2871
   769
    </java>
martin@2871
   770
    <sleep description="Wait to give tomcat time to stop" seconds="20" />
stefan@9978
   771
stefan@9978
   772
    <!-- if deploy.mode=class this will sync (& delete orphan) jarfiles from WebContent -> tomcat-->
martin@14869
   773
    <antcall target="copy.files.jarsync"/>
stefan@9978
   774
stefan@9978
   775
    <java classname="org.apache.catalina.startup.Bootstrap" fork="true" spawn="true">
asier@25200
   776
      <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
   777
      <!-- note because CATALINA_OPTS can be multi argument the line attribute has to be used! -->
martin@2871
   778
      <jvmarg line="${env.CATALINA_OPTS}" />
martin@2871
   779
      <jvmarg value="-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager" />
martin@2871
   780
      <jvmarg value="-Djava.util.logging.config.file=${env.CATALINA_BASE}/conf/logging.properties" />
martin@2871
   781
      <jvmarg value="-Dcatalina.base=${env.CATALINA_BASE}" />
martin@2871
   782
      <jvmarg value="-Dcatalina.home=${env.CATALINA_HOME}" />
martin@2871
   783
      <jvmarg value="-Djava.io.tmpdir=${env.CATALINA_BASE}/temp" />
martin@2871
   784
      <arg line="start" />
martin@2871
   785
    </java>
martin@2871
   786
  </target>
martin@2345
   787
martin@2871
   788
  <target name="tomcat.list">
martin@2871
   789
    <taskdef name="list" classname="org.apache.catalina.ant.ListTask">
martin@2871
   790
      <classpath refid="project.class.path" />
martin@2871
   791
    </taskdef>
martin@2871
   792
    <list url="${tomcat.manager.url}" username="${tomcat.manager.username}" password="${tomcat.manager.password}" />
martin@2871
   793
  </target>
martin@2345
   794
martin@2871
   795
  <target name="deploy.context">
martin@2871
   796
    <taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask">
martin@2871
   797
      <classpath refid="project.class.path" />
martin@2871
   798
    </taskdef>
martin@2871
   799
    <taskdef name="deploy.tomcat" classname="org.apache.catalina.ant.DeployTask">
martin@2871
   800
      <classpath refid="project.class.path" />
martin@2871
   801
    </taskdef>
martin@2871
   802
    <taskdef name="start" classname="org.apache.catalina.ant.StartTask">
martin@2871
   803
      <classpath refid="project.class.path" />
martin@2871
   804
    </taskdef>
martin@2345
   805
martin@2871
   806
    <undeploy url="${tomcat.manager.url}" username="${tomcat.manager.username}" password="${tomcat.manager.password}" path="/${context.name}" failonerror="false" />
martin@2871
   807
    <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
   808
    <start url="${tomcat.manager.url}" username="${tomcat.manager.username}" password="${tomcat.manager.password}" path="/${context.name}" />
martin@2871
   809
  </target>
martin@2345
   810
martin@2871
   811
  <target name="obx.export.database" if="obx.exp.DB">
martin@2871
   812
    <antcall target="export.database" />
martin@2871
   813
  </target>
martin@2345
   814
martin@2871
   815
  <target name="obx.export.config.script" if="obx.exp.CS">
martin@2871
   816
    <antcall target="export.config.script" />
martin@2871
   817
  </target>
martin@2345
   818
asier@19231
   819
  <target name="obx.export.validateModules" if="obx.exp.validate">
asier@19231
   820
    <taskdef name="validateModules" classname="org.openbravo.service.system.SystemValidationTask">
martin@2871
   821
      <classpath refid="project.class.path" />
martin@2871
   822
    </taskdef>
martin@2345
   823
asier@5560
   824
    <taskdef name="WADValidation" classname="org.openbravo.wad.validation.WADValidatorTask">
asier@5533
   825
      <classpath refid="project.class.path" />
asier@5533
   826
    </taskdef>
asier@19231
   827
asier@5533
   828
    <echo message="Validating Module..." />
asier@19231
   829
martin@14869
   830
    <WADValidation propertiesFile="${base.config}/Openbravo.properties"
martin@14869
   831
                   modules="${module}"
martin@14869
   832
                   stoponerror="true"/>
martin@3038
   833
asier@11044
   834
    <validateModules moduleJavaPackage="${module}" failOnError="true" userId="0" adminMode="true" propertiesFile="${base.config}/Openbravo.properties" type="module" />
asier@19231
   835
  </target>
asier@19231
   836
  
asier@19231
   837
  <target name="package.module">
asier@19231
   838
    <taskdef name="extractModule" classname="org.openbravo.erpCommon.modules.ExtractModuleTask">
asier@19231
   839
      <classpath refid="project.class.path" />
asier@19231
   840
    </taskdef>
asier@19231
   841
    
asier@19231
   842
    <antcall target="obx.export.validateModules" />
martin@2871
   843
    <antcall target="obx.export.database" />
martin@2871
   844
    <antcall target="obx.export.config.script" />
juanpablo@2691
   845
asier@19231
   846
    <extractModule moduleName="${module}" 
asier@19231
   847
                   userId="0" 
asier@19231
   848
                   adminMode="true" 
asier@19231
   849
                   propertiesFile="${base.config}/Openbravo.properties" 
asier@19231
   850
                   exportRD="${obx.export.RD}" 
asier@19231
   851
                   addAllDependencies="${obx.export.allDeps}"/>
martin@2871
   852
  </target>
juanpablo@2691
   853
martin@2871
   854
  <target name="diagnostic">
antonio@6886
   855
    <ant dir="src-util/diagnostic" antfile="build-create.xml" target="build" />
antonio@6886
   856
    <ant dir="src-util/diagnostic" target="check.all" />
martin@2871
   857
  </target>
inigo@25249
   858
  
inigo@25249
   859
  <target name="setup.compile">
inigo@25519
   860
	<mkdir dir="build/classes" />
inigo@25525
   861
    <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
   862
      <classpath refid="project.class.path"/>  
inigo@25519
   863
    </javac>
martin@2871
   864
  </target>
juanpablo@2706
   865
inigo@25525
   866
  <target name="setup" depends="init, setup.compile">
inigo@25519
   867
    <echo message="Launching configuration application..."/>
inigo@25519
   868
    <taskdef name="configurationApp" classname="org.openbravo.configuration.ConfigurationApp">
inigo@25519
   869
      <classpath refid="project.class.path" />
inigo@25519
   870
    </taskdef>
javier@35020
   871
    <configurationApp nonInteractive="${nonInteractive}" acceptLicense="${acceptLicense}"/>
inigo@25249
   872
    </target>
inigo@25249
   873
  
asier@5536
   874
  <target name="validate.wad">
asier@5536
   875
    <ant dir="${base.src}" target="wadvalidation" inheritAll="true" inheritRefs="true" />
asier@5536
   876
  </target>
martin@14869
   877
  
antonio@7476
   878
  <target name="UIrebuild" depends="core.lib">
antonio@7476
   879
    <java classname="org.openbravo.base.BuildTask" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
antonio@7476
   880
      <arg line="'${base.config}/Openbravo.properties' ${logFileName}" />
antonio@7476
   881
      <classpath>
javier@36404
   882
        <pathelement path="${base.config}"/>
antonio@7476
   883
        <pathelement path="${build.core.lib}/openbravo-core.jar" />
javier@34968
   884
        <pathelement path="${base.lib}/runtime/log4j-1.2-api-2.11.1.jar" />
javier@34968
   885
        <pathelement path="${base.lib}/runtime/log4j-api-2.11.1.jar" />
javier@34968
   886
        <pathelement path="${base.lib}/runtime/log4j-core-2.11.1.jar" />
stefan@11940
   887
        <pathelement path="${base.lib}/runtime/commons-pool-1.5.6.jar" />
stefan@11940
   888
        <pathelement path="${base.lib}/runtime/commons-dbcp-1.4.jar" />
cristian@37514
   889
        <pathelement path="${base.lib}/runtime/postgresql-42.2.16.jar" />
asier@37377
   890
        <pathelement path="${base.lib}/runtime/ojdbc8-19.3.0.0.jar" />
augusto@24383
   891
        <pathelement path="${base.lib}/runtime/ant-1.9.2.jar" />
augusto@24383
   892
        <pathelement path="${base.lib}/runtime/ant-launcher-1.9.2.jar" />
augusto@24383
   893
        <pathelement path="${base.lib}/runtime/ant-apache-log4j-1.9.2.jar" />
antonio@7476
   894
        <pathelement path="${base.lib}/runtime/ant-nodeps.jar" />
antonio@7476
   895
      </classpath>
antonio@7476
   896
    </java>
antonio@7476
   897
  </target>
martin@14869
   898
  
asier@8876
   899
  <target name="check.module.consistency">
asier@8876
   900
    <taskdef name="checkConsistency" classname="org.openbravo.erpCommon.modules.CheckLocalConsistency">
asier@8876
   901
      <classpath refid="project.class.path" />
asier@8876
   902
    </taskdef>
martin@14869
   903
    <checkConsistency userId="0" adminMode="true" propertiesFile="${base.config}/Openbravo.properties"/>
asier@8876
   904
  </target>
martin@14869
   905
  
miguel@16113
   906
  <target name="cleanSubfolders" depends="init">
miguel@16113
   907
      <ant dir="${base.src.core}" target="clean" inheritAll="true" inheritRefs="true" />
miguel@16113
   908
      <ant dir="${base.src.trl}" target="clean" inheritAll="true" inheritRefs="true" />
miguel@16113
   909
      <ant dir="${base.src.wad}" target="clean" inheritAll="true" inheritRefs="true" />
asier@16641
   910
  </target>
asier@16641
   911
  
asier@16641
   912
  <target name="activate.instance" depends="init"
asier@16641
   913
          description="Activates the instance with the provided public key">
asier@16641
   914
   <taskdef name="activateInstace" classname="org.openbravo.erpCommon.obps.ActivationTask">
asier@16641
   915
     <classpath refid="project.class.path" />
asier@16641
   916
   </taskdef>
asier@16641
   917
   <property name="purpose" value="" />
asier@16641
   918
   <property name="publicKey" value="" />
asier@16641
   919
   <property name="publicKeyFile" value="" />
asier@16641
   920
    
asier@16641
   921
   <activateInstace purpose="${purpose}"
asier@16641
   922
                    publicKey="${publicKey}"
asier@16641
   923
                    publicKeyFile="${publicKeyFile}"
asier@16641
   924
                    userId="0" 
asier@16641
   925
                    adminMode="true" 
asier@16641
   926
                    propertiesFile="${base.config}/Openbravo.properties"/>
asier@16641
   927
  </target>
miguel@16113
   928
  
asier@25752
   929
  <target name="host.name"
asier@25752
   930
          description="Prints this machine's name. This name can be used to overwrite common Openbravo.properties by machine.name.Openbravo properties file">
asier@25753
   931
    <mkdir dir="build/classes"/>
asier@25752
   932
    <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
   933
      <classpath refid="project.class.path"/>
asier@25752
   934
    </javac>
asier@25752
   935
    <taskdef name="hostName" classname="org.openbravo.base.session.HostNameTask">
asier@25752
   936
      <classpath refid="project.class.path"/>
asier@25752
   937
    </taskdef>
asier@25752
   938
    <hostName/>
asier@25752
   939
  </target>
asier@43
   940
</project>