src/build.xml
author Martin Taal <martin.taal@openbravo.com>
Thu, 29 Jan 2009 18:34:05 +0000
changeset 2830 9bed44d3b95c
parent 2826 9e138c46c6d1
child 2843 f863deab8736
permissions -rw-r--r--
Added generate.entities.quick task which only generates entities if the Application Dictionary has changed since the last time the entities were generated.
Added generate.entities.quick as a dependency of update.database, is also executed after update.database
fixes issue 7186 update.database does use some generated/to be compiled classes but the ant dependencies do not reflect this
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@2830
   193
		<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">
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@2830
   206
		<taskdef name="workflow" classpathref="project.class.path" classname="org.openbravo.base.gen.GenerateEntitiesTask" />
martin@2830
   207
		<!-- debug="true" will perform the in-memory model initialization before generating entities
martin@2830
   208
	if an error occurs then, then a stacktrace is printed. -->
martin@2830
   209
		<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
   210
			<param name="ob.properties.location" value="${base.config}/Openbravo.properties" />
martin@2346
   211
			<param name="base.src.gen" value="${base.src.gen}" />
martin@2346
   212
			<classpath>
martin@2346
   213
				<path refid="project.class.path" />
martin@2346
   214
			</classpath>
martin@2346
   215
		</workflow>
martin@2346
   216
		<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
   217
			<classpath refid="project.class.path" />
ivan@1738
   218
		</javac>
ivan@1738
   219
	</target>
juanpablo@131
   220
martin@2346
   221
	<target name="compileSqlc" depends="sqlc">
martin@2346
   222
		<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
   223
			<classpath refid="project.class.path" />
martin@2346
   224
		</javac>
martin@2346
   225
		<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
   226
			<classpath refid="project.class.path" />
martin@2346
   227
		</javac>
martin@2346
   228
		<javac srcdir="${build.AD}" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="true" debuglevel="lines,vars,source" deprecation="on">
martin@2346
   229
			<classpath refid="project.class.path" />
martin@2346
   230
		</javac>
martin@2346
   231
	</target>
martin@2346
   232
martin@2346
   233
	<target name="compile.src.gen" depends="init">
martin@2346
   234
		<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
   235
			<classpath refid="project.class.path" />
martin@2346
   236
		</javac>
martin@2346
   237
	</target>
martin@2346
   238
martin@2346
   239
	<target name="wad" depends="init">
martin@2346
   240
		<java classname="org.openbravo.wad.Wad" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
martin@2346
   241
			<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
   242
			<classpath refid="project.class.path" />
martin@2346
   243
		</java>
martin@2346
   244
		<antcall target="postwad" inheritall="true" inheritrefs="true" />
martin@2346
   245
	</target>
asier@2826
   246
	
asier@2826
   247
	<target name="wad.quick" depends="init">
asier@2826
   248
		<java classname="org.openbravo.wad.Wad" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
asier@2826
   249
		      <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
   250
		      <classpath refid="project.class.path" />
asier@2826
   251
		    </java>
asier@2826
   252
		    <antcall target="postwad" inheritall="true" inheritrefs="true" />
asier@2826
   253
	</target>
martin@2346
   254
martin@2346
   255
	<target name="postsrc" depends="postsrc.modules">
martin@2346
   256
		<copy todir="${build}">
martin@2346
   257
			<fileset dir="${basedir}" includes="**/*.properties" />
martin@2346
   258
		</copy>
martin@2346
   259
		<copy todir="${build}">
martin@2346
   260
			<fileset dir="${basedir}" includes="**/*.xslt" />
martin@2346
   261
		</copy>
martin@2346
   262
		<copy todir="${build}">
martin@2346
   263
			<fileset dir="${basedir}" includes="**/*.hbm.xml" />
martin@2346
   264
		</copy>
martin@2346
   265
		<copy todir="${base.design}/design">
martin@2346
   266
			<fileset dir="${basedir}" includes="**/*.xml" />
martin@2346
   267
		</copy>
martin@2346
   268
		<copy todir="${base.design}/design">
martin@2346
   269
			<fileset dir="${basedir}" includes="**/*.fo" />
martin@2346
   270
		</copy>
martin@2346
   271
		<copy todir="${base.design}/design">
martin@2346
   272
			<fileset dir="${basedir}" includes="**/*.html" />
martin@2346
   273
		</copy>
martin@2346
   274
		<copy todir="${base.design}/design">
martin@2346
   275
			<fileset dir="${basedir}" includes="**/*.srpt" />
martin@2346
   276
		</copy>
martin@2346
   277
		<copy todir="${base.design}/design">
martin@2346
   278
			<fileset dir="${basedir}" includes="**/*.jrxml" />
martin@2346
   279
		</copy>
martin@2346
   280
		<copy todir="${base.design}/design">
martin@2346
   281
			<fileset dir="${basedir}" includes="**/*.jasper" />
martin@2346
   282
		</copy>
asier@1929
   283
		<copy todir="${build}">
asier@1929
   284
			<fileset file="${base.config}/quartz.properties" />
martin@2346
   285
		</copy>
martin@2346
   286
		<antcall target="build.local.context" inheritAll="true" inheritrefs="true" />
martin@2346
   287
	</target>
asier@1929
   288
martin@2346
   289
	<target name="postsrc.modules">
martin@2346
   290
		<copy todir="${base.design}/design">
martin@2346
   291
			<fileset dir="${base.modules}">
martin@2346
   292
				<include name="*/src/**/*.xml" />
martin@2346
   293
				<include name="*/src/**/*.fo" />
martin@2346
   294
				<include name="*/src/**/*.html" />
martin@2346
   295
				<include name="*/src/**/*.srpt" />
martin@2346
   296
				<include name="*/src/**/*.jrxml" />
martin@2346
   297
				<include name="*/src/**/*.jasper" />
martin@2346
   298
			</fileset>
martin@2346
   299
			<mapper type="regexp" from="(.*\${file.separator}src)(.*)" to="\2" />
martin@2346
   300
		</copy>
martin@2346
   301
	</target>
asier@1929
   302
martin@2346
   303
	<!-- FIXME: These tasks is only for development and testing purposes, remove it afterwards-->
martin@2346
   304
	<target name="sqlcmod" depends="copy.srcClient">
martin@2346
   305
		<java classname="org.openbravo.data.Sqlc" fork="yes" jvm="${env.JAVA_HOME}/bin/java" maxmemory="${build.maxmemory}">
martin@2346
   306
			<arg line="'${base.config}'/Openbravo.properties .xsql '${base.modules}' '${build.sqlc}'/src */src" />
martin@2346
   307
			<classpath refid="project.class.path" />
martin@2346
   308
		</java>
martin@2346
   309
	</target>
asier@1929
   310
martin@2346
   311
	<target name="compileSqlcmod" depends="sqlcmod">
martin@2346
   312
		<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
   313
			<classpath refid="project.class.path" />
martin@2346
   314
		</javac>
martin@2346
   315
	</target>
martin@2346
   316
	<target name="postsrcmod">
martin@2346
   317
		<copy todir="${base.design}/design">
martin@2346
   318
			<fileset dir="${base.modules}" includes="*/src/**/*.html" />
martin@2346
   319
			<mapper type="regexp" from="(.*\${file.separator}src)(.*)" to="\2" />
martin@2346
   320
		</copy>
martin@2346
   321
	</target>
asier@1929
   322
martin@2346
   323
	<!-- end of auxiliar tasks-->
asier@1929
   324
martin@2346
   325
	<target name="build.local.context">
martin@2346
   326
		<copy todir="${base.context}" encoding="UTF-8">
martin@2346
   327
			<fileset file="${basedir}/index.html" />
martin@2346
   328
		</copy>
martin@2346
   329
		<copy todir="${base.context}/WEB-INF" encoding="UTF-8">
martin@2346
   330
			<fileset file="${build.sqlc}/src/web.xml" />
martin@2346
   331
			<fileset dir="${base.config}">
martin@2643
   332
				<exclude name="**/eclipse/**" />
jaime@2693
   333
                <exclude name="**/setup-properties**" />
martin@2346
   334
				<exclude name="*.template" />
martin@2346
   335
			</fileset>
martin@2346
   336
		</copy>
martin@2346
   337
		<copy todir="${base.context}/WEB-INF" encoding="UTF-8">
martin@2346
   338
			<fileset dir="${base.modules}">
martin@2346
   339
				<include name="*/config/**" />
martin@2346
   340
				<exclude name="*.template" />
martin@2346
   341
			</fileset>
martin@2346
   342
			<mapper type="regexp" from="(.*\${file.separator}config)(.*)" to="\2" />
martin@2346
   343
		</copy>
martin@2346
   344
		<copy todir="${base.context}/WEB-INF/lib" encoding="UTF-8">
martin@2346
   345
			<fileset dir="${base.lib}/runtime">
martin@2346
   346
				<exclude name="openbravo-wad.jar" />
martin@2346
   347
				<exclude name="openbravo-trl.jar" />
martin@2346
   348
				<exclude name="servlet-api.jar" />
martin@2346
   349
				<exclude name="*.war" />
martin@2346
   350
			</fileset>
martin@2346
   351
			<fileset dir="${base.db}/lib">
martin@2346
   352
				<include name="*" />
martin@2346
   353
			</fileset>
martin@2346
   354
		</copy>
asier@1929
   355
martin@2346
   356
		<copy todir="${base.context}/WEB-INF/lib" encoding="UTF-8">
martin@2346
   357
			<fileset dir="${base.modules}">
martin@2346
   358
				<include name="*/lib/runtime/**" />
martin@2346
   359
			</fileset>
martin@2346
   360
			<mapper type="regexp" from="(.*\${file.separator}lib\${file.separator}runtime)(.*)" to="\2" />
martin@2346
   361
		</copy>
martin@2346
   362
		<antcall target="build.web.folder" inheritAll="true" inheritrefs="true" />
martin@2346
   363
	</target>
asier@1929
   364
martin@2346
   365
	<target name="build.web.folder">
martin@2346
   366
		<delete includeEmptyDirs="true" dir="${base.context}/web/skins" quiet="yes" />
martin@2346
   367
		<mkdir dir="${base.context}/web" />
martin@2346
   368
martin@2346
   369
		<copy todir="${base.context}/web" encoding="UTF-8">
martin@2346
   370
			<fileset dir="${base.web}">
martin@2346
   371
				<include name="*/**" />
martin@2346
   372
				<exclude name="skins/**" />
martin@2346
   373
			</fileset>
martin@2346
   374
		</copy>
martin@2346
   375
martin@2346
   376
		<mkdir dir="${base.context}/web/skins" />
martin@2346
   377
		<mkdir dir="${base.context}/web/skins/ltr" />
martin@2346
   378
		<copy todir="${base.context}/web/skins/ltr" encoding="UTF-8">
martin@2346
   379
			<fileset dir="${base.web}/skins" />
martin@2346
   380
		</copy>
martin@2346
   381
		<mkdir dir="${base.context}/web/skins/rtl" />
martin@2346
   382
		<copy todir="${base.context}/web/skins/rtl" encoding="UTF-8">
martin@2346
   383
			<fileset dir="${base.web}/skins" />
martin@2346
   384
		</copy>
martin@2346
   385
martin@2346
   386
		<copy todir="${base.context}/web" encoding="UTF-8">
martin@2346
   387
			<fileset dir="${base.modules}">
martin@2346
   388
				<include name="*/web/*/**" />
martin@2346
   389
				<exclude name="*/web/**/skins/**" />
martin@2346
   390
			</fileset>
martin@2346
   391
			<mapper type="regexp" from="(.*)(\${file.separator}web)(.*)" to="\3" />
martin@2346
   392
		</copy>
martin@2346
   393
martin@2346
   394
		<copy todir="${base.context}/web/skins/ltr" encoding="UTF-8">
martin@2346
   395
			<fileset dir="${base.modules}">
martin@2346
   396
				<include name="*/web/*/**/skins/**" />
martin@2346
   397
			</fileset>
martin@2346
   398
			<mapper type="regexp" from="(.*)(\${file.separator}web)(.*)" to="\3" />
martin@2346
   399
		</copy>
martin@2346
   400
martin@2346
   401
		<copy todir="${base.context}/web/skins/rtl" encoding="UTF-8">
martin@2346
   402
			<fileset dir="${base.modules}">
martin@2346
   403
				<include name="*/web/*/**/skins/**" />
martin@2346
   404
			</fileset>
martin@2346
   405
			<mapper type="regexp" from="(.*)(\${file.separator}web)(.*)" to="\3" />
martin@2346
   406
		</copy>
martin@2346
   407
martin@2346
   408
		<java classname="org.openbravo.translate.RTLSkin" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
martin@2346
   409
			<arg line="${base.context}/web/skins/rtl ${base.context}/web/skins/ltr ${base.web}/skins" />
martin@2346
   410
			<classpath refid="project.class.path" />
martin@2346
   411
		</java>
martin@2346
   412
		<condition property="generateSpritesBool">
martin@2346
   413
			<istrue value="${generateSprites}" />
martin@2346
   414
		</condition>
martin@2346
   415
		<antcall target="generate.sprites" inheritAll="true" inheritrefs="true" />
martin@2346
   416
		<antcall target="minimizeJSandCSS" inheritAll="true" inheritrefs="true" />
martin@2346
   417
	</target>
martin@2346
   418
asier@1929
   419
	<target name="generate.sprites" description="Performs CSS sprite processing" if="generateSpritesBool">
martin@2346
   420
		<property name="skins.location" location="${base.context}/web/skins/" />
martin@2346
   421
		<taskdef name="smartsprites" classname="org.carrot2.labs.smartsprites.ant.SmartSpritesTask">
martin@2346
   422
			<classpath refid="project.class.path" />
martin@2346
   423
		</taskdef>
martin@2346
   424
		<smartsprites rootdir="${skins.location}" documentrootdir="${skins.location}" outputdir="${skins.location}" cssfilesuffix="-sprite" csspropertyindent="  " loglevel="WARN" spritepngdepth="DIRECT" spritepngie6="false" />
martin@2346
   425
		<move todir="${skins.location}">
martin@2346
   426
			<fileset dir="${skins.location}">
martin@2346
   427
				<include name="*/*-sprite.css" />
martin@2346
   428
				<include name="*/*/*-sprite.css" />
martin@2346
   429
			</fileset>
martin@2346
   430
			<mapper type="glob" from="*-sprite.css" to="*.css" />
martin@2346
   431
		</move>
martin@2346
   432
	</target>
carlos@0
   433
martin@2346
   434
	<target name="minimizeJSandCSS" description="minimize JS and CSS files" if="minimizeJSandCSSbool">
stefan@2521
   435
		<yuicompress linebreak="300" warn="false" munge="yes" preserveallsemicolons="true" outputfolder="${base.context}/web" charset="UTF-8">
martin@2346
   436
			<fileset dir="${base.web}">
martin@2346
   437
				<include name="**/*.js" />
martin@2346
   438
				<include name="**/*.css" />
martin@2346
   439
				<!-- The following scripts break in minification process -->
martin@2346
   440
				<exclude name="**/js/dojo/src/docs.js" />
martin@2346
   441
				<exclude name="**/js/dojo/src/hostenv_jsc.js" />
martin@2346
   442
				<exclude name="**/js/jscalendar/lang/calendar-al.js" />
martin@2346
   443
				<exclude name="**/js/jscalendar/lang/calendar-he-utf8.js" />
martin@2346
   444
				<exclude name="**/js/jscalendar/lang/calendar-hr.js" />
martin@2346
   445
				<exclude name="**/js/xinha/lang/**" />
martin@2346
   446
				<exclude name="**/js/xinha/plugins/**" />
martin@2346
   447
				<!-- dojotoolkit files are already compressd -->
martin@2346
   448
				<exclude name="**/dojotoolkit/**" />
martin@2346
   449
				<!-- from old dojo, only compress main file -->
martin@2346
   450
				<exclude name="**/dojo/**" />
martin@2346
   451
				<include name="js/dojo/dojo.js" />
martin@2346
   452
			</fileset>
martin@2346
   453
		</yuicompress>
martin@2346
   454
	</target>
stefan@2143
   455
ivan@1738
   456
	<target name="postwad">
ivan@1738
   457
		<copy todir="${base.design}/design">
ivan@1738
   458
			<fileset dir="${build.AD}" includes="**/*.xml" />
ivan@1738
   459
		</copy>
ivan@1738
   460
		<copy todir="${base.design}/design">
ivan@1738
   461
			<fileset dir="${build.AD}" includes="**/*.fo" />
ivan@1738
   462
		</copy>
ivan@1738
   463
		<copy todir="${base.design}/design">
ivan@1738
   464
			<fileset dir="${build.AD}" includes="**/*.html" />
ivan@1738
   465
		</copy>
ivan@1738
   466
		<copy todir="${base.design}/design">
ivan@1738
   467
			<fileset dir="${build.AD}" includes="**/*.srpt" />
ivan@1738
   468
		</copy>
ivan@1738
   469
		<copy todir="${base.design}/design">
ivan@1738
   470
			<fileset dir="${build.AD}" includes="**/*.jrxml" />
ivan@1738
   471
		</copy>
ivan@1738
   472
		<copy todir="${base.design}/design">
ivan@1738
   473
			<fileset dir="${build.AD}" includes="**/*.jasper" />
ivan@1738
   474
		</copy>
ivan@1738
   475
	</target>
juanpablo@131
   476
juanpablo@131
   477
martin@2346
   478
	<target name="eclipse.compile.complete" depends="clean,generate.entities,wad,sqlc,postsrc,translate">
asier@2820
   479
		<antcall target="update.build.timestamp"/>
martin@2346
   480
	</target>
david@1883
   481
martin@2346
   482
	<target name="eclipse.compile" depends="wad,sqlc, postsrc, translate">
martin@2346
   483
	</target>
martin@2346
   484
ivan@1738
   485
	<target name="compile.src" depends="compileSqlc, postsrc, copy.files">
ivan@1738
   486
	</target>
carlos@0
   487
martin@2346
   488
	<target name="compile.complete" depends="clean,generate.entities,wad,compileSqlc,postsrc,translate">
asier@2819
   489
		<antcall target="update.build.timestamp"/>
martin@2346
   490
	</target>
asier@2826
   491
	
martin@2830
   492
	<target name="build.quick" depends="generate.entities.quick,wad.quick,compileSqlc,postsrc,translate">
asier@2826
   493
		<antcall target="update.build.timestamp"/>
asier@2826
   494
	</target>
carlos@0
   495
martin@2346
   496
	<target name="translate" if="translation">
martin@2346
   497
		<antcall inheritall="true" inheritrefs="true" target="compile.translate">
martin@2346
   498
			<param name="extension" value="html" />
martin@2346
   499
		</antcall>
martin@2346
   500
		<antcall inheritall="true" inheritrefs="true" target="compile.translate">
martin@2346
   501
			<param name="extension" value="fo" />
martin@2346
   502
		</antcall>
martin@2346
   503
		<antcall inheritall="true" inheritrefs="true" target="compile.translate">
martin@2346
   504
			<param name="extension" value="srpt" />
martin@2346
   505
		</antcall>
martin@2346
   506
		<antcall inheritall="true" inheritrefs="true" target="compile.translate">
martin@2346
   507
			<param name="extension" value="jrxml" />
martin@2346
   508
		</antcall>
martin@2346
   509
		<antcall inheritall="true" inheritrefs="true" target="translate.modules" />
martin@2346
   510
	</target>
carlos@0
   511
ivan@1738
   512
	<target name="compile" depends="wad,compileSqlc, postsrc, translate">
ivan@1738
   513
	</target>
carlos@0
   514
martin@2346
   515
	<target name="translate.modules" if="translation">
martin@2346
   516
		<antcall inheritall="true" inheritrefs="true" target="compile.translate.modules">
martin@2346
   517
			<param name="extension" value="html" />
martin@2346
   518
		</antcall>
martin@2346
   519
		<antcall inheritall="true" inheritrefs="true" target="compile.translate.modules">
martin@2346
   520
			<param name="extension" value="fo" />
martin@2346
   521
		</antcall>
martin@2346
   522
		<antcall inheritall="true" inheritrefs="true" target="compile.translate.modules">
martin@2346
   523
			<param name="extension" value="srpt" />
martin@2346
   524
		</antcall>
martin@2346
   525
		<antcall inheritall="true" inheritrefs="true" target="compile.translate.modules">
martin@2346
   526
			<param name="extension" value="jrxml" />
martin@2346
   527
		</antcall>
martin@2346
   528
	</target>
carlos@0
   529
martin@2346
   530
	<target name="compile.translate.modules">
martin@2346
   531
		<java classname="org.openbravo.translate.Translate" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
stefan@2558
   532
			<arg line="'${base.config}'/Openbravo.properties ${extension} ${base.modules} '${package}' '*/src'" />
martin@2346
   533
			<classpath refid="project.class.path" />
martin@2346
   534
		</java>
martin@2346
   535
	</target>
asier@1929
   536
martin@2346
   537
	<target name="installWebService" depends="init" if="wsdd">
martin@2346
   538
		<java classname="org.apache.axis.client.AdminClient" fork="yes" jvm="${env.JAVA_HOME}/bin/java" maxmemory="${build.maxmemory}">
martin@2346
   539
			<arg line="-l${context.url}/servlet/AxisServlet ${src}/deploy.wsdd" />
martin@2346
   540
			<classpath refid="project.class.path" />
martin@2346
   541
		</java>
martin@2346
   542
	</target>
asier@1929
   543
carlos@0
   544
ivan@1738
   545
	<target name="compile.translate">
ivan@1738
   546
		<java classname="org.openbravo.translate.Translate" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
stefan@2558
   547
			<arg line="'${base.config}'/Openbravo.properties ${extension} ${basedir} ${package}" />
ivan@1738
   548
			<classpath refid="project.class.path" />
ivan@1738
   549
		</java>
ivan@1738
   550
	</target>
carlos@0
   551
carlos@0
   552
ivan@1738
   553
	<target name="uninstallWebService" depends="init">
ivan@1738
   554
		<java classname="org.apache.axis.client.AdminClient" fork="yes" jvm="${env.JAVA_HOME}/bin/java" maxmemory="${build.maxmemory}">
ivan@1738
   555
			<arg line="-l${context.url}/servlet/AxisServlet ${src}/undeploy.wsdd" />
ivan@1738
   556
			<classpath refid="project.class.path" />
ivan@1738
   557
		</java>
ivan@1738
   558
	</target>
carlos@0
   559
ivan@1738
   560
	<target name="copy.files">
ivan@1738
   561
		<mkdir dir="${jakarta.base}/webapps/${context.name}" />
ivan@1738
   562
		<copy todir="${jakarta.base}/webapps/${context.name}" encoding="UTF-8">
ivan@1738
   563
			<fileset dir="${base.context}" />
ivan@1738
   564
		</copy>
ivan@1738
   565
		<mkdir dir="${jakarta.base}/webapps/${context.name}/WEB-INF/classes" />
ivan@1738
   566
		<copy todir="${jakarta.base}/webapps/${context.name}/WEB-INF/classes" encoding="UTF-8">
ivan@1738
   567
			<fileset dir="${build}" />
ivan@1738
   568
		</copy>
ivan@1738
   569
	</target>
ivan@1738
   570
asier@1929
   571
	<target name="compile.development" depends="generate.entities, compile, copy.files">
ivan@1738
   572
		<mkdir dir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib" />
ivan@1738
   573
		<copy todir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib" file="${build.core.lib}/openbravo-core.jar" encoding="UTF-8">
ivan@1738
   574
		</copy>
ivan@1738
   575
	</target>
ivan@1738
   576
ivan@1738
   577
	<target name="compile.complete.development" depends="compile.complete, copy.files">
ivan@1738
   578
		<mkdir dir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib" />
ivan@1738
   579
		<copy todir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib" file="${build.core.lib}/openbravo-core.jar" encoding="UTF-8">
ivan@1738
   580
		</copy>
ivan@1738
   581
	</target>
ivan@1738
   582
asier@1929
   583
	<target name="compile.web" depends="build.web.folder">
asier@1929
   584
	</target>
asier@1929
   585
asier@1929
   586
	<target name="compile.web.development" depends="build.web.folder, copy.files">
asier@1929
   587
	</target>
asier@1929
   588
ivan@1738
   589
	<target name="build.war">
ivan@1738
   590
		<delete failonerror="false" file="${base.lib}/${context.name}.war" />
ivan@1738
   591
		<war compress="true" destfile="${base.lib}/${context.name}.war" encoding="UTF-8" webxml="${base.context}/WEB-INF/web.xml">
ivan@1738
   592
			<zipfileset dir="${base.context}">
ivan@1738
   593
				<exclude name="**/WEB-INF/web.xml" />
ivan@1738
   594
				<exclude name="**/WEB-INF/lib/servlet-api.jar" />
ivan@1738
   595
			</zipfileset>
ivan@1738
   596
			<classes dir="${build}" />
ivan@1738
   597
		</war>
ivan@1738
   598
	</target>
asier@1929
   599
martin@2346
   600
	<target name="generate-wsdd">
martin@2346
   601
		<delete failonerror="false">
martin@2346
   602
			<fileset dir="${base.src}/org/openbravo/services/webservice" includes="**/*" />
martin@2346
   603
		</delete>
asier@1929
   604
martin@2346
   605
		<mkdir dir="${build}" />
martin@2346
   606
		<axis-wsdl2java output="${base.src}" verbose="false" url="http://67.202.45.105/openbravo/services/WebService?wsdl" serverside="true" debug="false">
martin@2346
   607
			<mapping namespace="http://67.202.45.105/openbravo/services/WebService" package="org.openbravo.services.webservice" />
martin@2346
   608
			<mapping namespace="/services/WebService" package="org.openbravo.services.webservice" />
martin@2346
   609
		</axis-wsdl2java>
martin@2346
   610
	</target>
asier@2819
   611
	
asier@2819
   612
	<target name="update.build.timestamp">
asier@2819
   613
	    <sql driver="${bbdd.driver}"
antonio@2823
   614
	         url="${bbdd.owner.url}"
asier@2819
   615
	    	   userid="${bbdd.user}"
asier@2819
   616
	    	   password="${bbdd.password}"
asier@2819
   617
	         delimiter="/">
asier@2819
   618
	      <classpath>
asier@2819
   619
	        <fileset dir="${base.lib}">
asier@2819
   620
	          <include name="**/*.jar">
asier@2819
   621
	          </include>
asier@2819
   622
	        </fileset>
asier@2819
   623
	      </classpath>
asier@2819
   624
	      <transaction>
asier@2819
   625
	        UPDATE AD_SYSTEM_INFO SET LAST_BUILD=NOW()
asier@2819
   626
	      </transaction>
asier@2819
   627
	    </sql>
asier@2819
   628
	  </target>
asier@1929
   629
carlos@0
   630
</project>