src/build.xml
author Asier Lostalé <asier.lostale@openbravo.com>
Fri, 30 Jan 2009 12:09:54 +0000
changeset 2854 941a30f00659
parent 2853 7f843a980871
child 2856 ed8da7fe9687
permissions -rw-r--r--
[quickbuild] update WAD md5 after detecting a new one
carlos@0
     1
<?xml version="1.0" encoding="UTF-8" ?>
carlos@0
     2
<!--
carlos@0
     3
 *************************************************************************
carlos@0
     4
 * The contents of this file are subject to the Openbravo Public License 
carlos@0
     5
 * Version 1.1 (the "License"), being the Mozilla Public License 
carlos@0
     6
 * version 1.1  with a permitted attribution clause ; you may not use 
carlos@0
     7
 * this file except in compliance with the License. 
carlos@0
     8
 * You may obtain a copy of the License at  
carlos@0
     9
 * http://www.openbravo.com/legal/license.txt 
carlos@0
    10
 * Software distributed under the License is distributed on an 
carlos@0
    11
 * "AS IS" basis, WITHOUT WARRANTY OF  ANY KIND, either express or 
carlos@0
    12
 * implied. See the License for the specific language governing rights 
carlos@0
    13
 * and  limitations under the License. 
carlos@0
    14
 * The Original Code is Openbravo ERP. 
carlos@1471
    15
 * The Initial Developer of the Original Code is Openbravo SL 
asier@2826
    16
 * All portions are Copyright (C) 2005-2009 Openbravo SL 
carlos@0
    17
 * All Rights Reserved. 
carlos@0
    18
 * Contributor(s): Openbravo S.L.
carlos@0
    19
 ************************************************************************
carlos@0
    20
-->
juanpablo@213
    21
juanpablo@213
    22
<!--
ivan@1738
    23
List of methods infside:
juanpablo@213
    24
juanpablo@213
    25
init: creates all the folders.
juanpablo@213
    26
trl.clean: clean the AD_TEXTINTERFACES table
juanpablo@213
    27
clean: delete all folders.
juanpablo@213
    28
copy.srcClient: copy the content of the srcClient to the src folder.
juanpablo@213
    29
sqlc: generates the java from the xsql files.
juanpablo@213
    30
compileSqlc: compiles all the java generated from the xsqls.
juanpablo@213
    31
wad: generates all the files from the mda.
juanpablo@213
    32
postwad: copies the generated files to the base design folder.
juanpablo@213
    33
postsrc: copies the src files to the base design folder and the 
juanpablo@213
    34
         xml and jasper files to the translated designs folders
asier@1929
    35
postsrc.modules: it does the same as postsrc but for module files
juanpablo@213
    36
build.local.context: copies all files to the eclipse base context 
juanpablo@213
    37
                     (WebContent...).
juanpablo@213
    38
compile.src: comiles only the src files.
juanpablo@213
    39
eclipse.compile: generates specified wad files and compiles modified xsql files.
juanpablo@213
    40
eclipse.compile.complete: generates all wad files and compiles all xsql files
juanpablo@213
    41
compile: compiles specified WAD window and src and also translates.
juanpablo@213
    42
compile.complete: compiles all WAD windows and src and also translates.
juanpablo@213
    43
translate: Translate the modified files.
juanpablo@213
    44
compile.translate: Translate the specified extensions files.
juanpablo@213
    45
installWebService: install the web services configuration file.
juanpablo@213
    46
uninstallWebService: uninstall the web services configuration file.
juanpablo@213
    47
copy.files: copy the local files to the context.
juanpablo@213
    48
compile.development: like compile, but also copies the files to the context.
juanpablo@213
    49
compile.complete.development: like compile.complete, but also copies the files 
juanpablo@213
    50
                              to the context.
asier@1929
    51
compile.web: re-builds the web folder.
asier@1929
    52
compile.web.development: like compile.web, but also copies the files to the context.
juanpablo@213
    53
build.war: build a war file in the lib directory.
juanpablo@213
    54
-->
juanpablo@213
    55
carlos@0
    56
<project name="openbravo sources" default="compile" basedir=".">
stefan@2143
    57
martin@2346
    58
	<path id="yuicompressor.classpath">
martin@2346
    59
		<fileset dir="../lib/build">
martin@2346
    60
			<include name="**/yuicompressor-2.4.2.jar" />
martin@2346
    61
			<include name="**/YUIAnt.jar" />
martin@2346
    62
		</fileset>
martin@2346
    63
	</path>
martin@2346
    64
	<taskdef name="yuicompress" classname="com.yahoo.platform.yui.compressor.YUICompressTask">
martin@2346
    65
		<classpath refid="yuicompressor.classpath" />
martin@2346
    66
	</taskdef>
stefan@2143
    67
martin@2346
    68
	<condition property="minimizeJSandCSSbool">
martin@2346
    69
		<istrue value="${minimizeJSandCSS}" />
martin@2346
    70
	</condition>
stefan@2143
    71
martin@2346
    72
	<property name="webTab" value="all" />
martin@2346
    73
	<property name="tab" value="%" />
asier@1929
    74
martin@2346
    75
	<property name="base.translate.structure" value="org/openbravo/erpWindows" />
martin@2346
    76
	<property name="client.web.xml" value="${base.client.src}/web.xml" />
martin@2346
    77
	<property name="package" value="" />
martin@2346
    78
	<property name="extension" value="html" />
martin@2346
    79
	<property name="src" value="." />
martin@2346
    80
	<property name="tr" value="yes" />
martin@2346
    81
	<condition property="translation">
martin@2346
    82
		<not>
martin@2346
    83
			<equals arg1="no" arg2="${tr}" />
martin@2346
    84
		</not>
martin@2346
    85
	</condition>
martin@2346
    86
	<target name="init">
martin@2346
    87
		<mkdir dir="${build}" />
martin@2346
    88
		<mkdir dir="${base.design}/design" />
martin@2346
    89
		<mkdir dir="${build.sqlc}" />
martin@2346
    90
		<mkdir dir="${build.sqlc}/src" />
martin@2346
    91
		<mkdir dir="${build.sqlc}/srcAD" />
martin@2346
    92
		<mkdir dir="${build.AD}" />
martin@2346
    93
		<mkdir dir="${build.AD}/org/openbravo/erpWindows" />
martin@2346
    94
		<mkdir dir="${build.AD}/org/openbravo/erpCommon/ad_actionButton" />
martin@2346
    95
		<mkdir dir="${build.AD}/org/openbravo/erpCommon/ad_callouts" />
martin@2346
    96
		<mkdir dir="${build.AD}/org/openbravo/erpCommon/reference" />
martin@2346
    97
		<mkdir dir="${build.docs}" />
martin@2346
    98
	</target>
carlos@0
    99
martin@2686
   100
	<target name="validate.database">
martin@2686
   101
		<taskdef name="validateDatabase" classname="org.openbravo.service.system.SystemValidationTask">		
martin@2686
   102
			<classpath refid="project.class.path" />
martin@2686
   103
		</taskdef>
martin@2686
   104
		<validateDatabase userId="0" propertiesFile="${base.config}/Openbravo.properties" type="database"/>
martin@2686
   105
	</target>
martin@2686
   106
	
martin@2686
   107
	<target name="validate.modules">
martin@2686
   108
		<taskdef name="validateModules" classname="org.openbravo.service.system.SystemValidationTask">		
martin@2686
   109
			<classpath refid="project.class.path" />
martin@2686
   110
		</taskdef>
martin@2686
   111
		<validateModules userId="0" propertiesFile="${base.config}/Openbravo.properties" type="module"/>
martin@2686
   112
	</target>
martin@2686
   113
	
ivan@1738
   114
	<target name="trl.clean" if="translation">
ivan@1738
   115
		<java classname="org.openbravo.translate.Translate" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
ivan@1738
   116
			<arg line="clean ${base.config}/Openbravo.properties" />
ivan@1738
   117
			<classpath refid="project.class.path" />
ivan@1738
   118
		</java>
ivan@1738
   119
	</target>
carlos@0
   120
martin@2346
   121
	<target name="clean" depends="trl.clean">
martin@2346
   122
		<property name="complete" value="true" />
martin@2346
   123
		<delete includeEmptyDirs="true" failonerror="false">
martin@2346
   124
			<fileset dir="${base.design}" />
martin@2346
   125
			<fileset dir="${build}" />
martin@2346
   126
			<fileset dir="${build.docs}" />
martin@2346
   127
			<fileset dir="${build.AD}" />
martin@2346
   128
			<fileset dir="${build.sqlc}" />
martin@2346
   129
			<fileset dir="${base.context}">
martin@2346
   130
				<exclude name=".svn" />
martin@2346
   131
				<exclude name="META-INF/MANIFEST.MF" />
martin@2346
   132
			</fileset>
martin@2346
   133
		</delete>
martin@2346
   134
	</target>
carlos@0
   135
martin@2346
   136
	<target name="sqlc" depends="copy.srcClient">
martin@2346
   137
		<java classname="org.openbravo.data.Sqlc" fork="yes" jvm="${env.JAVA_HOME}/bin/java" maxmemory="${build.maxmemory}">
martin@2346
   138
			<arg line="'${base.config}'/Openbravo.properties .xsql . '${build.sqlc}'/src" />
martin@2346
   139
			<classpath refid="project.class.path" />
martin@2346
   140
		</java>
martin@2346
   141
		<java classname="org.openbravo.data.Sqlc" fork="yes" jvm="${env.JAVA_HOME}/bin/java" maxmemory="${build.maxmemory}">
martin@2346
   142
			<arg line="'${base.config}'/Openbravo.properties .xsql '${base.modules}' '${build.sqlc}'/src */src" />
martin@2346
   143
			<classpath refid="project.class.path" />
martin@2346
   144
		</java>
martin@2346
   145
		<copy file="${base.src}/buildAD.xml" tofile="${build.AD}/build.xml" />
martin@2346
   146
		<copy file="${base.src}/log4j.lcf" tofile="${build.AD}/log4j.lcf" />
martin@2346
   147
		<ant dir="${build.AD}" target="buildAD" inheritAll="true" inheritRefs="true" />
martin@2346
   148
	</target>
martin@2346
   149
martin@2346
   150
	<target name="copy.srcClient">
ivan@1738
   151
		<mkdir dir="${base.client.src}" />
ivan@1738
   152
		<copy todir="${basedir}" overwrite="true" failonerror="false">
ivan@1738
   153
			<fileset dir="${base.client.src}">
ivan@1738
   154
				<exclude name="**/web.xml" />
ivan@1738
   155
			</fileset>
ivan@1738
   156
		</copy>
ivan@1738
   157
	</target>
carlos@0
   158
martin@2346
   159
	<target name="clean.src.gen">
asier@1929
   160
		<delete includeEmptyDirs="true" failonerror="false">
asier@1929
   161
			<fileset dir="${base.src.gen}" />
asier@1929
   162
		</delete>
ivan@1738
   163
	</target>
carlos@0
   164
martin@2284
   165
	<target name="export.sample.data" description="Exports Sample Data">
martin@2284
   166
		<taskdef name="exportsampledata" classname="org.openbravo.service.db.ExportReferenceDataTask">
martin@2346
   167
			<classpath refid="project.class.path" />
martin@2346
   168
		</taskdef>
martin@2346
   169
		<echo message="Exporting sample reference data" />
martin@2346
   170
		<exportsampledata userId="0" propertiesFile="${base.config}/Openbravo.properties" clients="BigBazaar,Accounting Test" />
martin@2346
   171
	</target>
martin@2346
   172
martin@2284
   173
	<target name="import.sample.data" description="Import Sample Data">
martin@2284
   174
		<taskdef name="importsampledata" classname="org.openbravo.service.db.ImportReferenceDataTask">
martin@2346
   175
			<classpath refid="project.class.path" />
martin@2346
   176
		</taskdef>
martin@2346
   177
		<echo message="Importing sample reference data" />
asier@2348
   178
    <importsampledata userId="0" propertiesFile="${base.config}/Openbravo.properties" />
asier@2348
   179
    <ant dir="${base.db}" target="database.postupdate.${bbdd.rdbms}" inheritAll="true" inheritRefs="true"/>
martin@2346
   180
	</target>
asier@1929
   181
martin@2346
   182
	<target name="generate.entities" depends="compile.src.gen,clean.src.gen">
martin@2346
   183
		<taskdef name="workflow" classpathref="project.class.path" classname="org.openbravo.base.gen.GenerateEntitiesTask" />
martin@2346
   184
		<!-- debug="true" will perform the in-memory model initialization before generating entities
asier@1929
   185
	if an error occurs then, then a stacktrace is printed. -->
martin@2830
   186
		<workflow debug="false" srcGenPath="${base.src.gen}" propertiesFile="${base.config}/Openbravo.properties" file="${base.src}/org/openbravo/base/gen/gen_entity.oaw" fork="true" maxmemory="${build.maxmemory}">
martin@2830
   187
			<param name="ob.properties.location" value="${base.config}/Openbravo.properties" />
martin@2830
   188
			<param name="base.src.gen" value="${base.src.gen}" />
martin@2830
   189
			<classpath>
martin@2830
   190
				<path refid="project.class.path" />
martin@2830
   191
			</classpath>
martin@2830
   192
		</workflow>
martin@2843
   193
		<javac srcdir="${base.src.gen}:${base.src}/org/openbravo/base/model:${base.src}/org/openbravo/dal:${base.src}/org/openbravo/base/structure:${base.src}/org/openbravo/service/dataset" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="true" debuglevel="lines,vars,source" deprecation="on">
martin@2830
   194
			<classpath refid="project.class.path" />
martin@2830
   195
		</javac>
martin@2830
   196
	</target>
martin@2830
   197
martin@2830
   198
	<!-- 
martin@2830
   199
		Generates entities only when the application dictionary has changed.
martin@2830
   200
		Difference with the generate.entities is that it does not clean the src-gen directory. The standard
martin@2830
   201
		GenerateEntitiesTask always checks if the AD was changed before regenerating. The check is to compare
martin@2830
   202
		the modified time of the generated sources with the updated time of the Application Dictionary. If there
martin@2830
   203
		is a source older than the last updated time of the Application Dictionary then the sources need to be regenerated.		
martin@2830
   204
	-->
martin@2830
   205
	<target name="generate.entities.quick" depends="compile.src.gen">
martin@2843
   206
martin@2830
   207
		<taskdef name="workflow" classpathref="project.class.path" classname="org.openbravo.base.gen.GenerateEntitiesTask" />
martin@2830
   208
		<!-- debug="true" will perform the in-memory model initialization before generating entities
martin@2830
   209
	if an error occurs then, then a stacktrace is printed. -->
martin@2830
   210
		<workflow debug="false" srcGenPath="${base.src.gen}" propertiesFile="${base.config}/Openbravo.properties" file="${base.src}/org/openbravo/base/gen/gen_entity.oaw" fork="true" maxmemory="${build.maxmemory}">
martin@2346
   211
			<param name="ob.properties.location" value="${base.config}/Openbravo.properties" />
martin@2346
   212
			<param name="base.src.gen" value="${base.src.gen}" />
martin@2346
   213
			<classpath>
martin@2346
   214
				<path refid="project.class.path" />
martin@2346
   215
			</classpath>
martin@2346
   216
		</workflow>
martin@2843
   217
		<javac srcdir="${base.src.gen}:${base.src}/org/openbravo/base/model:${base.src}/org/openbravo/dal:${base.src}/org/openbravo/base/structure:${base.src}/org/openbravo/service/dataset" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="true" debuglevel="lines,vars,source" deprecation="on">
ivan@1738
   218
			<classpath refid="project.class.path" />
ivan@1738
   219
		</javac>
ivan@1738
   220
	</target>
juanpablo@131
   221
martin@2346
   222
	<target name="compileSqlc" depends="sqlc">
martin@2346
   223
		<javac srcdir="${build.sqlc}/src:${basedir}:${build.sqlc}/srcAD/org/openbravo/erpCommon/reference:${base.modules}" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="true" debuglevel="lines,vars,source" deprecation="on">
martin@2346
   224
			<classpath refid="project.class.path" />
martin@2346
   225
		</javac>
martin@2346
   226
		<javac srcdir="${build.sqlc}/srcAD" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="true" debuglevel="lines,vars,source" deprecation="on">
martin@2346
   227
			<classpath refid="project.class.path" />
martin@2346
   228
		</javac>
martin@2346
   229
		<javac srcdir="${build.AD}" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="true" debuglevel="lines,vars,source" deprecation="on">
martin@2346
   230
			<classpath refid="project.class.path" />
martin@2346
   231
		</javac>
martin@2346
   232
	</target>
martin@2346
   233
martin@2346
   234
	<target name="compile.src.gen" depends="init">
martin@2346
   235
		<javac srcdir="${base.src}/org/openbravo/base/exception:${base.src}/org/openbravo/base/gen:${base.src}/org/openbravo/base/expression:${base.src}/org/openbravo/base/provider:${base.src}/org/openbravo/base/model:${base.src}/org/openbravo/base/session::${base.src}/org/openbravo/base/validation:${base.src}/org/openbravo/base/util" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="true" debuglevel="lines,vars,source" deprecation="on">
martin@2346
   236
			<classpath refid="project.class.path" />
martin@2346
   237
		</javac>
martin@2843
   238
		<copy todir="${build}">
martin@2843
   239
			<fileset dir="${basedir}" includes="**/*.hbm.xml" />
martin@2843
   240
		</copy>
martin@2843
   241
		<copy todir="${build}">
martin@2843
   242
			<fileset dir="${basedir}" includes="**/*.properties" />
martin@2843
   243
		</copy>
martin@2346
   244
	</target>
martin@2346
   245
martin@2346
   246
	<target name="wad" depends="init">
martin@2346
   247
		<java classname="org.openbravo.wad.Wad" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
martin@2346
   248
			<arg line="'${base.config}' '${tab}' '${build.AD}/org/openbravo/erpWindows' '${build.AD}/org/openbravo/erpCommon' '${build.sqlc}/src' '${webTab}' '${build.AD}/org/openbravo/erpCommon/ad_actionButton' '${base.design}' '${base.translate.structure}' '${client.web.xml}' '..' '${attach.path}' '${web.url}' '${base.src}' '${complete}' '${module}'" />
martin@2346
   249
			<classpath refid="project.class.path" />
martin@2346
   250
		</java>
martin@2346
   251
		<antcall target="postwad" inheritall="true" inheritrefs="true" />
martin@2346
   252
	</target>
asier@2826
   253
	
asier@2826
   254
	<target name="wad.quick" depends="init">
asier@2853
   255
		
asier@2853
   256
		
asier@2826
   257
		<java classname="org.openbravo.wad.Wad" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
asier@2826
   258
		      <arg line="'${base.config}' '${tab}' '${build.AD}/org/openbravo/erpWindows' '${build.AD}/org/openbravo/erpCommon' '${build.sqlc}/src' '${webTab}' '${build.AD}/org/openbravo/erpCommon/ad_actionButton' '${base.design}' '${base.translate.structure}' '${client.web.xml}' '..' '${attach.path}' '${web.url}' '${base.src}' '${complete}' '${module}' 'quick'" />
asier@2826
   259
		      <classpath refid="project.class.path" />
asier@2826
   260
		    </java>
asier@2826
   261
		    <antcall target="postwad" inheritall="true" inheritrefs="true" />
asier@2826
   262
	</target>
martin@2346
   263
martin@2346
   264
	<target name="postsrc" depends="postsrc.modules">
martin@2346
   265
		<copy todir="${build}">
martin@2346
   266
			<fileset dir="${basedir}" includes="**/*.properties" />
martin@2346
   267
		</copy>
martin@2346
   268
		<copy todir="${build}">
martin@2346
   269
			<fileset dir="${basedir}" includes="**/*.xslt" />
martin@2346
   270
		</copy>
martin@2346
   271
		<copy todir="${build}">
martin@2346
   272
			<fileset dir="${basedir}" includes="**/*.hbm.xml" />
martin@2346
   273
		</copy>
martin@2346
   274
		<copy todir="${base.design}/design">
martin@2346
   275
			<fileset dir="${basedir}" includes="**/*.xml" />
martin@2346
   276
		</copy>
martin@2346
   277
		<copy todir="${base.design}/design">
martin@2346
   278
			<fileset dir="${basedir}" includes="**/*.fo" />
martin@2346
   279
		</copy>
martin@2346
   280
		<copy todir="${base.design}/design">
martin@2346
   281
			<fileset dir="${basedir}" includes="**/*.html" />
martin@2346
   282
		</copy>
martin@2346
   283
		<copy todir="${base.design}/design">
martin@2346
   284
			<fileset dir="${basedir}" includes="**/*.srpt" />
martin@2346
   285
		</copy>
martin@2346
   286
		<copy todir="${base.design}/design">
martin@2346
   287
			<fileset dir="${basedir}" includes="**/*.jrxml" />
martin@2346
   288
		</copy>
martin@2346
   289
		<copy todir="${base.design}/design">
martin@2346
   290
			<fileset dir="${basedir}" includes="**/*.jasper" />
martin@2346
   291
		</copy>
asier@1929
   292
		<copy todir="${build}">
asier@1929
   293
			<fileset file="${base.config}/quartz.properties" />
martin@2346
   294
		</copy>
martin@2346
   295
		<antcall target="build.local.context" inheritAll="true" inheritrefs="true" />
martin@2346
   296
	</target>
asier@1929
   297
martin@2346
   298
	<target name="postsrc.modules">
martin@2346
   299
		<copy todir="${base.design}/design">
martin@2346
   300
			<fileset dir="${base.modules}">
martin@2346
   301
				<include name="*/src/**/*.xml" />
martin@2346
   302
				<include name="*/src/**/*.fo" />
martin@2346
   303
				<include name="*/src/**/*.html" />
martin@2346
   304
				<include name="*/src/**/*.srpt" />
martin@2346
   305
				<include name="*/src/**/*.jrxml" />
martin@2346
   306
				<include name="*/src/**/*.jasper" />
martin@2346
   307
			</fileset>
martin@2346
   308
			<mapper type="regexp" from="(.*\${file.separator}src)(.*)" to="\2" />
martin@2346
   309
		</copy>
martin@2346
   310
	</target>
asier@1929
   311
martin@2346
   312
	<!-- FIXME: These tasks is only for development and testing purposes, remove it afterwards-->
martin@2346
   313
	<target name="sqlcmod" depends="copy.srcClient">
martin@2346
   314
		<java classname="org.openbravo.data.Sqlc" fork="yes" jvm="${env.JAVA_HOME}/bin/java" maxmemory="${build.maxmemory}">
martin@2346
   315
			<arg line="'${base.config}'/Openbravo.properties .xsql '${base.modules}' '${build.sqlc}'/src */src" />
martin@2346
   316
			<classpath refid="project.class.path" />
martin@2346
   317
		</java>
martin@2346
   318
	</target>
asier@1929
   319
martin@2346
   320
	<target name="compileSqlcmod" depends="sqlcmod">
martin@2346
   321
		<javac srcdir="${build.sqlc}/src:${base.modules}" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="true" debuglevel="lines,vars,source" deprecation="on">
martin@2346
   322
			<classpath refid="project.class.path" />
martin@2346
   323
		</javac>
martin@2346
   324
	</target>
martin@2346
   325
	<target name="postsrcmod">
martin@2346
   326
		<copy todir="${base.design}/design">
martin@2346
   327
			<fileset dir="${base.modules}" includes="*/src/**/*.html" />
martin@2346
   328
			<mapper type="regexp" from="(.*\${file.separator}src)(.*)" to="\2" />
martin@2346
   329
		</copy>
martin@2346
   330
	</target>
asier@1929
   331
martin@2346
   332
	<!-- end of auxiliar tasks-->
asier@1929
   333
martin@2346
   334
	<target name="build.local.context">
martin@2346
   335
		<copy todir="${base.context}" encoding="UTF-8">
martin@2346
   336
			<fileset file="${basedir}/index.html" />
martin@2346
   337
		</copy>
martin@2346
   338
		<copy todir="${base.context}/WEB-INF" encoding="UTF-8">
martin@2346
   339
			<fileset file="${build.sqlc}/src/web.xml" />
martin@2346
   340
			<fileset dir="${base.config}">
martin@2643
   341
				<exclude name="**/eclipse/**" />
jaime@2693
   342
                <exclude name="**/setup-properties**" />
martin@2346
   343
				<exclude name="*.template" />
martin@2346
   344
			</fileset>
martin@2346
   345
		</copy>
martin@2346
   346
		<copy todir="${base.context}/WEB-INF" encoding="UTF-8">
martin@2346
   347
			<fileset dir="${base.modules}">
martin@2346
   348
				<include name="*/config/**" />
martin@2346
   349
				<exclude name="*.template" />
martin@2346
   350
			</fileset>
martin@2346
   351
			<mapper type="regexp" from="(.*\${file.separator}config)(.*)" to="\2" />
martin@2346
   352
		</copy>
martin@2346
   353
		<copy todir="${base.context}/WEB-INF/lib" encoding="UTF-8">
martin@2346
   354
			<fileset dir="${base.lib}/runtime">
martin@2346
   355
				<exclude name="openbravo-wad.jar" />
martin@2346
   356
				<exclude name="openbravo-trl.jar" />
martin@2346
   357
				<exclude name="servlet-api.jar" />
martin@2346
   358
				<exclude name="*.war" />
martin@2346
   359
			</fileset>
martin@2346
   360
			<fileset dir="${base.db}/lib">
martin@2346
   361
				<include name="*" />
martin@2346
   362
			</fileset>
martin@2346
   363
		</copy>
asier@1929
   364
martin@2346
   365
		<copy todir="${base.context}/WEB-INF/lib" encoding="UTF-8">
martin@2346
   366
			<fileset dir="${base.modules}">
martin@2346
   367
				<include name="*/lib/runtime/**" />
martin@2346
   368
			</fileset>
martin@2346
   369
			<mapper type="regexp" from="(.*\${file.separator}lib\${file.separator}runtime)(.*)" to="\2" />
martin@2346
   370
		</copy>
martin@2346
   371
		<antcall target="build.web.folder" inheritAll="true" inheritrefs="true" />
martin@2346
   372
	</target>
asier@1929
   373
martin@2346
   374
	<target name="build.web.folder">
martin@2346
   375
		<delete includeEmptyDirs="true" dir="${base.context}/web/skins" quiet="yes" />
martin@2346
   376
		<mkdir dir="${base.context}/web" />
martin@2346
   377
martin@2346
   378
		<copy todir="${base.context}/web" encoding="UTF-8">
martin@2346
   379
			<fileset dir="${base.web}">
martin@2346
   380
				<include name="*/**" />
martin@2346
   381
				<exclude name="skins/**" />
martin@2346
   382
			</fileset>
martin@2346
   383
		</copy>
martin@2346
   384
martin@2346
   385
		<mkdir dir="${base.context}/web/skins" />
martin@2346
   386
		<mkdir dir="${base.context}/web/skins/ltr" />
martin@2346
   387
		<copy todir="${base.context}/web/skins/ltr" encoding="UTF-8">
martin@2346
   388
			<fileset dir="${base.web}/skins" />
martin@2346
   389
		</copy>
martin@2346
   390
		<mkdir dir="${base.context}/web/skins/rtl" />
martin@2346
   391
		<copy todir="${base.context}/web/skins/rtl" encoding="UTF-8">
martin@2346
   392
			<fileset dir="${base.web}/skins" />
martin@2346
   393
		</copy>
martin@2346
   394
martin@2346
   395
		<copy todir="${base.context}/web" encoding="UTF-8">
martin@2346
   396
			<fileset dir="${base.modules}">
martin@2346
   397
				<include name="*/web/*/**" />
martin@2346
   398
				<exclude name="*/web/**/skins/**" />
martin@2346
   399
			</fileset>
martin@2346
   400
			<mapper type="regexp" from="(.*)(\${file.separator}web)(.*)" to="\3" />
martin@2346
   401
		</copy>
martin@2346
   402
martin@2346
   403
		<copy todir="${base.context}/web/skins/ltr" encoding="UTF-8">
martin@2346
   404
			<fileset dir="${base.modules}">
martin@2346
   405
				<include name="*/web/*/**/skins/**" />
martin@2346
   406
			</fileset>
martin@2346
   407
			<mapper type="regexp" from="(.*)(\${file.separator}web)(.*)" to="\3" />
martin@2346
   408
		</copy>
martin@2346
   409
martin@2346
   410
		<copy todir="${base.context}/web/skins/rtl" encoding="UTF-8">
martin@2346
   411
			<fileset dir="${base.modules}">
martin@2346
   412
				<include name="*/web/*/**/skins/**" />
martin@2346
   413
			</fileset>
martin@2346
   414
			<mapper type="regexp" from="(.*)(\${file.separator}web)(.*)" to="\3" />
martin@2346
   415
		</copy>
martin@2346
   416
martin@2346
   417
		<java classname="org.openbravo.translate.RTLSkin" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
martin@2346
   418
			<arg line="${base.context}/web/skins/rtl ${base.context}/web/skins/ltr ${base.web}/skins" />
martin@2346
   419
			<classpath refid="project.class.path" />
martin@2346
   420
		</java>
martin@2346
   421
		<condition property="generateSpritesBool">
martin@2346
   422
			<istrue value="${generateSprites}" />
martin@2346
   423
		</condition>
martin@2346
   424
		<antcall target="generate.sprites" inheritAll="true" inheritrefs="true" />
martin@2346
   425
		<antcall target="minimizeJSandCSS" inheritAll="true" inheritrefs="true" />
martin@2346
   426
	</target>
martin@2346
   427
asier@1929
   428
	<target name="generate.sprites" description="Performs CSS sprite processing" if="generateSpritesBool">
martin@2346
   429
		<property name="skins.location" location="${base.context}/web/skins/" />
martin@2346
   430
		<taskdef name="smartsprites" classname="org.carrot2.labs.smartsprites.ant.SmartSpritesTask">
martin@2346
   431
			<classpath refid="project.class.path" />
martin@2346
   432
		</taskdef>
martin@2346
   433
		<smartsprites rootdir="${skins.location}" documentrootdir="${skins.location}" outputdir="${skins.location}" cssfilesuffix="-sprite" csspropertyindent="  " loglevel="WARN" spritepngdepth="DIRECT" spritepngie6="false" />
martin@2346
   434
		<move todir="${skins.location}">
martin@2346
   435
			<fileset dir="${skins.location}">
martin@2346
   436
				<include name="*/*-sprite.css" />
martin@2346
   437
				<include name="*/*/*-sprite.css" />
martin@2346
   438
			</fileset>
martin@2346
   439
			<mapper type="glob" from="*-sprite.css" to="*.css" />
martin@2346
   440
		</move>
martin@2346
   441
	</target>
carlos@0
   442
martin@2346
   443
	<target name="minimizeJSandCSS" description="minimize JS and CSS files" if="minimizeJSandCSSbool">
stefan@2521
   444
		<yuicompress linebreak="300" warn="false" munge="yes" preserveallsemicolons="true" outputfolder="${base.context}/web" charset="UTF-8">
martin@2346
   445
			<fileset dir="${base.web}">
martin@2346
   446
				<include name="**/*.js" />
martin@2346
   447
				<include name="**/*.css" />
martin@2346
   448
				<!-- The following scripts break in minification process -->
martin@2346
   449
				<exclude name="**/js/dojo/src/docs.js" />
martin@2346
   450
				<exclude name="**/js/dojo/src/hostenv_jsc.js" />
martin@2346
   451
				<exclude name="**/js/jscalendar/lang/calendar-al.js" />
martin@2346
   452
				<exclude name="**/js/jscalendar/lang/calendar-he-utf8.js" />
martin@2346
   453
				<exclude name="**/js/jscalendar/lang/calendar-hr.js" />
martin@2346
   454
				<exclude name="**/js/xinha/lang/**" />
martin@2346
   455
				<exclude name="**/js/xinha/plugins/**" />
martin@2346
   456
				<!-- dojotoolkit files are already compressd -->
martin@2346
   457
				<exclude name="**/dojotoolkit/**" />
martin@2346
   458
				<!-- from old dojo, only compress main file -->
martin@2346
   459
				<exclude name="**/dojo/**" />
martin@2346
   460
				<include name="js/dojo/dojo.js" />
martin@2346
   461
			</fileset>
martin@2346
   462
		</yuicompress>
martin@2346
   463
	</target>
stefan@2143
   464
ivan@1738
   465
	<target name="postwad">
ivan@1738
   466
		<copy todir="${base.design}/design">
ivan@1738
   467
			<fileset dir="${build.AD}" includes="**/*.xml" />
ivan@1738
   468
		</copy>
ivan@1738
   469
		<copy todir="${base.design}/design">
ivan@1738
   470
			<fileset dir="${build.AD}" includes="**/*.fo" />
ivan@1738
   471
		</copy>
ivan@1738
   472
		<copy todir="${base.design}/design">
ivan@1738
   473
			<fileset dir="${build.AD}" includes="**/*.html" />
ivan@1738
   474
		</copy>
ivan@1738
   475
		<copy todir="${base.design}/design">
ivan@1738
   476
			<fileset dir="${build.AD}" includes="**/*.srpt" />
ivan@1738
   477
		</copy>
ivan@1738
   478
		<copy todir="${base.design}/design">
ivan@1738
   479
			<fileset dir="${build.AD}" includes="**/*.jrxml" />
ivan@1738
   480
		</copy>
ivan@1738
   481
		<copy todir="${base.design}/design">
ivan@1738
   482
			<fileset dir="${build.AD}" includes="**/*.jasper" />
ivan@1738
   483
		</copy>
ivan@1738
   484
	</target>
juanpablo@131
   485
juanpablo@131
   486
martin@2346
   487
	<target name="eclipse.compile.complete" depends="clean,generate.entities,wad,sqlc,postsrc,translate">
asier@2820
   488
		<antcall target="update.build.timestamp"/>
martin@2346
   489
	</target>
david@1883
   490
martin@2346
   491
	<target name="eclipse.compile" depends="wad,sqlc, postsrc, translate">
martin@2346
   492
	</target>
martin@2346
   493
ivan@1738
   494
	<target name="compile.src" depends="compileSqlc, postsrc, copy.files">
ivan@1738
   495
	</target>
carlos@0
   496
martin@2346
   497
	<target name="compile.complete" depends="clean,generate.entities,wad,compileSqlc,postsrc,translate">
asier@2819
   498
		<antcall target="update.build.timestamp"/>
martin@2346
   499
	</target>
asier@2826
   500
	
asier@2853
   501
	
asier@2853
   502
	<target name="build.quick.new.wad" if="new.wad" depends="generate.entities.quick,wad,compileSqlc,postsrc,translate">
asier@2854
   503
    <taskdef name="updateWADmd5" classname="org.openbravo.utils.WADCheckSumTask">
asier@2854
   504
      <classpath refid="project.class.path" />
asier@2854
   505
    </taskdef>
asier@2854
   506
    <updateWADmd5 obDir="${basedir}/.."/>
asier@2854
   507
	</target>
asier@2853
   508
	
asier@2853
   509
	<target name="build.quick.no.new.wad" unless="new.wad" depends="generate.entities.quick,wad.quick,compileSqlc,postsrc,translate">
asier@2853
   510
	</target>
asier@2853
   511
	
asier@2853
   512
	<target name="build.quick">
asier@2854
   513
asier@2853
   514
		<antcall inheritall="true" inheritrefs="true" target="build.quick.new.wad"/>
asier@2853
   515
		<antcall inheritall="true" inheritrefs="true" target="build.quick.no.new.wad"/>
asier@2853
   516
		<antcall inheritall="true" inheritrefs="true" target="update.build.timestamp"/>
asier@2826
   517
	</target>
carlos@0
   518
martin@2346
   519
	<target name="translate" if="translation">
martin@2346
   520
		<antcall inheritall="true" inheritrefs="true" target="compile.translate">
martin@2346
   521
			<param name="extension" value="html" />
martin@2346
   522
		</antcall>
martin@2346
   523
		<antcall inheritall="true" inheritrefs="true" target="compile.translate">
martin@2346
   524
			<param name="extension" value="fo" />
martin@2346
   525
		</antcall>
martin@2346
   526
		<antcall inheritall="true" inheritrefs="true" target="compile.translate">
martin@2346
   527
			<param name="extension" value="srpt" />
martin@2346
   528
		</antcall>
martin@2346
   529
		<antcall inheritall="true" inheritrefs="true" target="compile.translate">
martin@2346
   530
			<param name="extension" value="jrxml" />
martin@2346
   531
		</antcall>
martin@2346
   532
		<antcall inheritall="true" inheritrefs="true" target="translate.modules" />
martin@2346
   533
	</target>
carlos@0
   534
ivan@1738
   535
	<target name="compile" depends="wad,compileSqlc, postsrc, translate">
ivan@1738
   536
	</target>
carlos@0
   537
martin@2346
   538
	<target name="translate.modules" if="translation">
martin@2346
   539
		<antcall inheritall="true" inheritrefs="true" target="compile.translate.modules">
martin@2346
   540
			<param name="extension" value="html" />
martin@2346
   541
		</antcall>
martin@2346
   542
		<antcall inheritall="true" inheritrefs="true" target="compile.translate.modules">
martin@2346
   543
			<param name="extension" value="fo" />
martin@2346
   544
		</antcall>
martin@2346
   545
		<antcall inheritall="true" inheritrefs="true" target="compile.translate.modules">
martin@2346
   546
			<param name="extension" value="srpt" />
martin@2346
   547
		</antcall>
martin@2346
   548
		<antcall inheritall="true" inheritrefs="true" target="compile.translate.modules">
martin@2346
   549
			<param name="extension" value="jrxml" />
martin@2346
   550
		</antcall>
martin@2346
   551
	</target>
carlos@0
   552
martin@2346
   553
	<target name="compile.translate.modules">
martin@2346
   554
		<java classname="org.openbravo.translate.Translate" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
stefan@2558
   555
			<arg line="'${base.config}'/Openbravo.properties ${extension} ${base.modules} '${package}' '*/src'" />
martin@2346
   556
			<classpath refid="project.class.path" />
martin@2346
   557
		</java>
martin@2346
   558
	</target>
asier@1929
   559
martin@2346
   560
	<target name="installWebService" depends="init" if="wsdd">
martin@2346
   561
		<java classname="org.apache.axis.client.AdminClient" fork="yes" jvm="${env.JAVA_HOME}/bin/java" maxmemory="${build.maxmemory}">
martin@2346
   562
			<arg line="-l${context.url}/servlet/AxisServlet ${src}/deploy.wsdd" />
martin@2346
   563
			<classpath refid="project.class.path" />
martin@2346
   564
		</java>
martin@2346
   565
	</target>
asier@1929
   566
carlos@0
   567
ivan@1738
   568
	<target name="compile.translate">
ivan@1738
   569
		<java classname="org.openbravo.translate.Translate" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
stefan@2558
   570
			<arg line="'${base.config}'/Openbravo.properties ${extension} ${basedir} ${package}" />
ivan@1738
   571
			<classpath refid="project.class.path" />
ivan@1738
   572
		</java>
ivan@1738
   573
	</target>
carlos@0
   574
carlos@0
   575
ivan@1738
   576
	<target name="uninstallWebService" depends="init">
ivan@1738
   577
		<java classname="org.apache.axis.client.AdminClient" fork="yes" jvm="${env.JAVA_HOME}/bin/java" maxmemory="${build.maxmemory}">
ivan@1738
   578
			<arg line="-l${context.url}/servlet/AxisServlet ${src}/undeploy.wsdd" />
ivan@1738
   579
			<classpath refid="project.class.path" />
ivan@1738
   580
		</java>
ivan@1738
   581
	</target>
carlos@0
   582
ivan@1738
   583
	<target name="copy.files">
ivan@1738
   584
		<mkdir dir="${jakarta.base}/webapps/${context.name}" />
ivan@1738
   585
		<copy todir="${jakarta.base}/webapps/${context.name}" encoding="UTF-8">
ivan@1738
   586
			<fileset dir="${base.context}" />
ivan@1738
   587
		</copy>
ivan@1738
   588
		<mkdir dir="${jakarta.base}/webapps/${context.name}/WEB-INF/classes" />
ivan@1738
   589
		<copy todir="${jakarta.base}/webapps/${context.name}/WEB-INF/classes" encoding="UTF-8">
ivan@1738
   590
			<fileset dir="${build}" />
ivan@1738
   591
		</copy>
ivan@1738
   592
	</target>
ivan@1738
   593
asier@1929
   594
	<target name="compile.development" depends="generate.entities, compile, copy.files">
ivan@1738
   595
		<mkdir dir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib" />
ivan@1738
   596
		<copy todir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib" file="${build.core.lib}/openbravo-core.jar" encoding="UTF-8">
ivan@1738
   597
		</copy>
ivan@1738
   598
	</target>
ivan@1738
   599
ivan@1738
   600
	<target name="compile.complete.development" depends="compile.complete, copy.files">
ivan@1738
   601
		<mkdir dir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib" />
ivan@1738
   602
		<copy todir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib" file="${build.core.lib}/openbravo-core.jar" encoding="UTF-8">
ivan@1738
   603
		</copy>
ivan@1738
   604
	</target>
ivan@1738
   605
asier@1929
   606
	<target name="compile.web" depends="build.web.folder">
asier@1929
   607
	</target>
asier@1929
   608
asier@1929
   609
	<target name="compile.web.development" depends="build.web.folder, copy.files">
asier@1929
   610
	</target>
asier@1929
   611
ivan@1738
   612
	<target name="build.war">
ivan@1738
   613
		<delete failonerror="false" file="${base.lib}/${context.name}.war" />
ivan@1738
   614
		<war compress="true" destfile="${base.lib}/${context.name}.war" encoding="UTF-8" webxml="${base.context}/WEB-INF/web.xml">
ivan@1738
   615
			<zipfileset dir="${base.context}">
ivan@1738
   616
				<exclude name="**/WEB-INF/web.xml" />
ivan@1738
   617
				<exclude name="**/WEB-INF/lib/servlet-api.jar" />
ivan@1738
   618
			</zipfileset>
ivan@1738
   619
			<classes dir="${build}" />
ivan@1738
   620
		</war>
ivan@1738
   621
	</target>
asier@1929
   622
martin@2346
   623
	<target name="generate-wsdd">
martin@2346
   624
		<delete failonerror="false">
martin@2346
   625
			<fileset dir="${base.src}/org/openbravo/services/webservice" includes="**/*" />
martin@2346
   626
		</delete>
asier@1929
   627
martin@2346
   628
		<mkdir dir="${build}" />
martin@2346
   629
		<axis-wsdl2java output="${base.src}" verbose="false" url="http://67.202.45.105/openbravo/services/WebService?wsdl" serverside="true" debug="false">
martin@2346
   630
			<mapping namespace="http://67.202.45.105/openbravo/services/WebService" package="org.openbravo.services.webservice" />
martin@2346
   631
			<mapping namespace="/services/WebService" package="org.openbravo.services.webservice" />
martin@2346
   632
		</axis-wsdl2java>
martin@2346
   633
	</target>
asier@2819
   634
	
asier@2819
   635
	<target name="update.build.timestamp">
asier@2819
   636
	    <sql driver="${bbdd.driver}"
antonio@2823
   637
	         url="${bbdd.owner.url}"
asier@2819
   638
	    	   userid="${bbdd.user}"
asier@2819
   639
	    	   password="${bbdd.password}"
asier@2819
   640
	         delimiter="/">
asier@2819
   641
	      <classpath>
asier@2819
   642
	        <fileset dir="${base.lib}">
asier@2819
   643
	          <include name="**/*.jar">
asier@2819
   644
	          </include>
asier@2819
   645
	        </fileset>
asier@2819
   646
	      </classpath>
asier@2819
   647
	      <transaction>
asier@2819
   648
	        UPDATE AD_SYSTEM_INFO SET LAST_BUILD=NOW()
asier@2819
   649
	      </transaction>
asier@2819
   650
	    </sql>
asier@2819
   651
	  </target>
asier@1929
   652
carlos@0
   653
</project>