src/build.xml
author Martin Taal <martin.taal@openbravo.com>
Tue, 16 Dec 2008 14:33:46 +0000
changeset 2346 c215e390856e
parent 2312 22dcc90280d0
child 2348 e0d45b8ed7b2
permissions -rw-r--r--
Added functionality to restart tomcat from the ui or reload Openbravo context from the ui
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 
carlos@1337
    16
 * All portions are Copyright (C) 2005-2008 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
ivan@1738
   100
	<target name="trl.clean" if="translation">
ivan@1738
   101
		<java classname="org.openbravo.translate.Translate" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
ivan@1738
   102
			<arg line="clean ${base.config}/Openbravo.properties" />
ivan@1738
   103
			<classpath refid="project.class.path" />
ivan@1738
   104
		</java>
ivan@1738
   105
	</target>
carlos@0
   106
martin@2346
   107
	<target name="clean" depends="trl.clean">
martin@2346
   108
		<property name="complete" value="true" />
martin@2346
   109
		<delete includeEmptyDirs="true" failonerror="false">
martin@2346
   110
			<fileset dir="${base.design}" />
martin@2346
   111
			<fileset dir="${build}" />
martin@2346
   112
			<fileset dir="${build.docs}" />
martin@2346
   113
			<fileset dir="${build.AD}" />
martin@2346
   114
			<fileset dir="${build.sqlc}" />
martin@2346
   115
			<fileset dir="${base.context}">
martin@2346
   116
				<exclude name=".svn" />
martin@2346
   117
				<exclude name="META-INF/MANIFEST.MF" />
martin@2346
   118
			</fileset>
martin@2346
   119
		</delete>
martin@2346
   120
	</target>
carlos@0
   121
martin@2346
   122
	<target name="sqlc" depends="copy.srcClient">
martin@2346
   123
		<java classname="org.openbravo.data.Sqlc" fork="yes" jvm="${env.JAVA_HOME}/bin/java" maxmemory="${build.maxmemory}">
martin@2346
   124
			<arg line="'${base.config}'/Openbravo.properties .xsql . '${build.sqlc}'/src" />
martin@2346
   125
			<classpath refid="project.class.path" />
martin@2346
   126
		</java>
martin@2346
   127
		<java classname="org.openbravo.data.Sqlc" fork="yes" jvm="${env.JAVA_HOME}/bin/java" maxmemory="${build.maxmemory}">
martin@2346
   128
			<arg line="'${base.config}'/Openbravo.properties .xsql '${base.modules}' '${build.sqlc}'/src */src" />
martin@2346
   129
			<classpath refid="project.class.path" />
martin@2346
   130
		</java>
martin@2346
   131
		<copy file="${base.src}/buildAD.xml" tofile="${build.AD}/build.xml" />
martin@2346
   132
		<copy file="${base.src}/log4j.lcf" tofile="${build.AD}/log4j.lcf" />
martin@2346
   133
		<ant dir="${build.AD}" target="buildAD" inheritAll="true" inheritRefs="true" />
martin@2346
   134
	</target>
martin@2346
   135
martin@2346
   136
	<target name="copy.srcClient">
ivan@1738
   137
		<mkdir dir="${base.client.src}" />
ivan@1738
   138
		<copy todir="${basedir}" overwrite="true" failonerror="false">
ivan@1738
   139
			<fileset dir="${base.client.src}">
ivan@1738
   140
				<exclude name="**/web.xml" />
ivan@1738
   141
			</fileset>
ivan@1738
   142
		</copy>
ivan@1738
   143
	</target>
carlos@0
   144
martin@2346
   145
	<target name="clean.src.gen">
asier@1929
   146
		<delete includeEmptyDirs="true" failonerror="false">
asier@1929
   147
			<fileset dir="${base.src.gen}" />
asier@1929
   148
		</delete>
ivan@1738
   149
	</target>
carlos@0
   150
martin@2284
   151
	<target name="export.sample.data" description="Exports Sample Data">
martin@2284
   152
		<taskdef name="exportsampledata" classname="org.openbravo.service.db.ExportReferenceDataTask">
martin@2346
   153
			<classpath refid="project.class.path" />
martin@2346
   154
		</taskdef>
martin@2346
   155
		<echo message="Exporting sample reference data" />
martin@2346
   156
		<exportsampledata userId="0" propertiesFile="${base.config}/Openbravo.properties" clients="BigBazaar,Accounting Test" />
martin@2346
   157
	</target>
martin@2346
   158
martin@2284
   159
	<target name="import.sample.data" description="Import Sample Data">
martin@2284
   160
		<taskdef name="importsampledata" classname="org.openbravo.service.db.ImportReferenceDataTask">
martin@2346
   161
			<classpath refid="project.class.path" />
martin@2346
   162
		</taskdef>
martin@2346
   163
		<echo message="Importing sample reference data" />
martin@2346
   164
		<importsampledata userId="0" propertiesFile="${base.config}/Openbravo.properties" />
martin@2346
   165
	</target>
asier@1929
   166
martin@2346
   167
	<target name="generate.entities" depends="compile.src.gen,clean.src.gen">
martin@2346
   168
		<taskdef name="workflow" classpathref="project.class.path" classname="org.openbravo.base.gen.GenerateEntitiesTask" />
martin@2346
   169
		<!-- debug="true" will perform the in-memory model initialization before generating entities
asier@1929
   170
	if an error occurs then, then a stacktrace is printed. -->
martin@2346
   171
		<workflow debug="false" propertiesFile="${base.config}/Openbravo.properties" file="${base.src}/org/openbravo/base/gen/gen_entity.oaw" fork="true" maxmemory="${build.maxmemory}">
martin@2346
   172
			<param name="ob.properties.location" value="${base.config}/Openbravo.properties" />
martin@2346
   173
			<param name="base.src.gen" value="${base.src.gen}" />
martin@2346
   174
			<classpath>
martin@2346
   175
				<path refid="project.class.path" />
martin@2346
   176
			</classpath>
martin@2346
   177
		</workflow>
martin@2346
   178
		<javac srcdir="${base.src.gen}:${base.src}/org/openbravo/base/model:${base.src}/org/openbravo/dal:${base.src}/org/openbravo/base/structure" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="true" debuglevel="lines,vars,source" deprecation="on">
ivan@1738
   179
			<classpath refid="project.class.path" />
ivan@1738
   180
		</javac>
ivan@1738
   181
	</target>
juanpablo@131
   182
carlos@0
   183
juanpablo@131
   184
martin@2346
   185
	<target name="compileSqlc" depends="sqlc">
martin@2346
   186
		<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
   187
			<classpath refid="project.class.path" />
martin@2346
   188
		</javac>
martin@2346
   189
		<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
   190
			<classpath refid="project.class.path" />
martin@2346
   191
		</javac>
martin@2346
   192
		<javac srcdir="${build.AD}" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="true" debuglevel="lines,vars,source" deprecation="on">
martin@2346
   193
			<classpath refid="project.class.path" />
martin@2346
   194
		</javac>
martin@2346
   195
	</target>
martin@2346
   196
martin@2346
   197
	<target name="compile.src.gen" depends="init">
martin@2346
   198
		<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
   199
			<classpath refid="project.class.path" />
martin@2346
   200
		</javac>
martin@2346
   201
	</target>
martin@2346
   202
martin@2346
   203
	<target name="wad" depends="init">
martin@2346
   204
		<java classname="org.openbravo.wad.Wad" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
martin@2346
   205
			<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
   206
			<classpath refid="project.class.path" />
martin@2346
   207
		</java>
martin@2346
   208
		<antcall target="postwad" inheritall="true" inheritrefs="true" />
martin@2346
   209
	</target>
martin@2346
   210
martin@2346
   211
martin@2346
   212
	<target name="postsrc" depends="postsrc.modules">
martin@2346
   213
		<copy todir="${build}">
martin@2346
   214
			<fileset dir="${basedir}" includes="**/*.properties" />
martin@2346
   215
		</copy>
martin@2346
   216
		<copy todir="${build}">
martin@2346
   217
			<fileset dir="${basedir}" includes="**/*.xslt" />
martin@2346
   218
		</copy>
martin@2346
   219
		<copy todir="${build}">
martin@2346
   220
			<fileset dir="${basedir}" includes="**/*.hbm.xml" />
martin@2346
   221
		</copy>
martin@2346
   222
		<copy todir="${base.design}/design">
martin@2346
   223
			<fileset dir="${basedir}" includes="**/*.xml" />
martin@2346
   224
		</copy>
martin@2346
   225
		<copy todir="${base.design}/design">
martin@2346
   226
			<fileset dir="${basedir}" includes="**/*.fo" />
martin@2346
   227
		</copy>
martin@2346
   228
		<copy todir="${base.design}/design">
martin@2346
   229
			<fileset dir="${basedir}" includes="**/*.html" />
martin@2346
   230
		</copy>
martin@2346
   231
		<copy todir="${base.design}/design">
martin@2346
   232
			<fileset dir="${basedir}" includes="**/*.srpt" />
martin@2346
   233
		</copy>
martin@2346
   234
		<copy todir="${base.design}/design">
martin@2346
   235
			<fileset dir="${basedir}" includes="**/*.jrxml" />
martin@2346
   236
		</copy>
martin@2346
   237
		<copy todir="${base.design}/design">
martin@2346
   238
			<fileset dir="${basedir}" includes="**/*.jasper" />
martin@2346
   239
		</copy>
asier@1929
   240
		<copy todir="${build}">
asier@1929
   241
			<fileset file="${base.config}/quartz.properties" />
martin@2346
   242
		</copy>
martin@2346
   243
		<java classname="org.openbravo.translate.CommandLine_CopyFiles" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
martin@2346
   244
			<arg line="'${base.config}/Openbravo.properties' '${base.design}/design' '${base.design}' '.xml' 'true' 'false'" />
martin@2346
   245
			<classpath refid="project.class.path" />
martin@2346
   246
		</java>
martin@2346
   247
		<java classname="org.openbravo.translate.CommandLine_CopyFiles" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
martin@2346
   248
			<arg line="'${base.config}/Openbravo.properties' '${base.design}/design' '${base.design}' 'jasper' 'true' 'false'" />
martin@2346
   249
			<classpath refid="project.class.path" />
martin@2346
   250
		</java>
martin@2346
   251
		<antcall target="build.local.context" inheritAll="true" inheritrefs="true" />
martin@2346
   252
	</target>
asier@1929
   253
martin@2346
   254
	<target name="postsrc.modules">
martin@2346
   255
		<copy todir="${base.design}/design">
martin@2346
   256
			<fileset dir="${base.modules}">
martin@2346
   257
				<include name="*/src/**/*.xml" />
martin@2346
   258
				<include name="*/src/**/*.fo" />
martin@2346
   259
				<include name="*/src/**/*.html" />
martin@2346
   260
				<include name="*/src/**/*.srpt" />
martin@2346
   261
				<include name="*/src/**/*.jrxml" />
martin@2346
   262
				<include name="*/src/**/*.jasper" />
martin@2346
   263
			</fileset>
martin@2346
   264
			<mapper type="regexp" from="(.*\${file.separator}src)(.*)" to="\2" />
martin@2346
   265
		</copy>
martin@2346
   266
	</target>
asier@1929
   267
martin@2346
   268
	<!-- FIXME: These tasks is only for development and testing purposes, remove it afterwards-->
martin@2346
   269
	<target name="sqlcmod" depends="copy.srcClient">
martin@2346
   270
		<java classname="org.openbravo.data.Sqlc" fork="yes" jvm="${env.JAVA_HOME}/bin/java" maxmemory="${build.maxmemory}">
martin@2346
   271
			<arg line="'${base.config}'/Openbravo.properties .xsql '${base.modules}' '${build.sqlc}'/src */src" />
martin@2346
   272
			<classpath refid="project.class.path" />
martin@2346
   273
		</java>
martin@2346
   274
	</target>
asier@1929
   275
martin@2346
   276
	<target name="compileSqlcmod" depends="sqlcmod">
martin@2346
   277
		<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
   278
			<classpath refid="project.class.path" />
martin@2346
   279
		</javac>
martin@2346
   280
	</target>
martin@2346
   281
	<target name="postsrcmod">
martin@2346
   282
		<copy todir="${base.design}/design">
martin@2346
   283
			<fileset dir="${base.modules}" includes="*/src/**/*.html" />
martin@2346
   284
			<mapper type="regexp" from="(.*\${file.separator}src)(.*)" to="\2" />
martin@2346
   285
		</copy>
martin@2346
   286
	</target>
asier@1929
   287
martin@2346
   288
	<!-- end of auxiliar tasks-->
asier@1929
   289
martin@2346
   290
	<target name="build.local.context">
martin@2346
   291
		<copy todir="${base.context}" encoding="UTF-8">
martin@2346
   292
			<fileset file="${basedir}/index.html" />
martin@2346
   293
		</copy>
martin@2346
   294
		<copy todir="${base.context}/WEB-INF" encoding="UTF-8">
martin@2346
   295
			<fileset file="${build.sqlc}/src/web.xml" />
martin@2346
   296
			<fileset dir="${base.config}">
martin@2346
   297
				<exclude name="**/setup-tool/**" />
martin@2346
   298
				<exclude name="*.template" />
martin@2346
   299
			</fileset>
martin@2346
   300
		</copy>
martin@2346
   301
		<copy todir="${base.context}/WEB-INF" encoding="UTF-8">
martin@2346
   302
			<fileset dir="${base.modules}">
martin@2346
   303
				<include name="*/config/**" />
martin@2346
   304
				<exclude name="*.template" />
martin@2346
   305
			</fileset>
martin@2346
   306
			<mapper type="regexp" from="(.*\${file.separator}config)(.*)" to="\2" />
martin@2346
   307
		</copy>
martin@2346
   308
		<copy todir="${base.context}/WEB-INF/lib" encoding="UTF-8">
martin@2346
   309
			<fileset dir="${base.lib}/runtime">
martin@2346
   310
				<exclude name="openbravo-wad.jar" />
martin@2346
   311
				<exclude name="openbravo-trl.jar" />
martin@2346
   312
				<exclude name="servlet-api.jar" />
martin@2346
   313
				<exclude name="*.war" />
martin@2346
   314
			</fileset>
martin@2346
   315
			<fileset dir="${base.db}/lib">
martin@2346
   316
				<include name="*" />
martin@2346
   317
			</fileset>
martin@2346
   318
		</copy>
asier@1929
   319
martin@2346
   320
		<copy todir="${base.context}/WEB-INF/lib" encoding="UTF-8">
martin@2346
   321
			<fileset dir="${base.modules}">
martin@2346
   322
				<include name="*/lib/runtime/**" />
martin@2346
   323
			</fileset>
martin@2346
   324
			<mapper type="regexp" from="(.*\${file.separator}lib\${file.separator}runtime)(.*)" to="\2" />
martin@2346
   325
		</copy>
martin@2346
   326
		<antcall target="build.web.folder" inheritAll="true" inheritrefs="true" />
martin@2346
   327
	</target>
asier@1929
   328
martin@2346
   329
	<target name="build.web.folder">
martin@2346
   330
		<delete includeEmptyDirs="true" dir="${base.context}/web/skins" quiet="yes" />
martin@2346
   331
		<mkdir dir="${base.context}/web" />
martin@2346
   332
martin@2346
   333
		<copy todir="${base.context}/web" encoding="UTF-8">
martin@2346
   334
			<fileset dir="${base.web}">
martin@2346
   335
				<include name="*/**" />
martin@2346
   336
				<exclude name="skins/**" />
martin@2346
   337
			</fileset>
martin@2346
   338
		</copy>
martin@2346
   339
martin@2346
   340
		<mkdir dir="${base.context}/web/skins" />
martin@2346
   341
		<mkdir dir="${base.context}/web/skins/ltr" />
martin@2346
   342
		<copy todir="${base.context}/web/skins/ltr" encoding="UTF-8">
martin@2346
   343
			<fileset dir="${base.web}/skins" />
martin@2346
   344
		</copy>
martin@2346
   345
		<mkdir dir="${base.context}/web/skins/rtl" />
martin@2346
   346
		<copy todir="${base.context}/web/skins/rtl" encoding="UTF-8">
martin@2346
   347
			<fileset dir="${base.web}/skins" />
martin@2346
   348
		</copy>
martin@2346
   349
martin@2346
   350
		<copy todir="${base.context}/web" encoding="UTF-8">
martin@2346
   351
			<fileset dir="${base.modules}">
martin@2346
   352
				<include name="*/web/*/**" />
martin@2346
   353
				<exclude name="*/web/**/skins/**" />
martin@2346
   354
			</fileset>
martin@2346
   355
			<mapper type="regexp" from="(.*)(\${file.separator}web)(.*)" to="\3" />
martin@2346
   356
		</copy>
martin@2346
   357
martin@2346
   358
		<copy todir="${base.context}/web/skins/ltr" encoding="UTF-8">
martin@2346
   359
			<fileset dir="${base.modules}">
martin@2346
   360
				<include name="*/web/*/**/skins/**" />
martin@2346
   361
			</fileset>
martin@2346
   362
			<mapper type="regexp" from="(.*)(\${file.separator}web)(.*)" to="\3" />
martin@2346
   363
		</copy>
martin@2346
   364
martin@2346
   365
		<copy todir="${base.context}/web/skins/rtl" encoding="UTF-8">
martin@2346
   366
			<fileset dir="${base.modules}">
martin@2346
   367
				<include name="*/web/*/**/skins/**" />
martin@2346
   368
			</fileset>
martin@2346
   369
			<mapper type="regexp" from="(.*)(\${file.separator}web)(.*)" to="\3" />
martin@2346
   370
		</copy>
martin@2346
   371
martin@2346
   372
		<java classname="org.openbravo.translate.RTLSkin" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
martin@2346
   373
			<arg line="${base.context}/web/skins/rtl ${base.context}/web/skins/ltr ${base.web}/skins" />
martin@2346
   374
			<classpath refid="project.class.path" />
martin@2346
   375
		</java>
martin@2346
   376
		<condition property="generateSpritesBool">
martin@2346
   377
			<istrue value="${generateSprites}" />
martin@2346
   378
		</condition>
martin@2346
   379
		<antcall target="generate.sprites" inheritAll="true" inheritrefs="true" />
martin@2346
   380
		<antcall target="minimizeJSandCSS" inheritAll="true" inheritrefs="true" />
martin@2346
   381
	</target>
martin@2346
   382
asier@1929
   383
	<target name="generate.sprites" description="Performs CSS sprite processing" if="generateSpritesBool">
martin@2346
   384
		<property name="skins.location" location="${base.context}/web/skins/" />
martin@2346
   385
		<taskdef name="smartsprites" classname="org.carrot2.labs.smartsprites.ant.SmartSpritesTask">
martin@2346
   386
			<classpath refid="project.class.path" />
martin@2346
   387
		</taskdef>
martin@2346
   388
		<smartsprites rootdir="${skins.location}" documentrootdir="${skins.location}" outputdir="${skins.location}" cssfilesuffix="-sprite" csspropertyindent="  " loglevel="WARN" spritepngdepth="DIRECT" spritepngie6="false" />
martin@2346
   389
		<move todir="${skins.location}">
martin@2346
   390
			<fileset dir="${skins.location}">
martin@2346
   391
				<include name="*/*-sprite.css" />
martin@2346
   392
				<include name="*/*/*-sprite.css" />
martin@2346
   393
			</fileset>
martin@2346
   394
			<mapper type="glob" from="*-sprite.css" to="*.css" />
martin@2346
   395
		</move>
martin@2346
   396
	</target>
carlos@0
   397
martin@2346
   398
	<target name="minimizeJSandCSS" description="minimize JS and CSS files" if="minimizeJSandCSSbool">
martin@2346
   399
		<yuicompress linebreak="300" warn="false" munge="yes" preserveallsemicolons="true" outputfolder="${base.context}/web">
martin@2346
   400
			<fileset dir="${base.web}">
martin@2346
   401
				<include name="**/*.js" />
martin@2346
   402
				<include name="**/*.css" />
martin@2346
   403
				<!-- The following scripts break in minification process -->
martin@2346
   404
				<exclude name="**/js/dojo/src/docs.js" />
martin@2346
   405
				<exclude name="**/js/dojo/src/hostenv_jsc.js" />
martin@2346
   406
				<exclude name="**/js/jscalendar/lang/calendar-al.js" />
martin@2346
   407
				<exclude name="**/js/jscalendar/lang/calendar-he-utf8.js" />
martin@2346
   408
				<exclude name="**/js/jscalendar/lang/calendar-hr.js" />
martin@2346
   409
				<exclude name="**/js/xinha/lang/**" />
martin@2346
   410
				<exclude name="**/js/xinha/plugins/**" />
martin@2346
   411
				<!-- dojotoolkit files are already compressd -->
martin@2346
   412
				<exclude name="**/dojotoolkit/**" />
martin@2346
   413
				<!-- from old dojo, only compress main file -->
martin@2346
   414
				<exclude name="**/dojo/**" />
martin@2346
   415
				<include name="js/dojo/dojo.js" />
martin@2346
   416
			</fileset>
martin@2346
   417
		</yuicompress>
martin@2346
   418
	</target>
stefan@2143
   419
ivan@1738
   420
	<target name="postwad">
ivan@1738
   421
		<copy todir="${base.design}/design">
ivan@1738
   422
			<fileset dir="${build.AD}" includes="**/*.xml" />
ivan@1738
   423
		</copy>
ivan@1738
   424
		<copy todir="${base.design}/design">
ivan@1738
   425
			<fileset dir="${build.AD}" includes="**/*.fo" />
ivan@1738
   426
		</copy>
ivan@1738
   427
		<copy todir="${base.design}/design">
ivan@1738
   428
			<fileset dir="${build.AD}" includes="**/*.html" />
ivan@1738
   429
		</copy>
ivan@1738
   430
		<copy todir="${base.design}/design">
ivan@1738
   431
			<fileset dir="${build.AD}" includes="**/*.srpt" />
ivan@1738
   432
		</copy>
ivan@1738
   433
		<copy todir="${base.design}/design">
ivan@1738
   434
			<fileset dir="${build.AD}" includes="**/*.jrxml" />
ivan@1738
   435
		</copy>
ivan@1738
   436
		<copy todir="${base.design}/design">
ivan@1738
   437
			<fileset dir="${build.AD}" includes="**/*.jasper" />
ivan@1738
   438
		</copy>
ivan@1738
   439
	</target>
juanpablo@131
   440
juanpablo@131
   441
martin@2346
   442
	<target name="eclipse.compile.complete" depends="clean,generate.entities,wad,sqlc,postsrc,translate">
martin@2346
   443
	</target>
david@1883
   444
martin@2346
   445
	<target name="eclipse.compile" depends="wad,sqlc, postsrc, translate">
martin@2346
   446
	</target>
martin@2346
   447
ivan@1738
   448
	<target name="compile.src" depends="compileSqlc, postsrc, copy.files">
ivan@1738
   449
	</target>
carlos@0
   450
martin@2346
   451
	<target name="compile.complete" depends="clean,generate.entities,wad,compileSqlc,postsrc,translate">
martin@2346
   452
	</target>
carlos@0
   453
martin@2346
   454
	<target name="translate" if="translation">
martin@2346
   455
		<antcall inheritall="true" inheritrefs="true" target="compile.translate">
martin@2346
   456
			<param name="extension" value="html" />
martin@2346
   457
		</antcall>
martin@2346
   458
		<antcall inheritall="true" inheritrefs="true" target="compile.translate">
martin@2346
   459
			<param name="extension" value="fo" />
martin@2346
   460
		</antcall>
martin@2346
   461
		<antcall inheritall="true" inheritrefs="true" target="compile.translate">
martin@2346
   462
			<param name="extension" value="srpt" />
martin@2346
   463
		</antcall>
martin@2346
   464
		<antcall inheritall="true" inheritrefs="true" target="compile.translate">
martin@2346
   465
			<param name="extension" value="jrxml" />
martin@2346
   466
		</antcall>
martin@2346
   467
		<antcall inheritall="true" inheritrefs="true" target="translate.modules" />
martin@2346
   468
	</target>
carlos@0
   469
ivan@1738
   470
	<target name="compile" depends="wad,compileSqlc, postsrc, translate">
ivan@1738
   471
	</target>
carlos@0
   472
martin@2346
   473
	<target name="translate.modules" if="translation">
martin@2346
   474
		<antcall inheritall="true" inheritrefs="true" target="compile.translate.modules">
martin@2346
   475
			<param name="extension" value="html" />
martin@2346
   476
		</antcall>
martin@2346
   477
		<antcall inheritall="true" inheritrefs="true" target="compile.translate.modules">
martin@2346
   478
			<param name="extension" value="fo" />
martin@2346
   479
		</antcall>
martin@2346
   480
		<antcall inheritall="true" inheritrefs="true" target="compile.translate.modules">
martin@2346
   481
			<param name="extension" value="srpt" />
martin@2346
   482
		</antcall>
martin@2346
   483
		<antcall inheritall="true" inheritrefs="true" target="compile.translate.modules">
martin@2346
   484
			<param name="extension" value="jrxml" />
martin@2346
   485
		</antcall>
martin@2346
   486
	</target>
carlos@0
   487
martin@2346
   488
	<target name="compile.translate.modules">
martin@2346
   489
		<java classname="org.openbravo.translate.Translate" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
martin@2346
   490
			<arg line="'${base.config}'/Openbravo.properties ${extension} ${base.modules} '${base.design}' '${package}' '*/src'" />
martin@2346
   491
			<classpath refid="project.class.path" />
martin@2346
   492
		</java>
martin@2346
   493
	</target>
asier@1929
   494
martin@2346
   495
	<target name="installWebService" depends="init" if="wsdd">
martin@2346
   496
		<java classname="org.apache.axis.client.AdminClient" fork="yes" jvm="${env.JAVA_HOME}/bin/java" maxmemory="${build.maxmemory}">
martin@2346
   497
			<arg line="-l${context.url}/servlet/AxisServlet ${src}/deploy.wsdd" />
martin@2346
   498
			<classpath refid="project.class.path" />
martin@2346
   499
		</java>
martin@2346
   500
	</target>
asier@1929
   501
carlos@0
   502
ivan@1738
   503
	<target name="compile.translate">
ivan@1738
   504
		<java classname="org.openbravo.translate.Translate" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
ivan@1738
   505
			<arg line="'${base.config}'/Openbravo.properties ${extension} ${basedir} '${base.design}' ${package}" />
ivan@1738
   506
			<classpath refid="project.class.path" />
ivan@1738
   507
		</java>
ivan@1738
   508
	</target>
carlos@0
   509
carlos@0
   510
ivan@1738
   511
	<target name="uninstallWebService" depends="init">
ivan@1738
   512
		<java classname="org.apache.axis.client.AdminClient" fork="yes" jvm="${env.JAVA_HOME}/bin/java" maxmemory="${build.maxmemory}">
ivan@1738
   513
			<arg line="-l${context.url}/servlet/AxisServlet ${src}/undeploy.wsdd" />
ivan@1738
   514
			<classpath refid="project.class.path" />
ivan@1738
   515
		</java>
ivan@1738
   516
	</target>
carlos@0
   517
ivan@1738
   518
	<target name="copy.files">
ivan@1738
   519
		<mkdir dir="${jakarta.base}/webapps/${context.name}" />
ivan@1738
   520
		<copy todir="${jakarta.base}/webapps/${context.name}" encoding="UTF-8">
ivan@1738
   521
			<fileset dir="${base.context}" />
ivan@1738
   522
		</copy>
ivan@1738
   523
		<mkdir dir="${jakarta.base}/webapps/${context.name}/WEB-INF/classes" />
ivan@1738
   524
		<copy todir="${jakarta.base}/webapps/${context.name}/WEB-INF/classes" encoding="UTF-8">
ivan@1738
   525
			<fileset dir="${build}" />
ivan@1738
   526
		</copy>
ivan@1738
   527
	</target>
ivan@1738
   528
asier@1929
   529
	<target name="compile.development" depends="generate.entities, compile, copy.files">
ivan@1738
   530
		<mkdir dir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib" />
ivan@1738
   531
		<copy todir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib" file="${build.core.lib}/openbravo-core.jar" encoding="UTF-8">
ivan@1738
   532
		</copy>
ivan@1738
   533
	</target>
ivan@1738
   534
ivan@1738
   535
	<target name="compile.complete.development" depends="compile.complete, copy.files">
ivan@1738
   536
		<mkdir dir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib" />
ivan@1738
   537
		<copy todir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib" file="${build.core.lib}/openbravo-core.jar" encoding="UTF-8">
ivan@1738
   538
		</copy>
ivan@1738
   539
	</target>
ivan@1738
   540
asier@1929
   541
	<target name="compile.web" depends="build.web.folder">
asier@1929
   542
	</target>
asier@1929
   543
asier@1929
   544
	<target name="compile.web.development" depends="build.web.folder, copy.files">
asier@1929
   545
	</target>
asier@1929
   546
ivan@1738
   547
	<target name="build.war">
ivan@1738
   548
		<delete failonerror="false" file="${base.lib}/${context.name}.war" />
ivan@1738
   549
		<war compress="true" destfile="${base.lib}/${context.name}.war" encoding="UTF-8" webxml="${base.context}/WEB-INF/web.xml">
ivan@1738
   550
			<zipfileset dir="${base.context}">
ivan@1738
   551
				<exclude name="**/WEB-INF/web.xml" />
ivan@1738
   552
				<exclude name="**/WEB-INF/lib/servlet-api.jar" />
ivan@1738
   553
			</zipfileset>
ivan@1738
   554
			<classes dir="${build}" />
ivan@1738
   555
		</war>
ivan@1738
   556
	</target>
asier@1929
   557
martin@2346
   558
	<target name="generate-wsdd">
martin@2346
   559
		<delete failonerror="false">
martin@2346
   560
			<fileset dir="${base.src}/org/openbravo/services/webservice" includes="**/*" />
martin@2346
   561
		</delete>
asier@1929
   562
martin@2346
   563
		<mkdir dir="${build}" />
martin@2346
   564
		<axis-wsdl2java output="${base.src}" verbose="false" url="http://67.202.45.105/openbravo/services/WebService?wsdl" serverside="true" debug="false">
martin@2346
   565
			<mapping namespace="http://67.202.45.105/openbravo/services/WebService" package="org.openbravo.services.webservice" />
martin@2346
   566
			<mapping namespace="/services/WebService" package="org.openbravo.services.webservice" />
martin@2346
   567
		</axis-wsdl2java>
martin@2346
   568
	</target>
asier@1929
   569
carlos@0
   570
</project>