build.xml
author Asier Lostalé <asier.lostale@openbravo.com>
Fri, 30 Jan 2009 11:57:02 +0000
changeset 2853 7f843a980871
parent 2838 6ecf6b366520
child 2855 ca3a42a8c786
permissions -rw-r--r--
[quickbuild] Use md5 to check if compile.complete is needed
asier@43
     1
<?xml version="1.0" encoding="UTF-8" ?>
asier@43
     2
<!--
juanpablo@1548
     3
*************************************************************************
juanpablo@1548
     4
* The contents of this file are subject to the Openbravo  Public  License
juanpablo@1548
     5
* Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
juanpablo@1548
     6
* Version 1.1  with a permitted attribution clause; you may not  use this
juanpablo@1548
     7
* file except in compliance with the License. You  may  obtain  a copy of
juanpablo@1548
     8
* the License at http://www.openbravo.com/legal/license.html
juanpablo@1548
     9
* Software distributed under the License  is  distributed  on  an "AS IS"
juanpablo@1548
    10
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
juanpablo@1548
    11
* License for the specific  language  governing  rights  and  limitations
juanpablo@1548
    12
* under the License.
juanpablo@1548
    13
* The Original Code is Openbravo ERP.
juanpablo@1548
    14
* The Initial Developer of the Original Code is Openbravo SL
asier@2826
    15
* All portions are Copyright (C) 2001-2009 Openbravo SL
juanpablo@1548
    16
* All Rights Reserved.
juanpablo@1548
    17
* Contributor(s):  ______________________________________.
juanpablo@1548
    18
************************************************************************
asier@43
    19
-->
juanpablo@213
    20
<!--
juanpablo@213
    21
List of targets:
juanpablo@213
    22
juanpablo@213
    23
init: checks if exists the JAVA_HOME var.
juanpablo@213
    24
compile.complete: refer to compile.complete target of src.
juanpablo@213
    25
compile: refer to compile target of src.
juanpablo@213
    26
compile.complete.development: refer to compile.complete.development target of src.
juanpablo@213
    27
compile.development: refer to compile.development target of src.
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@213
    48
preinstall: deprecated.
juanpablo@213
    49
preinstall.complete: deprecated.
juanpablo@213
    50
install: deprecated.
juanpablo@2061
    51
deploy.context: deploy the context into Tomcat using the manager
juanpablo@213
    52
install.source: install the ERP from sources (from subversion).
juanpablo@213
    53
eclipse.install.source: install the ERP from sources for eclipse (from subversion).
juanpablo@213
    54
create.database: refer to create.database target of database.
juanpablo@213
    55
update.database: refer to update.database target of database.
juanpablo@213
    56
create.database.structure: refer to create.database.structure target of database.
juanpablo@213
    57
update.database.structure: refer to update.database.structure target of database.
juanpablo@213
    58
create.database.script: refer to create.database.script target of database.
juanpablo@213
    59
update.database.script: refer to update.database.script target of database.
juanpablo@213
    60
export.database: exports database structure and data to xml files.
juanpablo@213
    61
export.database.structure: refer to export.database.structure target of database.
juanpablo@213
    62
export.database.data: refer to export.database.data target of database.
juanpablo@213
    63
import.database.data: refer to import.database.data target of database.
juanpablo@213
    64
save.database.model: refer to save.database.model target of database.
juanpablo@213
    65
compare.database.structure: refer to compare.database.structure target of database.
fernando@202
    66
-->
asier@43
    67
<project name="openbravo" default="compile.complete" basedir=".">
martin@2345
    68
	<property environment="env" />
martin@2345
    69
	<property name="base.config" location="config" />
martin@2345
    70
	<property file="${base.config}/Openbravo.properties" />
asier@2853
    71
	<property file="${base.config}/checksums" />
juanpablo@131
    72
martin@2432
    73
	<property name="base.config" location="config" />
martin@2345
    74
	<property name="base.src" location="src" />
martin@2345
    75
	<property name="base.src.core" location="src-core" />
martin@2345
    76
	<property name="base.src.db" location="src-db" />
martin@2345
    77
	<property name="base.src.trl" location="src-trl" />
martin@2345
    78
	<property name="base.src.wad" location="src-wad" />
martin@2345
    79
	<property name="base.src.gen" location="src-gen" />
martin@2345
    80
	<property name="base.client.src" location="srcClient" />
martin@2345
    81
	<property name="base.db" location="src-db/database" />
martin@2345
    82
	<property name="base.web" location="web" />
martin@2345
    83
	<property name="base.context" location="WebContent" />
martin@2345
    84
	<property name="base.design" location="${base.context}/src-loc" />
martin@2345
    85
	<property name="base.lib" location="lib" />
martin@2345
    86
	<property name="base.modules" location="modules" />
martin@2345
    87
	<property name="build" location="build/classes" />
martin@2345
    88
	<property name="build.AD" location="srcAD" />
martin@2345
    89
	<property name="build.sqlc" location="build/javasqlc" />
martin@2345
    90
	<property name="build.core.lib" location="src-core/lib" />
martin@2345
    91
	<property name="build.trl.lib" location="src-trl/lib" />
martin@2345
    92
	<property name="build.wad.lib" location="src-wad/lib" />
martin@2345
    93
	<property name="build.docs" location="docs/api" />
martin@2345
    94
	<property name="jakarta.home" location="${env.CATALINA_HOME}" />
martin@2345
    95
	<property name="module" value="%" />
martin@2345
    96
	<property name="apply.on.create" value="false" />
martin@2345
    97
	<property name="obx.export.RD" value="false" />
martin@2345
    98
	<property name="obx.export.DB" value="false" />
martin@2345
    99
	<property name="obx.export.CS" value="false" />
martin@2345
   100
	<property name="chekPerms" value="false" />
asier@2057
   101
martin@2345
   102
	<available file=".svn/entries" property="is.svn" />
martin@2345
   103
asier@2853
   104
	<checksum file="${base.src.wad}/lib/openbravo-wad.jar" algorithm="MD5" property="test.md5.wad"/>
asier@2853
   105
	
asier@2853
   106
	<condition property="new.wad">
asier@2853
   107
		<not>
asier@2853
   108
	    <equals arg1="${test.md5.wad}" arg2="${md5.wad}"/>
asier@2853
   109
		</not>
asier@2853
   110
	</condition>
asier@2853
   111
	
juanpablo@2522
   112
  <condition property="deploy.mode" value="class">
juanpablo@2522
   113
    <not>
juanpablo@2522
   114
      <isset property="${deploy.mode}" />
juanpablo@2522
   115
    </not>
juanpablo@2522
   116
  </condition>
martin@2345
   117
asier@1977
   118
	<condition property="mode.war">
martin@2345
   119
		<equals arg1="war" arg2="${deploy.mode}" />
asier@1977
   120
	</condition>
martin@2345
   121
martin@2345
   122
	<condition property="mode.class">
martin@2345
   123
		<equals arg1="class" arg2="${deploy.mode}" />
martin@2345
   124
	</condition>
martin@2345
   125
asier@1929
   126
	<condition property="apply.modules.on.create">
asier@1929
   127
		<or>
martin@2345
   128
			<equals arg1="yes" arg2="${apply.on.create}" />
martin@2345
   129
			<equals arg1="true" arg2="${apply.on.create}" />
asier@1929
   130
		</or>
asier@1929
   131
	</condition>
martin@2345
   132
asier@1929
   133
	<condition property="obx.exp.DB">
asier@1929
   134
		<or>
martin@2345
   135
			<equals arg1="yes" arg2="${obx.export.DB}" />
martin@2345
   136
			<equals arg1="true" arg2="${obx.export.DB}" />
asier@1929
   137
		</or>
asier@1929
   138
	</condition>
martin@2345
   139
asier@1929
   140
	<condition property="obx.exp.CS">
asier@1929
   141
		<or>
martin@2345
   142
			<equals arg1="yes" arg2="${obx.export.CS}" />
martin@2345
   143
			<equals arg1="true" arg2="${obx.export.CS}" />
asier@1929
   144
		</or>
asier@1929
   145
	</condition>
asier@43
   146
martin@2345
   147
	<condition property="jakarta.base" value="${env.CATALINA_BASE}" else="${jakarta.home}">
martin@2345
   148
		<and>
martin@2345
   149
			<isset property="env.CATALINA_BASE" />
martin@2345
   150
		</and>
martin@2345
   151
	</condition>
martin@2345
   152
	<property name="log.path" location="${jakarta.base}/logs" />
martin@2345
   153
	<property name="lib" location="${jakarta.home}/common" />
martin@2345
   154
	<property name="jakarta.context" location="${jakarta.base}/webapps/${context.name}" />
martin@2345
   155
	<property name="build.maxmemory" value="512M" />
stefan@124
   156
martin@2345
   157
	<condition property="no.java.home" value="true">
martin@2345
   158
		<not>
martin@2345
   159
			<isset property="env.JAVA_HOME" />
martin@2345
   160
		</not>
martin@2345
   161
	</condition>
juanpablo@1548
   162
antonio@2838
   163
  <condition property="bbdd.owner.url" value="${bbdd.url}/${bbdd.sid}" else="${bbdd.url}">
antonio@2838
   164
    <and>
antonio@2838
   165
      <equals arg1="${bbdd.rdbms}" arg2="POSTGRE"/>
antonio@2838
   166
    </and>
antonio@2838
   167
  </condition>
martin@2345
   168
martin@2345
   169
	<path id="project.class.path">
martin@2345
   170
		<pathelement path="${build}" />
martin@2345
   171
		<pathelement path="${base.src}" />
martin@2345
   172
		<fileset dir="${base.lib}">
martin@2345
   173
			<include name="**/*.jar" />
martin@2345
   174
		</fileset>
martin@2345
   175
		<fileset dir="${build.core.lib}">
martin@2345
   176
			<include name="openbravo-core.jar" />
martin@2345
   177
		</fileset>
martin@2345
   178
		<fileset dir="${build.trl.lib}">
martin@2345
   179
			<include name="openbravo-trl.jar" />
martin@2345
   180
		</fileset>
martin@2345
   181
		<fileset dir="${build.wad.lib}">
martin@2345
   182
			<include name="openbravo-wad.jar" />
martin@2345
   183
		</fileset>
martin@2345
   184
		<fileset dir="${base.lib}">
martin@2345
   185
			<include name="**/*.jar" />
martin@2345
   186
		</fileset>
martin@2345
   187
		<fileset dir="${base.db}/lib/">
martin@2345
   188
			<include name="**/*.jar" />
martin@2345
   189
		</fileset>
martin@2345
   190
		<fileset dir="${base.modules}">
martin@2345
   191
			<include name="*/lib/**" />
martin@2345
   192
		</fileset>
martin@2345
   193
	</path>
martin@2345
   194
martin@2345
   195
	<taskdef resource="axis-tasks.properties" classpathref="project.class.path" />
martin@2345
   196
martin@2345
   197
	<target name="init">
martin@2345
   198
		<fail if="no.java.home" message="The environment variable JAVA_HOME is not set." />
martin@2345
   199
	</target>
stefan@124
   200
asier@2057
   201
	<target name="code.rev" depends="set.code.rev">
martin@2345
   202
		<condition property="code.revision" value="${svn.entries}" else="0">
martin@2345
   203
			<isset property="svn.entries" />
martin@2345
   204
		</condition>
asier@2057
   205
	</target>
ivan@812
   206
martin@2345
   207
	<target name="set.code.rev" if="is.svn">
martin@2345
   208
		<loadfile property="svn.entries" srcFile=".svn/entries" failonerror="false">
martin@2345
   209
			<filterchain>
martin@2345
   210
				<filterreader classname="org.apache.tools.ant.filters.HeadFilter">
martin@2345
   211
					<param name="skip" value="3" />
martin@2345
   212
					<param name="lines" value="1" />
martin@2345
   213
				</filterreader>
martin@2345
   214
			</filterchain>
martin@2345
   215
			<filterchain>
martin@2345
   216
				<filterreader classname="org.apache.tools.ant.filters.StripLineBreaks" />
martin@2345
   217
			</filterchain>
martin@2345
   218
		</loadfile>
martin@2345
   219
	</target>
asier@43
   220
martin@2345
   221
	<target name="compile.complete" depends="init">
martin@2345
   222
		<ant dir="${base.src}" target="compile.complete" inheritAll="true" inheritRefs="true" />
martin@2345
   223
	</target>
asier@2826
   224
	
asier@2826
   225
	 <target name="build.quick" depends="init">
asier@2853
   226
asier@2853
   227
	    <ant dir="${base.src}" target="build.quick" inheritAll="true" inheritRefs="true"/>
asier@2826
   228
	  </target>
asier@2826
   229
	
martin@2345
   230
martin@2345
   231
	<target name="compile" depends="init">
martin@2345
   232
		<ant dir="${base.src}" target="compile" inheritAll="true" inheritRefs="true" />
martin@2345
   233
	</target>
martin@2345
   234
asier@1977
   235
	<target name="compile.complete.deploy">
martin@2345
   236
		<antcall target="compile.complete.development" />
martin@2345
   237
		<antcall target="compile.complete.war" />
asier@1977
   238
	</target>
martin@2345
   239
martin@2345
   240
	<target name="compile.complete.development" depends="init" if="mode.class">
martin@2345
   241
		<ant dir="${base.src}" target="compile.complete.development" inheritAll="true" inheritRefs="true" />
martin@2345
   242
	</target>
martin@2345
   243
asier@1977
   244
	<target name="compile.complete.war" depends="init" if="mode.war">
martin@2345
   245
		<antcall target="compile.complete" />
martin@2345
   246
		<antcall target="war" />
asier@1977
   247
	</target>
asier@43
   248
asier@1977
   249
	<target name="compile.deploy">
martin@2345
   250
		<antcall target="compile.war" />
martin@2345
   251
		<antcall target="compile.development" />
asier@1977
   252
	</target>
asier@43
   253
martin@2345
   254
	<target name="compile.development" depends="init" if="mode.class">
martin@2345
   255
		<ant dir="${base.src}" target="compile.development" inheritAll="true" inheritRefs="true" />
martin@2345
   256
	</target>
asier@1929
   257
martin@2686
   258
	<target name="validate.database">
martin@2686
   259
		<ant dir="${base.src}" target="validate.database" inheritAll="true" inheritRefs="true" />
martin@2686
   260
	</target>
martin@2686
   261
martin@2686
   262
	<target name="validate.modules">
martin@2686
   263
		<ant dir="${base.src}" target="validate.modules" inheritAll="true" inheritRefs="true" />
martin@2686
   264
	</target>
martin@2686
   265
martin@2345
   266
	<target name="compile.war" if="mode.war">
martin@2345
   267
		<antcall target="compile" />
martin@2345
   268
		<antcall target="war" />
martin@2345
   269
	</target>
asier@1929
   270
martin@2345
   271
	<target name="compile.web" depends="init">
martin@2345
   272
		<ant dir="${base.src}" target="compile.web" inheritAll="true" inheritRefs="true" />
martin@2345
   273
	</target>
asier@43
   274
martin@2345
   275
	<target name="compile.web.development" depends="init">
martin@2345
   276
		<ant dir="${base.src}" target="compile.web.development" inheritAll="true" inheritRefs="true" />
martin@2345
   277
	</target>
ivan@1738
   278
martin@2345
   279
	<target name="eclipse.compile" depends="init">
martin@2345
   280
		<ant dir="${base.src.core}" target="build.jar" inheritAll="true" inheritRefs="true" />
martin@2345
   281
		<ant dir="${base.src.trl}" target="build.jar" inheritAll="true" inheritRefs="true" />
martin@2345
   282
		<ant dir="${base.src.wad}" target="build.jar" inheritAll="true" inheritRefs="true" />
martin@2345
   283
		<ant dir="${base.src}" target="eclipse.compile" inheritAll="true" inheritRefs="true" />
martin@2345
   284
		<eclipse.refreshLocal resource="openbravo" depth="infinite" />
martin@2345
   285
		<eclipse.incrementalBuild project="openbravo" kind="incremental" />
martin@2345
   286
	</target>
asier@43
   287
martin@2345
   288
	<target name="eclipse.compile.complete" depends="init">
martin@2345
   289
		<ant dir="${base.src.core}" target="build.jar" inheritAll="true" inheritRefs="true" />
martin@2345
   290
		<ant dir="${base.src.trl}" target="build.jar" inheritAll="true" inheritRefs="true" />
martin@2345
   291
		<ant dir="${base.src.wad}" target="build.jar" inheritAll="true" inheritRefs="true" />
martin@2345
   292
		<ant dir="${base.src}" target="eclipse.compile.complete" inheritAll="true" inheritRefs="true" />
martin@2345
   293
		<eclipse.refreshLocal resource="openbravo" depth="infinite" />
martin@2345
   294
		<eclipse.incrementalBuild project="openbravo" kind="full" />
martin@2345
   295
	</target>
martin@2245
   296
martin@2345
   297
	<target name="compile.src.gen" depends="init">
martin@2345
   298
		<ant dir="${base.src}" target="compile.src.gen" inheritAll="true" inheritRefs="true" />
martin@2345
   299
	</target>
martin@2284
   300
martin@2345
   301
	<target name="generate.entities">
martin@2345
   302
		<ant dir="${base.src}" target="generate.entities" inheritAll="true" inheritRefs="true" />
martin@2345
   303
	</target>
asier@43
   304
martin@2830
   305
	<target name="generate.entities.quick">
martin@2830
   306
		<ant dir="${base.src}" target="generate.entities.quick" inheritAll="true" inheritRefs="true" />
martin@2830
   307
	</target>
martin@2830
   308
asier@2348
   309
	<target name="export.sample.data" depends="code.rev">
martin@2345
   310
		<ant dir="${base.src}" target="export.sample.data" inheritAll="true" inheritRefs="true" />
martin@2345
   311
	</target>
asier@43
   312
antonio@2766
   313
	<target name="import.sample.data" depends="code.rev">
martin@2345
   314
		<ant dir="${base.src}" target="import.sample.data" inheritAll="true" inheritRefs="true" />
martin@2345
   315
	</target>
juanpablo@131
   316
martin@2345
   317
	<target name="compile.src" depends="init">
martin@2345
   318
		<ant dir="${base.src}" target="compile.src" inheritAll="true" inheritRefs="true" />
martin@2345
   319
	</target>
juanpablo@131
   320
martin@2345
   321
	<target name="war" depends="init">
martin@2345
   322
		<ant dir="${base.src}" target="build.war" inheritAll="true" inheritRefs="true" />
martin@2345
   323
	</target>
juanpablo@131
   324
martin@2345
   325
	<target name="core.docs" depends="init">
martin@2345
   326
		<ant dir="${base.src.core}" target="doc" inheritAll="true" inheritRefs="true" />
martin@2345
   327
	</target>
juanpablo@131
   328
martin@2345
   329
	<target name="core.lib" depends="init">
martin@2345
   330
		<ant dir="${base.src.core}" target="build" inheritAll="true" inheritRefs="true" />
martin@2345
   331
		<copy file="${base.src.core}/lib/openbravo-core.jar" todir="${base.lib}/runtime" overwrite="true" failonerror="false" />
martin@2345
   332
	</target>
juanpablo@131
   333
martin@2345
   334
	<target name="eclipse.wad.lib" depends="init">
martin@2345
   335
		<ant dir="${base.src.wad}" target="sqlc" inheritAll="true" inheritRefs="true" />
martin@2345
   336
		<eclipse.refreshLocal resource="OpenbravoWAD" depth="infinite" />
martin@2345
   337
		<eclipse.incrementalBuild project="OpenbravoWAD" kind="full" />
martin@2345
   338
	</target>
juanpablo@131
   339
martin@2345
   340
	<target name="wad.docs" depends="init">
martin@2345
   341
		<ant dir="${base.src.wad}" target="doc" inheritAll="true" inheritRefs="true" />
martin@2345
   342
	</target>
juanpablo@131
   343
martin@2345
   344
	<target name="wad.lib" depends="init">
martin@2345
   345
		<ant dir="${base.src.wad}" target="build" inheritAll="true" inheritRefs="true" />
martin@2345
   346
	</target>
juanpablo@131
   347
martin@2345
   348
	<target name="eclipse.trl.lib" depends="init">
martin@2345
   349
		<ant dir="${base.src.trl}" target="sqlc" inheritAll="true" inheritRefs="true" />
martin@2345
   350
		<eclipse.refreshLocal resource="OpenbravoTrl" depth="infinite" />
martin@2345
   351
		<eclipse.incrementalBuild project="OpenbravoTrl" kind="full" />
martin@2345
   352
	</target>
asier@43
   353
martin@2345
   354
	<target name="trl.docs" depends="init">
martin@2345
   355
		<ant dir="${base.src.trl}" target="doc" inheritAll="true" inheritRefs="true" />
martin@2345
   356
	</target>
juanpablo@179
   357
martin@2345
   358
	<target name="trl.lib" depends="init">
martin@2345
   359
		<ant dir="${base.src.trl}" target="build" inheritAll="true" inheritRefs="true" />
martin@2345
   360
	</target>
juanpablo@179
   361
martin@2345
   362
	<target name="database.lib" depends="init">
martin@2345
   363
		<ant dir="${base.src.db}" target="jar" inheritAll="true" inheritRefs="true" />
martin@2345
   364
		<copy file="${base.src.db}/build/lib/dbmanager.jar" todir="${base.db}/lib" overwrite="true" failonerror="false" />
martin@2345
   365
	</target>
juanpablo@179
   366
martin@2345
   367
	<target name="clean" depends="init">
martin@2345
   368
		<ant dir="${base.src}" target="clean" inheritAll="true" inheritRefs="true" />
martin@2345
   369
	</target>
asier@43
   370
martin@2345
   371
	<target name="trl.clean" depends="init">
martin@2345
   372
		<ant dir="${base.src}" target="trl.clean" inheritAll="true" inheritRefs="true" />
martin@2345
   373
	</target>
asier@43
   374
martin@2345
   375
	<target name="translate" depends="init">
martin@2345
   376
		<ant dir="${base.src}" target="translate" inheritAll="true" inheritRefs="true" />
martin@2345
   377
	</target>
asier@2363
   378
	
asier@2363
   379
	 <target name="translate.modules" depends="init">
asier@2363
   380
	    <ant dir="${base.src}" target="translate.modules" inheritAll="true" inheritRefs="true" />
asier@2363
   381
	  </target>
martin@2345
   382
martin@2345
   383
	<target name="installWebService" depends="init">
martin@2345
   384
		<ant dir="${base.src}" target="installWebService" inheritAll="true" inheritRefs="true">
martin@2345
   385
			<property name="wsdd" value="1" />
martin@2345
   386
		</ant>
martin@2345
   387
	</target>
martin@2345
   388
martin@2345
   389
	<target name="uninstallWebService" depends="init">
martin@2345
   390
		<ant dir="${base.src}" target="uninstallWebService" inheritAll="true" inheritRefs="true" />
martin@2345
   391
	</target>
martin@2345
   392
martin@2345
   393
	<target name="install.source" depends="init,code.rev">
martin@2345
   394
		<antcall target="database.lib" />
martin@2524
   395
		<antcall target="core.lib" />
martin@2345
   396
		<ant dir="${base.db}" antfile="build-create.xml" target="create.database" inheritAll="true" inheritRefs="true" />
martin@2345
   397
		<antcall target="wad.lib" />
martin@2345
   398
		<antcall target="trl.lib" />
martin@2345
   399
		<antcall target="compile.complete.deploy" />
martin@2345
   400
		<echo message="applying modules" />
martin@2345
   401
		<taskdef name="applyModule" classname="org.openbravo.erpCommon.modules.ApplyModuleTask">
martin@2345
   402
			<classpath refid="project.class.path" />
martin@2345
   403
		</taskdef>
martin@2686
   404
		<applyModule userId="0" propertiesFile="${base.config}/Openbravo.properties"/>
martin@2686
   405
		
martin@2345
   406
		<antcall target="import.sample.data" />
martin@2686
   407
martin@2704
   408
		<!--
martin@2686
   409
		<antcall target="validate.database" />
martin@2686
   410
		<antcall target="validate.modules" />
martin@2704
   411
		-->
martin@2345
   412
	</target>
juanpablo@131
   413
martin@2345
   414
	<target name="eclipse.install.source" depends="init,code.rev">
martin@2345
   415
		<antcall target="database.lib" />
martin@2581
   416
		<antcall target="core.lib" />
martin@2524
   417
		<eclipse.incrementalBuild project="OpenbravoCore" kind="full" />
martin@2345
   418
		<ant dir="${base.db}" antfile="build-create.xml" target="create.database" inheritAll="true" inheritRefs="true" />
martin@2345
   419
		<antcall target="eclipse.wad.lib" />
martin@2345
   420
		<antcall target="eclipse.trl.lib" />
martin@2345
   421
		<antcall target="eclipse.compile.complete" />
martin@2345
   422
		<echo message="applying modules" />
martin@2345
   423
		<taskdef name="applyModule" classname="org.openbravo.erpCommon.modules.ApplyModuleTask">
martin@2345
   424
			<classpath refid="project.class.path" />
martin@2345
   425
		</taskdef>
martin@2345
   426
		<applyModule userId="0" propertiesFile="${base.config}/Openbravo.properties" />
asier@2351
   427
		<antcall target="import.sample.data" />
martin@2686
   428
martin@2686
   429
		<antcall target="validate.database" />
martin@2686
   430
		<antcall target="validate.modules" />
martin@2345
   431
	</target>
asier@43
   432
martin@2345
   433
	<target name="create.database" depends="init,code.rev">
martin@2345
   434
		<antcall target="database.lib" />
martin@2591
   435
		<antcall target="core.lib" />
martin@2345
   436
		<ant dir="${base.db}" antfile="build-create.xml" target="create.database" inheritAll="true" inheritRefs="true" />
martin@2345
   437
		<antcall target="db.apply.modules.sampledata" />
martin@2345
   438
	</target>
antonio@1335
   439
martin@2830
   440
	<target name="update.database" depends="init,code.rev,generate.entities.quick">
martin@2345
   441
		<antcall target="database.lib" />
martin@2591
   442
		<antcall target="core.lib" />
martin@2345
   443
		<ant dir="${base.db}" target="update.database" inheritAll="true" inheritRefs="true" />
martin@2345
   444
		<antcall target="db.apply.modules" />
martin@2830
   445
		<antcall target="generate.entities.quick" />
martin@2345
   446
	</target>
asier@1929
   447
martin@2345
   448
	<target name="update.database.mod" depends="init,code.rev">
martin@2345
   449
		<antcall target="database.lib" />
martin@2591
   450
		<antcall target="core.lib" />
martin@2345
   451
		<ant dir="${base.db}" target="update.database.mod" inheritAll="true" inheritRefs="true" />
martin@2345
   452
		<antcall target="db.apply.modules" />
martin@2345
   453
	</target>
asier@43
   454
martin@2345
   455
	<target name="update.customized.database" depends="init,code.rev">
martin@2345
   456
		<antcall target="database.lib" />
martin@2591
   457
		<antcall target="core.lib" />
martin@2345
   458
		<ant dir="${base.db}" target="update.customized.database" inheritAll="true" inheritRefs="true" />
martin@2345
   459
	</target>
antonio@1335
   460
martin@2345
   461
	<target name="create.database.structure" depends="init">
martin@2591
   462
		<antcall target="core.lib" />
martin@2345
   463
		<ant dir="${base.db}" target="create.database.structure" inheritAll="true" inheritRefs="true" />
martin@2345
   464
	</target>
asier@43
   465
martin@2345
   466
	<target name="update.database.structure" depends="init">
martin@2591
   467
		<antcall target="core.lib" />
martin@2345
   468
		<ant dir="${base.db}" target="update.database.structure" inheritAll="true" inheritRefs="true" />
martin@2345
   469
	</target>
asier@43
   470
martin@2345
   471
	<target name="create.database.script" depends="init">
martin@2591
   472
		<antcall target="core.lib" />
martin@2345
   473
		<ant dir="${base.db}" target="create.database.script" inheritAll="true" inheritRefs="true" />
martin@2345
   474
	</target>
asier@43
   475
martin@2345
   476
	<target name="update.database.script" depends="init">
martin@2591
   477
		<antcall target="core.lib" />
martin@2345
   478
		<ant dir="${base.db}" target="update.database.script" inheritAll="true" inheritRefs="true" />
martin@2345
   479
	</target>
adrian@97
   480
martin@2345
   481
	<target name="export.database" depends="init,code.rev">
martin@2345
   482
		<antcall target="database.lib" />
martin@2591
   483
		<antcall target="core.lib" />
martin@2345
   484
		<ant dir="${base.db}" target="export.database.structure" inheritAll="true" inheritRefs="true" />
martin@2345
   485
	</target>
adrian@164
   486
martin@2345
   487
	<target name="export.database.structure" depends="init,code.rev">
martin@2591
   488
		<antcall target="core.lib" />
martin@2345
   489
		<ant dir="${base.db}" target="export.database.structure" inheritAll="true" inheritRefs="true" />
martin@2345
   490
	</target>
asier@43
   491
martin@2345
   492
	<target name="export.config.script" depends="init,code.rev">
martin@2591
   493
		<antcall target="core.lib" />
martin@2345
   494
		<ant dir="${base.db}" target="export.config.script" inheritAll="true" inheritRefs="true" />
martin@2345
   495
	</target>
asier@1929
   496
martin@2345
   497
	<target name="export.database.data" depends="init,code.rev">
martin@2591
   498
		<antcall target="core.lib" />
martin@2345
   499
		<ant dir="${base.db}" target="export.database.data" inheritAll="true" inheritRefs="true" />
martin@2345
   500
	</target>
asier@43
   501
martin@2345
   502
	<target name="import.database.data" depends="init,code.rev">
martin@2591
   503
		<antcall target="core.lib" />
martin@2345
   504
		<ant dir="${base.db}" target="import.database.data" inheritAll="true" inheritRefs="true" />
martin@2345
   505
	</target>
asier@43
   506
martin@2345
   507
	<target name="db.apply.modules" if="apply.modules.on.create">
martin@2345
   508
		<echo message="applying modules" />
martin@2345
   509
		<taskdef name="applyModule" classname="org.openbravo.erpCommon.modules.ApplyModuleTask">
martin@2345
   510
			<classpath refid="project.class.path" />
martin@2345
   511
		</taskdef>
martin@2345
   512
		<applyModule userId="0" propertiesFile="${base.config}/Openbravo.properties" />
martin@2345
   513
	</target>
martin@2345
   514
martin@2345
   515
	<target name="db.apply.modules.sampledata" if="apply.modules.on.create">
martin@2345
   516
		<echo message="applying modules" />
martin@2345
   517
		<taskdef name="applyModule" classname="org.openbravo.erpCommon.modules.ApplyModuleTask">
martin@2345
   518
			<classpath refid="project.class.path" />
martin@2345
   519
		</taskdef>
martin@2345
   520
		<applyModule userId="0" propertiesFile="${base.config}/Openbravo.properties" />
asier@2351
   521
		<antcall target="import.sample.data" />
martin@2345
   522
	</target>
martin@2345
   523
asier@1929
   524
	<target name="apply.modules">
martin@2345
   525
		<echo>Applying ${module} modules...</echo>
martin@2345
   526
		<taskdef name="applyModule" classname="org.openbravo.erpCommon.modules.ApplyModuleTask">
martin@2345
   527
			<classpath refid="project.class.path" />
martin@2345
   528
		</taskdef>
martin@2345
   529
		<antcall target="update.database.mod" />
martin@2345
   530
		<applyModule userId="0" propertiesFile="${base.config}/Openbravo.properties" reinitializemodel="true" />
martin@2345
   531
		<antcall target="compile.deploy" />
asier@1929
   532
		<!--antcall target="deploy.context"/-->
asier@1929
   533
	</target>
martin@2345
   534
martin@2345
   535
	<!-- 
martin@2345
   536
		apparently this does not overwrite the default catalina_opts, only
martin@2345
   537
		if it is not set will it be set to the value below 
martin@2345
   538
	-->
martin@2345
   539
	<property name="env.CATALINA_OPTS" value="-XX:MaxPermSize=128M" />
martin@2345
   540
martin@2345
   541
	<!-- 
martin@2345
   542
		This task is called from the Openbravo ui, it spawns a java call which again
martin@2345
   543
		calls the restart.tomcat.do task as a spawned task.
martin@2345
   544
	-->
martin@2345
   545
	<target name="tomcat.restart" description="Restart the tomcat server process">
martin@2471
   546
		<java classname="org.openbravo.service.system.RestartTomcat" spawn="true" fork="true" maxmemory="${build.maxmemory}">
martin@2345
   547
			<arg line="${base.src}" />
martin@2345
   548
			<classpath refid="project.class.path" />
martin@2345
   549
		</java>
martin@2345
   550
	</target>
martin@2345
   551
martin@2345
   552
	<!--
martin@2345
   553
		Is called by the org.openbravo.service.system.RestartTomcat class.
martin@2345
   554
	-->
martin@2345
   555
	<target name="tomcat.restart.do" description="Restart the tomcat server process">
martin@2345
   556
		<echo message="Restarting Tomcat at ${env.CATALINA_HOME}" />
martin@2471
   557
		<java classname="org.apache.catalina.startup.Bootstrap" fork="true">
martin@2471
   558
			<classpath path=":${env.CATALINA_HOME}/bin/bootstrap.jar:${env.CATALINA_HOME}/bin/commons-logging-api.jar" />
martin@2345
   559
			<jvmarg value="-Dcatalina.home=${env.CATALINA_HOME}" />
ivan@2489
   560
			<jvmarg value="-Dcatalina.base=${env.CATALINA_BASE}" />
martin@2345
   561
			<arg line="stop" />
martin@2345
   562
		</java>
ivan@2489
   563
		<sleep description="Wait to give tomcat time to stop" seconds="20"/>
martin@2471
   564
		<java classname="org.apache.catalina.startup.Bootstrap" failonerror="true" fork="true">
martin@2471
   565
			<classpath path=":${env.CATALINA_HOME}/bin/bootstrap.jar:${env.CATALINA_HOME}/bin/commons-logging-api.jar" />
martin@2471
   566
			<!-- note because CATALINA_OPTS can be multi argument the line attribute has to be used! -->
martin@2471
   567
			<jvmarg line="${env.CATALINA_OPTS}"/>
martin@2345
   568
			<jvmarg value="-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager" />
ivan@2489
   569
			<jvmarg value="-Djava.util.logging.config.file=${env.CATALINA_BASE}/conf/logging.properties" />
martin@2345
   570
			<jvmarg value="-Djava.endorsed.dirs=${env.CATALINA_HOME}/endorsed" />
ivan@2489
   571
			<jvmarg value="-Dcatalina.base=${env.CATALINA_BASE}" />
martin@2345
   572
			<jvmarg value="-Dcatalina.home=${env.CATALINA_HOME}" />
ivan@2489
   573
			<jvmarg value="-Djava.io.tmpdir=${env.CATALINA_BASE}/temp" />
martin@2471
   574
			<arg line="start" />
martin@2345
   575
		</java>
martin@2345
   576
	</target>
martin@2345
   577
martin@2345
   578
	<!-- 
martin@2345
   579
		This task is called from the Openbravo ui, it spawns a java call which again
martin@2345
   580
		calls the tomcat.reload.do task as a spawned task.
martin@2345
   581
	-->
martin@2345
   582
	<target name="tomcat.reload" description="Reload the Openbravo context">
martin@2549
   583
		<java classname="org.openbravo.service.system.ReloadContext" jvm="${env.JAVA_HOME}/bin/java" maxmemory="${build.maxmemory}" spawn="true" fork="true">
martin@2345
   584
			<arg line="${base.src}" />
martin@2345
   585
			<classpath refid="project.class.path" />
martin@2345
   586
		</java>
martin@2345
   587
	</target>
martin@2345
   588
martin@2345
   589
	<target name="tomcat.reload.do">
martin@2345
   590
		<taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask">
martin@2345
   591
			<classpath refid="project.class.path" />
martin@2345
   592
		</taskdef>
martin@2345
   593
		<reload url="${tomcat.manager.url}" username="${tomcat.manager.username}" password="${tomcat.manager.password}" path="/${context.name}"/>
martin@2345
   594
	</target>
asier@1977
   595
	
asier@1929
   596
	<target name="tomcat.list">
martin@2345
   597
		<taskdef name="list" classname="org.apache.catalina.ant.ListTask">
martin@2345
   598
			<classpath refid="project.class.path" />
asier@1929
   599
		</taskdef>
martin@2345
   600
		<list url="${tomcat.manager.url}" username="${tomcat.manager.username}" password="${tomcat.manager.password}" />
asier@1929
   601
	</target>
adrian@171
   602
martin@2345
   603
	<target name="deploy.context">
martin@2345
   604
		<taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask">
martin@2345
   605
			<classpath refid="project.class.path" />
martin@2345
   606
		</taskdef>
martin@2345
   607
		<taskdef name="deploy.tomcat" classname="org.apache.catalina.ant.DeployTask">
martin@2345
   608
			<classpath refid="project.class.path" />
martin@2345
   609
		</taskdef>
martin@2345
   610
		<taskdef name="start" classname="org.apache.catalina.ant.StartTask">
martin@2345
   611
			<classpath refid="project.class.path" />
martin@2345
   612
		</taskdef>
martin@2345
   613
martin@2345
   614
		<undeploy url="${tomcat.manager.url}" username="${tomcat.manager.username}" password="${tomcat.manager.password}" path="/${context.name}" failonerror="false" />
martin@2345
   615
		<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@2345
   616
		<start url="${tomcat.manager.url}" username="${tomcat.manager.username}" password="${tomcat.manager.password}" path="/${context.name}" />
martin@2345
   617
	</target>
martin@2345
   618
martin@2345
   619
	<target name="generate-wsdd">
martin@2345
   620
		<ant dir="${base.src}" target="generate-wsdd" inheritAll="true" inheritRefs="true" />
martin@2345
   621
	</target>
martin@2345
   622
martin@2345
   623
	<target name="obx.export.database" if="obx.exp.DB">
martin@2345
   624
		<antcall target="export.database" />
martin@2345
   625
	</target>
martin@2345
   626
martin@2345
   627
	<target name="obx.export.config.script" if="obx.exp.CS">
martin@2345
   628
		<antcall target="export.config.script" />
martin@2345
   629
	</target>
martin@2345
   630
asier@2647
   631
	<target name="package.module">
martin@2345
   632
		<taskdef name="extractModule" classname="org.openbravo.erpCommon.modules.ExtractModuleTask">
martin@2345
   633
			<classpath refid="project.class.path" />
martin@2345
   634
		</taskdef>
martin@2686
   635
		
martin@2686
   636
		<taskdef name="validateModules" classname="org.openbravo.service.system.SystemValidationTask">		
martin@2686
   637
			<classpath refid="project.class.path" />
martin@2686
   638
		</taskdef>
martin@2686
   639
		
martin@2686
   640
		<echo message="Validating Module..." />
martin@2686
   641
		<validateModules moduleName="${module}" failOnError="true" userId="0" propertiesFile="${base.config}/Openbravo.properties" type="module"/>
martin@2686
   642
		
martin@2345
   643
		<antcall target="obx.export.database" />
martin@2345
   644
		<antcall target="obx.export.config.script" />
martin@2345
   645
martin@2345
   646
		<extractModule moduleName="${module}" userId="0" propertiesFile="${base.config}/Openbravo.properties" exportRD="${obx.export.RD}" />
martin@2345
   647
	</target>
martin@2345
   648
martin@2345
   649
	<target name="diagnostic">
martin@2345
   650
		<ant dir="src-diagnostics" antfile="build-create.xml" target="build" />
martin@2345
   651
		<ant dir="src-diagnostics" target="check.all" />
martin@2345
   652
	</target>
martin@2345
   653
asier@2060
   654
	<target name="test">
martin@2345
   655
		<echo message="testing..." />
martin@2345
   656
	</target>
juanpablo@2691
   657
juanpablo@2691
   658
    <target name="setup.check.os">
juanpablo@2691
   659
        <condition property="osname" value="linux">
juanpablo@2691
   660
            <equals arg1="${os.name}" arg2="Linux" />
juanpablo@2691
   661
        </condition>
juanpablo@2691
   662
        <condition property="osname" value="freebsd">
juanpablo@2691
   663
            <equals arg1="${os.name}" arg2="FreeBSD" />
juanpablo@2691
   664
        </condition>
juanpablo@2691
   665
        <condition property="osname" value="windows">
juanpablo@2691
   666
            <contains string="${os.name}" substring="Windows" />
juanpablo@2691
   667
        </condition>
juanpablo@2691
   668
        <condition property="osname" value="osx">
juanpablo@2691
   669
            <contains string="${os.name}" substring="OS X" />
juanpablo@2691
   670
        </condition>
juanpablo@2691
   671
        <condition property="os.is.solaris">
juanpablo@2691
   672
            <or>
juanpablo@2691
   673
                <contains string="${os.name}" substring="Solaris" />
juanpablo@2691
   674
                <contains string="${os.name}" substring="SunOS" />
juanpablo@2691
   675
            </or>
juanpablo@2691
   676
        </condition>
juanpablo@2691
   677
        <condition property="osname" value="openbsd">
juanpablo@2691
   678
            <equals arg1="${os.name}" arg2="OpenBSD" />
juanpablo@2691
   679
        </condition>
juanpablo@2691
   680
        <condition property="osname" value="aix">
juanpablo@2691
   681
            <equals arg1="${os.name}" arg2="AIX" />
juanpablo@2691
   682
        </condition>
juanpablo@2691
   683
        <condition property="osname" value="hpux">
juanpablo@2691
   684
            <equals arg1="${os.name}" arg2="HPUX" />
juanpablo@2691
   685
        </condition>
juanpablo@2691
   686
    </target>
juanpablo@2691
   687
juanpablo@2691
   688
    <target name="setup.check.arch">
juanpablo@2691
   689
        <condition property="osarch" value="">
juanpablo@2691
   690
            <or>
juanpablo@2691
   691
                <equals arg1="${os.arch}" arg2="x86" />
juanpablo@2691
   692
                <equals arg1="${os.arch}" arg2="i386" />
juanpablo@2691
   693
            </or>
juanpablo@2691
   694
        </condition>
juanpablo@2691
   695
        <condition property="osarch" value="-x64">
juanpablo@2691
   696
            <or>
juanpablo@2691
   697
                <equals arg1="${os.arch}" arg2="amd64" />
juanpablo@2691
   698
                <equals arg1="${os.arch}" arg2="x86_64" />
juanpablo@2691
   699
            </or>
juanpablo@2691
   700
        </condition>
juanpablo@2691
   701
        <condition property="osarch" value="-ia64">
juanpablo@2691
   702
            <equals arg1="${os.arch}" arg2="ia64" />
juanpablo@2691
   703
        </condition>
juanpablo@2812
   704
        <condition property="osarch" value="-sparc">
juanpablo@2691
   705
            <equals arg1="${os.arch}" arg2="sparc" />
juanpablo@2691
   706
        </condition>
juanpablo@2812
   707
        <condition property="osarch" value="-ppc">
juanpablo@2691
   708
            <equals arg1="${os.arch}" arg2="ppc" />
juanpablo@2691
   709
        </condition>
juanpablo@2691
   710
    </target>
juanpablo@2691
   711
juanpablo@2691
   712
    <target name="setup.exists.test">
juanpablo@2691
   713
        <condition property="bin.ext" value="exe" else="bin">
juanpablo@2691
   714
            <os family="windows"/>
juanpablo@2691
   715
        </condition>
juanpablo@2691
   716
juanpablo@2691
   717
        <available file="config/setup-properties-${osname}${osarch}.${bin.ext}" property="setup.exists" value="true" />
juanpablo@2691
   718
    </target>
juanpablo@2691
   719
juanpablo@2691
   720
    <target name="setup" depends="setup.check.os, setup.check.arch, setup.exists.test" unless="setup.exists">
juanpablo@2691
   721
        <get src="https://dev.openbravo.com/svn/packaging/setup/output/setup-properties-${osname}${osarch}.${bin.ext}" dest="config/setup-properties-${osname}${osarch}.${bin.ext}" verbose="true" />
juanpablo@2706
   722
juanpablo@2706
   723
        <chmod file="config/setup-properties-${osname}${osarch}.${bin.ext}" perm="+x"/>
juanpablo@2691
   724
    </target>
juanpablo@2691
   725
asier@43
   726
</project>