build.xml
author Martin Taal <martin.taal@openbravo.com>
Wed, 24 Dec 2008 16:46:52 +0000
changeset 2471 5536b6b77a08
parent 2432 d9081ec855ca
child 2489 70f09fc81079
permissions -rw-r--r--
Solved an issue whereby CATALINA_OPTS with multiple arguments resulted in a non-working tomcate.restart.do task. Use jvmarg line="..." in the java task instead of jvmarg value=".."
asier@43
     1
<?xml version="1.0" encoding="UTF-8" ?>
asier@43
     2
<!--
juanpablo@1548
     3
*************************************************************************
juanpablo@1548
     4
* The contents of this file are subject to the Openbravo  Public  License
juanpablo@1548
     5
* Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
juanpablo@1548
     6
* Version 1.1  with a permitted attribution clause; you may not  use this
juanpablo@1548
     7
* file except in compliance with the License. You  may  obtain  a copy of
juanpablo@1548
     8
* the License at http://www.openbravo.com/legal/license.html
juanpablo@1548
     9
* Software distributed under the License  is  distributed  on  an "AS IS"
juanpablo@1548
    10
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
juanpablo@1548
    11
* License for the specific  language  governing  rights  and  limitations
juanpablo@1548
    12
* under the License.
juanpablo@1548
    13
* The Original Code is Openbravo ERP.
juanpablo@1548
    14
* The Initial Developer of the Original Code is Openbravo SL
juanpablo@1548
    15
* All portions are Copyright (C) 2001-2008 Openbravo SL
juanpablo@1548
    16
* All Rights Reserved.
juanpablo@1548
    17
* Contributor(s):  ______________________________________.
juanpablo@1548
    18
************************************************************************
asier@43
    19
-->
juanpablo@213
    20
<!--
juanpablo@213
    21
List of targets:
juanpablo@213
    22
juanpablo@213
    23
init: checks if exists the JAVA_HOME var.
juanpablo@213
    24
compile.complete: refer to compile.complete target of src.
juanpablo@213
    25
compile: refer to compile target of src.
juanpablo@213
    26
compile.complete.development: refer to compile.complete.development target of src.
juanpablo@213
    27
compile.development: refer to compile.development target of src.
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
export.database.sampledata: refer to export.database.sampledata target of database.
juanpablo@213
    65
import.database.sampledata: refer to import.database.sampledata target of database.
antonio@451
    66
export.database.masterdata: refer to export.database.masterdata target of database.
antonio@451
    67
import.database.masterdata: refer to import.database.masterdata target of database.
juanpablo@213
    68
save.database.model: refer to save.database.model target of database.
juanpablo@213
    69
compare.database.structure: refer to compare.database.structure target of database.
fernando@202
    70
-->
asier@43
    71
<project name="openbravo" default="compile.complete" basedir=".">
martin@2345
    72
	<property environment="env" />
martin@2345
    73
	<property name="base.config" location="config" />
martin@2345
    74
	<property file="${base.config}/Openbravo.properties" />
juanpablo@131
    75
martin@2432
    76
	<property name="base.config" location="config" />
martin@2345
    77
	<property name="base.src" location="src" />
martin@2345
    78
	<property name="base.src.core" location="src-core" />
martin@2345
    79
	<property name="base.src.db" location="src-db" />
martin@2345
    80
	<property name="base.src.trl" location="src-trl" />
martin@2345
    81
	<property name="base.src.wad" location="src-wad" />
martin@2345
    82
	<property name="base.src.gen" location="src-gen" />
martin@2345
    83
	<property name="base.client.src" location="srcClient" />
martin@2345
    84
	<property name="base.db" location="src-db/database" />
martin@2345
    85
	<property name="base.web" location="web" />
martin@2345
    86
	<property name="base.context" location="WebContent" />
martin@2345
    87
	<property name="base.design" location="${base.context}/src-loc" />
martin@2345
    88
	<property name="base.lib" location="lib" />
martin@2345
    89
	<property name="base.modules" location="modules" />
martin@2345
    90
	<property name="build" location="build/classes" />
martin@2345
    91
	<property name="build.AD" location="srcAD" />
martin@2345
    92
	<property name="build.sqlc" location="build/javasqlc" />
martin@2345
    93
	<property name="build.core.lib" location="src-core/lib" />
martin@2345
    94
	<property name="build.trl.lib" location="src-trl/lib" />
martin@2345
    95
	<property name="build.wad.lib" location="src-wad/lib" />
martin@2345
    96
	<property name="build.docs" location="docs/api" />
martin@2345
    97
	<property name="jakarta.home" location="${env.CATALINA_HOME}" />
martin@2345
    98
	<property name="module" value="%" />
martin@2345
    99
	<property name="apply.on.create" value="false" />
martin@2345
   100
	<property name="obx.export.RD" value="false" />
martin@2345
   101
	<property name="obx.export.DB" value="false" />
martin@2345
   102
	<property name="obx.export.CS" value="false" />
martin@2345
   103
	<property name="chekPerms" value="false" />
asier@2057
   104
martin@2345
   105
	<available file=".svn/entries" property="is.svn" />
martin@2345
   106
martin@2345
   107
asier@1977
   108
	<condition property="mode.war">
martin@2345
   109
		<equals arg1="war" arg2="${deploy.mode}" />
asier@1977
   110
	</condition>
martin@2345
   111
martin@2345
   112
	<condition property="mode.class">
martin@2345
   113
		<equals arg1="class" arg2="${deploy.mode}" />
martin@2345
   114
	</condition>
martin@2345
   115
asier@1929
   116
	<condition property="apply.modules.on.create">
asier@1929
   117
		<or>
martin@2345
   118
			<equals arg1="yes" arg2="${apply.on.create}" />
martin@2345
   119
			<equals arg1="true" arg2="${apply.on.create}" />
asier@1929
   120
		</or>
asier@1929
   121
	</condition>
martin@2345
   122
asier@1929
   123
	<condition property="obx.exp.DB">
asier@1929
   124
		<or>
martin@2345
   125
			<equals arg1="yes" arg2="${obx.export.DB}" />
martin@2345
   126
			<equals arg1="true" arg2="${obx.export.DB}" />
asier@1929
   127
		</or>
asier@1929
   128
	</condition>
martin@2345
   129
asier@1929
   130
	<condition property="obx.exp.CS">
asier@1929
   131
		<or>
martin@2345
   132
			<equals arg1="yes" arg2="${obx.export.CS}" />
martin@2345
   133
			<equals arg1="true" arg2="${obx.export.CS}" />
asier@1929
   134
		</or>
asier@1929
   135
	</condition>
asier@43
   136
martin@2345
   137
	<condition property="jakarta.base" value="${env.CATALINA_BASE}" else="${jakarta.home}">
martin@2345
   138
		<and>
martin@2345
   139
			<isset property="env.CATALINA_BASE" />
martin@2345
   140
		</and>
martin@2345
   141
	</condition>
martin@2345
   142
	<property name="log.path" location="${jakarta.base}/logs" />
martin@2345
   143
	<property name="lib" location="${jakarta.home}/common" />
martin@2345
   144
	<property name="jakarta.context" location="${jakarta.base}/webapps/${context.name}" />
martin@2345
   145
	<property name="build.maxmemory" value="512M" />
stefan@124
   146
martin@2345
   147
	<condition property="no.java.home" value="true">
martin@2345
   148
		<not>
martin@2345
   149
			<isset property="env.JAVA_HOME" />
martin@2345
   150
		</not>
martin@2345
   151
	</condition>
juanpablo@1548
   152
martin@2345
   153
martin@2345
   154
	<path id="project.class.path">
martin@2345
   155
		<pathelement path="${build}" />
martin@2345
   156
		<pathelement path="${base.src}" />
martin@2345
   157
		<fileset dir="${base.lib}">
martin@2345
   158
			<include name="**/*.jar" />
martin@2345
   159
		</fileset>
martin@2345
   160
		<fileset dir="${build.core.lib}">
martin@2345
   161
			<include name="openbravo-core.jar" />
martin@2345
   162
		</fileset>
martin@2345
   163
		<fileset dir="${build.trl.lib}">
martin@2345
   164
			<include name="openbravo-trl.jar" />
martin@2345
   165
		</fileset>
martin@2345
   166
		<fileset dir="${build.wad.lib}">
martin@2345
   167
			<include name="openbravo-wad.jar" />
martin@2345
   168
		</fileset>
martin@2345
   169
		<fileset dir="${base.lib}">
martin@2345
   170
			<include name="**/*.jar" />
martin@2345
   171
		</fileset>
martin@2345
   172
		<fileset dir="${base.db}/lib/">
martin@2345
   173
			<include name="**/*.jar" />
martin@2345
   174
		</fileset>
martin@2345
   175
		<fileset dir="${base.modules}">
martin@2345
   176
			<include name="*/lib/**" />
martin@2345
   177
		</fileset>
martin@2345
   178
	</path>
martin@2345
   179
martin@2345
   180
	<taskdef resource="axis-tasks.properties" classpathref="project.class.path" />
martin@2345
   181
martin@2345
   182
	<target name="init">
martin@2345
   183
		<fail if="no.java.home" message="The environment variable JAVA_HOME is not set." />
martin@2345
   184
	</target>
stefan@124
   185
asier@2057
   186
	<target name="code.rev" depends="set.code.rev">
martin@2345
   187
		<condition property="code.revision" value="${svn.entries}" else="0">
martin@2345
   188
			<isset property="svn.entries" />
martin@2345
   189
		</condition>
asier@2057
   190
	</target>
ivan@812
   191
martin@2345
   192
	<target name="set.code.rev" if="is.svn">
martin@2345
   193
		<loadfile property="svn.entries" srcFile=".svn/entries" failonerror="false">
martin@2345
   194
			<filterchain>
martin@2345
   195
				<filterreader classname="org.apache.tools.ant.filters.HeadFilter">
martin@2345
   196
					<param name="skip" value="3" />
martin@2345
   197
					<param name="lines" value="1" />
martin@2345
   198
				</filterreader>
martin@2345
   199
			</filterchain>
martin@2345
   200
			<filterchain>
martin@2345
   201
				<filterreader classname="org.apache.tools.ant.filters.StripLineBreaks" />
martin@2345
   202
			</filterchain>
martin@2345
   203
		</loadfile>
martin@2345
   204
	</target>
asier@43
   205
martin@2345
   206
	<target name="compile.complete" depends="init">
martin@2345
   207
		<ant dir="${base.src}" target="compile.complete" inheritAll="true" inheritRefs="true" />
martin@2345
   208
	</target>
martin@2345
   209
martin@2345
   210
	<target name="compile" depends="init">
martin@2345
   211
		<ant dir="${base.src}" target="compile" inheritAll="true" inheritRefs="true" />
martin@2345
   212
	</target>
martin@2345
   213
asier@1977
   214
	<target name="compile.complete.deploy">
martin@2345
   215
		<antcall target="compile.complete.development" />
martin@2345
   216
		<antcall target="compile.complete.war" />
asier@1977
   217
	</target>
martin@2345
   218
martin@2345
   219
	<target name="compile.complete.development" depends="init" if="mode.class">
martin@2345
   220
		<ant dir="${base.src}" target="compile.complete.development" inheritAll="true" inheritRefs="true" />
martin@2345
   221
	</target>
martin@2345
   222
asier@1977
   223
	<target name="compile.complete.war" depends="init" if="mode.war">
martin@2345
   224
		<antcall target="compile.complete" />
martin@2345
   225
		<antcall target="war" />
asier@1977
   226
	</target>
asier@43
   227
asier@1977
   228
	<target name="compile.deploy">
martin@2345
   229
		<antcall target="compile.war" />
martin@2345
   230
		<antcall target="compile.development" />
asier@1977
   231
	</target>
asier@43
   232
martin@2345
   233
	<target name="compile.development" depends="init" if="mode.class">
martin@2345
   234
		<ant dir="${base.src}" target="compile.development" inheritAll="true" inheritRefs="true" />
martin@2345
   235
	</target>
asier@1929
   236
martin@2345
   237
	<target name="compile.war" if="mode.war">
martin@2345
   238
		<antcall target="compile" />
martin@2345
   239
		<antcall target="war" />
martin@2345
   240
	</target>
asier@1929
   241
martin@2345
   242
	<target name="compile.web" depends="init">
martin@2345
   243
		<ant dir="${base.src}" target="compile.web" inheritAll="true" inheritRefs="true" />
martin@2345
   244
	</target>
asier@43
   245
martin@2345
   246
	<target name="compile.web.development" depends="init">
martin@2345
   247
		<ant dir="${base.src}" target="compile.web.development" inheritAll="true" inheritRefs="true" />
martin@2345
   248
	</target>
ivan@1738
   249
martin@2345
   250
	<target name="eclipse.compile" depends="init">
martin@2345
   251
		<ant dir="${base.src.core}" target="build.jar" inheritAll="true" inheritRefs="true" />
martin@2345
   252
		<ant dir="${base.src.trl}" target="build.jar" inheritAll="true" inheritRefs="true" />
martin@2345
   253
		<ant dir="${base.src.wad}" target="build.jar" inheritAll="true" inheritRefs="true" />
martin@2345
   254
		<ant dir="${base.src}" target="eclipse.compile" inheritAll="true" inheritRefs="true" />
martin@2345
   255
		<eclipse.refreshLocal resource="openbravo" depth="infinite" />
martin@2345
   256
		<eclipse.incrementalBuild project="openbravo" kind="incremental" />
martin@2345
   257
	</target>
asier@43
   258
martin@2345
   259
	<target name="eclipse.compile.complete" depends="init">
martin@2345
   260
		<ant dir="${base.src.core}" target="build.jar" inheritAll="true" inheritRefs="true" />
martin@2345
   261
		<ant dir="${base.src.trl}" target="build.jar" inheritAll="true" inheritRefs="true" />
martin@2345
   262
		<ant dir="${base.src.wad}" target="build.jar" inheritAll="true" inheritRefs="true" />
martin@2345
   263
		<ant dir="${base.src}" target="eclipse.compile.complete" inheritAll="true" inheritRefs="true" />
martin@2345
   264
		<eclipse.refreshLocal resource="openbravo" depth="infinite" />
martin@2345
   265
		<eclipse.incrementalBuild project="openbravo" kind="full" />
martin@2345
   266
	</target>
martin@2245
   267
martin@2345
   268
	<target name="compile.src.gen" depends="init">
martin@2345
   269
		<ant dir="${base.src}" target="compile.src.gen" inheritAll="true" inheritRefs="true" />
martin@2345
   270
	</target>
martin@2284
   271
martin@2345
   272
	<target name="generate.entities">
martin@2345
   273
		<ant dir="${base.src}" target="generate.entities" inheritAll="true" inheritRefs="true" />
martin@2345
   274
	</target>
asier@43
   275
asier@2348
   276
	<target name="export.sample.data" depends="code.rev">
martin@2345
   277
		<ant dir="${base.src}" target="export.sample.data" inheritAll="true" inheritRefs="true" />
martin@2345
   278
	</target>
asier@43
   279
martin@2345
   280
	<target name="import.sample.data">
martin@2345
   281
		<ant dir="${base.src}" target="import.sample.data" inheritAll="true" inheritRefs="true" />
martin@2345
   282
	</target>
juanpablo@131
   283
martin@2345
   284
	<target name="compile.src" depends="init">
martin@2345
   285
		<ant dir="${base.src}" target="compile.src" inheritAll="true" inheritRefs="true" />
martin@2345
   286
	</target>
juanpablo@131
   287
martin@2345
   288
	<target name="war" depends="init">
martin@2345
   289
		<ant dir="${base.src}" target="build.war" inheritAll="true" inheritRefs="true" />
martin@2345
   290
	</target>
juanpablo@131
   291
martin@2345
   292
	<target name="core.docs" depends="init">
martin@2345
   293
		<ant dir="${base.src.core}" target="doc" inheritAll="true" inheritRefs="true" />
martin@2345
   294
	</target>
juanpablo@131
   295
martin@2345
   296
	<target name="core.lib" depends="init">
martin@2345
   297
		<ant dir="${base.src.core}" target="build" inheritAll="true" inheritRefs="true" />
martin@2345
   298
		<copy file="${base.src.core}/lib/openbravo-core.jar" todir="${base.lib}/runtime" overwrite="true" failonerror="false" />
martin@2345
   299
	</target>
juanpablo@131
   300
martin@2345
   301
	<target name="eclipse.wad.lib" depends="init">
martin@2345
   302
		<ant dir="${base.src.wad}" target="sqlc" inheritAll="true" inheritRefs="true" />
martin@2345
   303
		<eclipse.refreshLocal resource="OpenbravoWAD" depth="infinite" />
martin@2345
   304
		<eclipse.incrementalBuild project="OpenbravoWAD" kind="full" />
martin@2345
   305
	</target>
juanpablo@131
   306
martin@2345
   307
	<target name="wad.docs" depends="init">
martin@2345
   308
		<ant dir="${base.src.wad}" target="doc" inheritAll="true" inheritRefs="true" />
martin@2345
   309
	</target>
juanpablo@131
   310
martin@2345
   311
	<target name="wad.lib" depends="init">
martin@2345
   312
		<ant dir="${base.src.wad}" target="build" inheritAll="true" inheritRefs="true" />
martin@2345
   313
	</target>
juanpablo@131
   314
martin@2345
   315
	<target name="eclipse.trl.lib" depends="init">
martin@2345
   316
		<ant dir="${base.src.trl}" target="sqlc" inheritAll="true" inheritRefs="true" />
martin@2345
   317
		<eclipse.refreshLocal resource="OpenbravoTrl" depth="infinite" />
martin@2345
   318
		<eclipse.incrementalBuild project="OpenbravoTrl" kind="full" />
martin@2345
   319
	</target>
asier@43
   320
martin@2345
   321
	<target name="trl.docs" depends="init">
martin@2345
   322
		<ant dir="${base.src.trl}" target="doc" inheritAll="true" inheritRefs="true" />
martin@2345
   323
	</target>
juanpablo@179
   324
martin@2345
   325
	<target name="trl.lib" depends="init">
martin@2345
   326
		<ant dir="${base.src.trl}" target="build" inheritAll="true" inheritRefs="true" />
martin@2345
   327
	</target>
juanpablo@179
   328
martin@2345
   329
	<target name="database.lib" depends="init">
martin@2345
   330
		<ant dir="${base.src.db}" target="jar" inheritAll="true" inheritRefs="true" />
martin@2345
   331
		<copy file="${base.src.db}/build/lib/dbmanager.jar" todir="${base.db}/lib" overwrite="true" failonerror="false" />
martin@2345
   332
	</target>
juanpablo@179
   333
martin@2345
   334
	<target name="clean" depends="init">
martin@2345
   335
		<ant dir="${base.src}" target="clean" inheritAll="true" inheritRefs="true" />
martin@2345
   336
	</target>
asier@43
   337
martin@2345
   338
	<target name="trl.clean" depends="init">
martin@2345
   339
		<ant dir="${base.src}" target="trl.clean" inheritAll="true" inheritRefs="true" />
martin@2345
   340
	</target>
asier@43
   341
martin@2345
   342
	<target name="translate" depends="init">
martin@2345
   343
		<ant dir="${base.src}" target="translate" inheritAll="true" inheritRefs="true" />
martin@2345
   344
	</target>
asier@2363
   345
	
asier@2363
   346
	 <target name="translate.modules" depends="init">
asier@2363
   347
	    <ant dir="${base.src}" target="translate.modules" inheritAll="true" inheritRefs="true" />
asier@2363
   348
	  </target>
martin@2345
   349
martin@2345
   350
	<target name="installWebService" depends="init">
martin@2345
   351
		<ant dir="${base.src}" target="installWebService" inheritAll="true" inheritRefs="true">
martin@2345
   352
			<property name="wsdd" value="1" />
martin@2345
   353
		</ant>
martin@2345
   354
	</target>
martin@2345
   355
martin@2345
   356
	<target name="uninstallWebService" depends="init">
martin@2345
   357
		<ant dir="${base.src}" target="uninstallWebService" inheritAll="true" inheritRefs="true" />
martin@2345
   358
	</target>
martin@2345
   359
martin@2345
   360
	<target name="install.source" depends="init,code.rev">
martin@2345
   361
		<antcall target="database.lib" />
martin@2345
   362
		<ant dir="${base.db}" antfile="build-create.xml" target="create.database" inheritAll="true" inheritRefs="true" />
martin@2345
   363
		<antcall target="core.lib" />
martin@2345
   364
		<antcall target="wad.lib" />
martin@2345
   365
		<antcall target="trl.lib" />
martin@2345
   366
		<antcall target="compile.complete.deploy" />
martin@2345
   367
		<echo message="applying modules" />
martin@2345
   368
		<taskdef name="applyModule" classname="org.openbravo.erpCommon.modules.ApplyModuleTask">
martin@2345
   369
			<classpath refid="project.class.path" />
martin@2345
   370
		</taskdef>
martin@2345
   371
		<applyModule userId="0" propertiesFile="${base.config}/Openbravo.properties" />
martin@2345
   372
		<!-- 
martin@2284
   373
    	this antcall implements the previous method of importing data 
martin@2284
   374
    	use that if the new method does not work for you: 
martin@2284
   375
    -->
martin@2345
   376
		<!--<antcall target="import.database.sampledata"/>-->
martin@2345
   377
		<antcall target="import.sample.data" />
martin@2345
   378
	</target>
juanpablo@131
   379
martin@2345
   380
	<target name="eclipse.install.source" depends="init,code.rev">
martin@2345
   381
		<antcall target="database.lib" />
martin@2345
   382
		<ant dir="${base.db}" antfile="build-create.xml" target="create.database" inheritAll="true" inheritRefs="true" />
martin@2345
   383
		<eclipse.incrementalBuild project="OpenbravoCore" kind="full" />
martin@2345
   384
		<antcall target="eclipse.wad.lib" />
martin@2345
   385
		<antcall target="eclipse.trl.lib" />
martin@2345
   386
		<antcall target="eclipse.compile.complete" />
martin@2345
   387
		<echo message="applying modules" />
martin@2345
   388
		<taskdef name="applyModule" classname="org.openbravo.erpCommon.modules.ApplyModuleTask">
martin@2345
   389
			<classpath refid="project.class.path" />
martin@2345
   390
		</taskdef>
martin@2345
   391
		<applyModule userId="0" propertiesFile="${base.config}/Openbravo.properties" />
asier@2351
   392
		<antcall target="import.sample.data" />
martin@2345
   393
	</target>
asier@43
   394
martin@2345
   395
	<target name="create.database" depends="init,code.rev">
martin@2345
   396
		<antcall target="database.lib" />
martin@2345
   397
		<ant dir="${base.db}" antfile="build-create.xml" target="create.database" inheritAll="true" inheritRefs="true" />
martin@2345
   398
		<antcall target="db.apply.modules.sampledata" />
martin@2345
   399
	</target>
antonio@1335
   400
martin@2345
   401
	<target name="update.database" depends="init,code.rev">
martin@2345
   402
		<antcall target="database.lib" />
martin@2345
   403
		<ant dir="${base.db}" target="update.database" inheritAll="true" inheritRefs="true" />
martin@2345
   404
		<antcall target="db.apply.modules" />
martin@2345
   405
	</target>
asier@1929
   406
martin@2345
   407
	<target name="update.database.mod" depends="init,code.rev">
martin@2345
   408
		<antcall target="database.lib" />
martin@2345
   409
		<ant dir="${base.db}" target="update.database.mod" inheritAll="true" inheritRefs="true" />
martin@2345
   410
		<antcall target="db.apply.modules" />
martin@2345
   411
	</target>
asier@43
   412
martin@2345
   413
	<target name="update.customized.database" depends="init,code.rev">
martin@2345
   414
		<antcall target="database.lib" />
martin@2345
   415
		<ant dir="${base.db}" target="update.customized.database" inheritAll="true" inheritRefs="true" />
martin@2345
   416
	</target>
antonio@1335
   417
martin@2345
   418
	<target name="create.database.structure" depends="init">
martin@2345
   419
		<ant dir="${base.db}" target="create.database.structure" inheritAll="true" inheritRefs="true" />
martin@2345
   420
	</target>
asier@43
   421
martin@2345
   422
	<target name="update.database.structure" depends="init">
martin@2345
   423
		<ant dir="${base.db}" target="update.database.structure" inheritAll="true" inheritRefs="true" />
martin@2345
   424
	</target>
asier@43
   425
martin@2345
   426
	<target name="create.database.script" depends="init">
martin@2345
   427
		<ant dir="${base.db}" target="create.database.script" inheritAll="true" inheritRefs="true" />
martin@2345
   428
	</target>
asier@43
   429
martin@2345
   430
	<target name="update.database.script" depends="init">
martin@2345
   431
		<ant dir="${base.db}" target="update.database.script" inheritAll="true" inheritRefs="true" />
martin@2345
   432
	</target>
adrian@97
   433
martin@2345
   434
	<target name="export.database" depends="init,code.rev">
martin@2345
   435
		<antcall target="database.lib" />
martin@2345
   436
		<ant dir="${base.db}" target="export.database.structure" inheritAll="true" inheritRefs="true" />
martin@2345
   437
		<ant dir="${base.db}" target="export.database.data" inheritAll="true" inheritRefs="true" />
martin@2345
   438
	</target>
adrian@164
   439
martin@2345
   440
	<target name="export.database.structure" depends="init,code.rev">
martin@2345
   441
		<ant dir="${base.db}" target="export.database.structure" inheritAll="true" inheritRefs="true" />
martin@2345
   442
	</target>
asier@43
   443
martin@2345
   444
	<target name="export.config.script" depends="init,code.rev">
martin@2345
   445
		<ant dir="${base.db}" target="export.config.script" inheritAll="true" inheritRefs="true" />
martin@2345
   446
	</target>
asier@1929
   447
martin@2345
   448
	<target name="export.database.data" depends="init,code.rev">
martin@2345
   449
		<ant dir="${base.db}" target="export.database.data" inheritAll="true" inheritRefs="true" />
martin@2345
   450
	</target>
asier@43
   451
martin@2345
   452
	<target name="import.database.data" depends="init,code.rev">
martin@2345
   453
		<ant dir="${base.db}" target="import.database.data" inheritAll="true" inheritRefs="true" />
martin@2345
   454
	</target>
asier@43
   455
martin@2345
   456
	<target name="export.database.sampledata" depends="init,code.rev">
martin@2345
   457
		<ant dir="${base.db}" target="export.database.sampledata" inheritAll="true" inheritRefs="true" />
martin@2345
   458
	</target>
asier@43
   459
martin@2345
   460
	<target name="import.database.sampledata" depends="init,code.rev">
martin@2345
   461
		<!--<ant dir="${base.src}" target="import.reference.data" inheritAll="true" inheritRefs="true"/>-->
martin@2345
   462
		<ant dir="${base.db}" target="import.database.sampledata" inheritAll="true" inheritRefs="true" />
martin@2345
   463
	</target>
juanpablo@131
   464
martin@2345
   465
	<target name="export.database.masterdata" depends="init,code.rev">
martin@2345
   466
		<ant dir="${base.db}" target="export.database.masterdata" inheritAll="true" inheritRefs="true" />
martin@2345
   467
	</target>
antonio@451
   468
martin@2345
   469
	<target name="import.database.masterdata" depends="init,code.rev">
martin@2345
   470
		<ant dir="${base.db}" target="import.database.masterdata" inheritAll="true" inheritRefs="true" />
martin@2345
   471
	</target>
martin@2345
   472
martin@2345
   473
	<target name="db.apply.modules" if="apply.modules.on.create">
martin@2345
   474
		<echo message="applying modules" />
martin@2345
   475
		<taskdef name="applyModule" classname="org.openbravo.erpCommon.modules.ApplyModuleTask">
martin@2345
   476
			<classpath refid="project.class.path" />
martin@2345
   477
		</taskdef>
martin@2345
   478
		<applyModule userId="0" propertiesFile="${base.config}/Openbravo.properties" />
martin@2345
   479
	</target>
martin@2345
   480
martin@2345
   481
	<target name="db.apply.modules.sampledata" if="apply.modules.on.create">
martin@2345
   482
		<echo message="applying modules" />
martin@2345
   483
		<taskdef name="applyModule" classname="org.openbravo.erpCommon.modules.ApplyModuleTask">
martin@2345
   484
			<classpath refid="project.class.path" />
martin@2345
   485
		</taskdef>
martin@2345
   486
		<applyModule userId="0" propertiesFile="${base.config}/Openbravo.properties" />
asier@2351
   487
		<antcall target="import.sample.data" />
martin@2345
   488
	</target>
martin@2345
   489
asier@1929
   490
	<target name="apply.modules">
martin@2345
   491
		<echo>Applying ${module} modules...</echo>
martin@2345
   492
		<taskdef name="applyModule" classname="org.openbravo.erpCommon.modules.ApplyModuleTask">
martin@2345
   493
			<classpath refid="project.class.path" />
martin@2345
   494
		</taskdef>
martin@2345
   495
		<antcall target="update.database.mod" />
martin@2345
   496
		<applyModule userId="0" propertiesFile="${base.config}/Openbravo.properties" reinitializemodel="true" />
martin@2345
   497
		<antcall target="compile.deploy" />
asier@1929
   498
		<!--antcall target="deploy.context"/-->
asier@1929
   499
	</target>
martin@2345
   500
martin@2345
   501
	<!-- 
martin@2345
   502
		apparently this does not overwrite the default catalina_opts, only
martin@2345
   503
		if it is not set will it be set to the value below 
martin@2345
   504
	-->
martin@2345
   505
	<property name="env.CATALINA_OPTS" value="-XX:MaxPermSize=128M" />
martin@2345
   506
martin@2345
   507
	<!-- 
martin@2345
   508
		This task is called from the Openbravo ui, it spawns a java call which again
martin@2345
   509
		calls the restart.tomcat.do task as a spawned task.
martin@2345
   510
	-->
martin@2345
   511
	<target name="tomcat.restart" description="Restart the tomcat server process">
martin@2471
   512
		<java classname="org.openbravo.service.system.RestartTomcat" spawn="true" fork="true" maxmemory="${build.maxmemory}">
martin@2345
   513
			<arg line="${base.src}" />
martin@2345
   514
			<classpath refid="project.class.path" />
martin@2345
   515
		</java>
martin@2345
   516
	</target>
martin@2345
   517
martin@2345
   518
	<!--
martin@2345
   519
		Is called by the org.openbravo.service.system.RestartTomcat class.
martin@2345
   520
	-->
martin@2345
   521
	<target name="tomcat.restart.do" description="Restart the tomcat server process">
martin@2345
   522
		<echo message="Restarting Tomcat at ${env.CATALINA_HOME}" />
martin@2471
   523
		<java classname="org.apache.catalina.startup.Bootstrap" fork="true">
martin@2471
   524
			<classpath path=":${env.CATALINA_HOME}/bin/bootstrap.jar:${env.CATALINA_HOME}/bin/commons-logging-api.jar" />
martin@2345
   525
			<jvmarg value="-Dcatalina.home=${env.CATALINA_HOME}" />
martin@2345
   526
			<arg line="stop" />
martin@2345
   527
		</java>
martin@2471
   528
		<sleep description="Wait to give tomcat time to stop" seconds="10"/>
martin@2471
   529
		<java classname="org.apache.catalina.startup.Bootstrap" failonerror="true" fork="true">
martin@2471
   530
			<classpath path=":${env.CATALINA_HOME}/bin/bootstrap.jar:${env.CATALINA_HOME}/bin/commons-logging-api.jar" />
martin@2471
   531
			<!-- note because CATALINA_OPTS can be multi argument the line attribute has to be used! -->
martin@2471
   532
			<jvmarg line="${env.CATALINA_OPTS}"/>
martin@2345
   533
			<jvmarg value="-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager" />
martin@2345
   534
			<jvmarg value="-Djava.util.logging.config.file=${env.CATALINA_HOME}/conf/logging.properties" />
martin@2345
   535
			<jvmarg value="-Djava.endorsed.dirs=${env.CATALINA_HOME}/endorsed" />
martin@2345
   536
			<jvmarg value="-Dcatalina.base=${env.CATALINA_HOME}" />
martin@2345
   537
			<jvmarg value="-Dcatalina.home=${env.CATALINA_HOME}" />
martin@2345
   538
			<jvmarg value="-Djava.io.tmpdir=${env.CATALINA_HOME}/temp" />
martin@2471
   539
			<arg line="start" />
martin@2345
   540
		</java>
martin@2345
   541
	</target>
martin@2345
   542
martin@2345
   543
	<!-- 
martin@2345
   544
		This task is called from the Openbravo ui, it spawns a java call which again
martin@2345
   545
		calls the tomcat.reload.do task as a spawned task.
martin@2345
   546
	-->
martin@2345
   547
	<target name="tomcat.reload" description="Reload the Openbravo context">
martin@2345
   548
		<echo message="${env.CATALINA_OPTS}"/>
martin@2345
   549
		<java classname="org.openbravo.service.system.ReloadContext" jvm="${env.JAVA_HOME}/bin/java" maxmemory="${build.maxmemory}">
martin@2345
   550
			<arg line="${base.src}" />
martin@2345
   551
			<classpath refid="project.class.path" />
martin@2345
   552
		</java>
martin@2345
   553
	</target>
martin@2345
   554
martin@2345
   555
	<target name="tomcat.reload.do">
martin@2345
   556
		<taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask">
martin@2345
   557
			<classpath refid="project.class.path" />
martin@2345
   558
		</taskdef>
martin@2345
   559
		<reload url="${tomcat.manager.url}" username="${tomcat.manager.username}" password="${tomcat.manager.password}" path="/${context.name}"/>
martin@2345
   560
	</target>
asier@1977
   561
	
asier@1929
   562
	<target name="tomcat.list">
martin@2345
   563
		<taskdef name="list" classname="org.apache.catalina.ant.ListTask">
martin@2345
   564
			<classpath refid="project.class.path" />
asier@1929
   565
		</taskdef>
martin@2345
   566
		<list url="${tomcat.manager.url}" username="${tomcat.manager.username}" password="${tomcat.manager.password}" />
asier@1929
   567
	</target>
adrian@171
   568
martin@2345
   569
	<target name="deploy.context">
martin@2345
   570
		<taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask">
martin@2345
   571
			<classpath refid="project.class.path" />
martin@2345
   572
		</taskdef>
martin@2345
   573
		<taskdef name="deploy.tomcat" classname="org.apache.catalina.ant.DeployTask">
martin@2345
   574
			<classpath refid="project.class.path" />
martin@2345
   575
		</taskdef>
martin@2345
   576
		<taskdef name="start" classname="org.apache.catalina.ant.StartTask">
martin@2345
   577
			<classpath refid="project.class.path" />
martin@2345
   578
		</taskdef>
martin@2345
   579
martin@2345
   580
		<undeploy url="${tomcat.manager.url}" username="${tomcat.manager.username}" password="${tomcat.manager.password}" path="/${context.name}" failonerror="false" />
martin@2345
   581
		<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
   582
		<start url="${tomcat.manager.url}" username="${tomcat.manager.username}" password="${tomcat.manager.password}" path="/${context.name}" />
martin@2345
   583
	</target>
martin@2345
   584
martin@2345
   585
	<target name="generate-wsdd">
martin@2345
   586
		<ant dir="${base.src}" target="generate-wsdd" inheritAll="true" inheritRefs="true" />
martin@2345
   587
	</target>
martin@2345
   588
martin@2345
   589
	<target name="obx.export.database" if="obx.exp.DB">
martin@2345
   590
		<antcall target="export.database" />
martin@2345
   591
	</target>
martin@2345
   592
martin@2345
   593
	<target name="obx.export.config.script" if="obx.exp.CS">
martin@2345
   594
		<antcall target="export.config.script" />
martin@2345
   595
	</target>
martin@2345
   596
martin@2345
   597
	<target name="extract.module">
martin@2345
   598
		<taskdef name="extractModule" classname="org.openbravo.erpCommon.modules.ExtractModuleTask">
martin@2345
   599
			<classpath refid="project.class.path" />
martin@2345
   600
		</taskdef>
martin@2345
   601
martin@2345
   602
		<antcall target="obx.export.database" />
martin@2345
   603
		<antcall target="obx.export.config.script" />
martin@2345
   604
martin@2345
   605
		<extractModule moduleName="${module}" userId="0" propertiesFile="${base.config}/Openbravo.properties" exportRD="${obx.export.RD}" />
martin@2345
   606
	</target>
martin@2345
   607
martin@2345
   608
	<target name="diagnostic">
martin@2345
   609
		<ant dir="src-diagnostics" antfile="build-create.xml" target="build" />
martin@2345
   610
		<ant dir="src-diagnostics" target="check.all" />
martin@2345
   611
	</target>
martin@2345
   612
asier@2060
   613
	<target name="test">
martin@2345
   614
		<echo message="testing..." />
martin@2345
   615
	</target>
asier@43
   616
</project>