src/build.xml
author Antonio Moreno <antonio.moreno@openbravo.com>
Fri, 28 May 2010 17:16:48 +0200
changeset 7537 24cd5a49d2c5
parent 7526 ad55dd7c0779
child 7539 0911fd2387bb
permissions -rw-r--r--
[DynamicRebuildWindow] Added missing fork properties to several javac calls
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. 
ggi@6702
    15
 * The Initial Developer of the Original Code is Openbravo SLU 
ggi@6702
    16
 * All portions are Copyright (C) 2005-2010 Openbravo SLU 
carlos@0
    17
 * All Rights Reserved. 
ggi@6702
    18
 * Contributor(s): Openbravo S.L.U.
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@2868
    58
  <taskdef name="yuicompress" classname="com.yahoo.platform.yui.compressor.YUICompressTask">
ivan@6262
    59
    <classpath>
ivan@6262
    60
      <pathelement location="${base.lib}/build/yuicompressor-2.4.2.jar" />
ivan@6262
    61
      <pathelement location="${base.lib}/build/ob-rhino-1.6R7.jar" />
ivan@6262
    62
      <pathelement location="${base.lib}/build/YUIAnt.jar" />
ivan@6262
    63
    </classpath>
martin@2868
    64
  </taskdef>
stefan@2143
    65
martin@2868
    66
  <condition property="minimizeJSandCSSbool">
martin@2868
    67
    <istrue value="${minimizeJSandCSS}" />
martin@2868
    68
  </condition>
stefan@2143
    69
martin@2868
    70
  <property name="webTab" value="all" />
martin@2868
    71
  <property name="tab" value="%" />
asier@1929
    72
martin@2868
    73
  <property name="base.translate.structure" value="org/openbravo/erpWindows" />
martin@2868
    74
  <property name="client.web.xml" value="${base.client.src}/web.xml" />
martin@2868
    75
  <property name="extension" value="html" />
martin@2868
    76
  <property name="src" value="." />
martin@2868
    77
  <property name="tr" value="yes" />
martin@2868
    78
  <condition property="translation">
martin@2868
    79
    <not>
martin@2868
    80
      <equals arg1="no" arg2="${tr}" />
martin@2868
    81
    </not>
martin@2868
    82
  </condition>
martin@2868
    83
  <target name="init">
martin@2868
    84
    <mkdir dir="${build}" />
martin@2868
    85
    <mkdir dir="${base.design}/design" />
martin@2868
    86
    <mkdir dir="${build.sqlc}" />
martin@2868
    87
    <mkdir dir="${build.sqlc}/src" />
martin@2868
    88
    <mkdir dir="${build.sqlc}/srcAD" />
martin@2868
    89
    <mkdir dir="${build.AD}" />
martin@2868
    90
    <mkdir dir="${build.AD}/org/openbravo/erpWindows" />
martin@2868
    91
    <mkdir dir="${build.AD}/org/openbravo/erpCommon/ad_actionButton" />
martin@2868
    92
    <mkdir dir="${build.AD}/org/openbravo/erpCommon/ad_callouts" />
martin@2868
    93
    <mkdir dir="${build.AD}/org/openbravo/erpCommon/reference" />
martin@2868
    94
    <mkdir dir="${build.docs}" />
martin@2868
    95
  </target>
antonio@5620
    96
  <macrodef name="updatesystemstatus">
antonio@5620
    97
     <attribute name="v" default="NOT SET"/>
antonio@5620
    98
     <sequential>
antonio@5620
    99
       <sql driver="${bbdd.driver}" url="${bbdd.owner.url}" userid="${bbdd.user}" password="${bbdd.password}" onerror="continue" autocommit="true">
antonio@5621
   100
         <classpath> <fileset dir="${base.lib}"> <include name="**/*.jar"> </include> </fileset> </classpath>
antonio@5621
   101
         <transaction> UPDATE ad_system_info SET system_status='@{v}' ;
antonio@5621
   102
                       DELETE FROM ad_error_log where system_status=(select system_status from ad_system_info)
antonio@5621
   103
         </transaction>
antonio@5620
   104
       </sql>
antonio@5620
   105
     </sequential>
antonio@5620
   106
  </macrodef>
carlos@0
   107
martin@2868
   108
  <target name="validate.database">
martin@2868
   109
    <taskdef name="validateDatabase" classname="org.openbravo.service.system.SystemValidationTask">
martin@2868
   110
      <classpath refid="project.class.path" />
martin@2868
   111
    </taskdef>
martin@5458
   112
    <validateDatabase userId="0" adminMode="true" propertiesFile="${base.config}/Openbravo.properties" type="database" />
martin@2868
   113
  </target>
carlos@0
   114
martin@2868
   115
  <target name="validate.modules">
martin@2868
   116
    <taskdef name="validateModules" classname="org.openbravo.service.system.SystemValidationTask">
martin@2868
   117
      <classpath refid="project.class.path" />
martin@2868
   118
    </taskdef>
asier@5709
   119
    <validateModules userId="0" adminMode="true" propertiesFile="${base.config}/Openbravo.properties" type="module" moduleJavaPackage="${module}"/>
martin@2868
   120
  </target>
antonio@4917
   121
  
antonio@4965
   122
  <target name="load.logoimages">
antonio@4917
   123
    <taskdef name="imageloading" classname="org.openbravo.erpCommon.utility.ImageToDatabaseLoader">
antonio@4917
   124
      <classpath refid="project.class.path" />
antonio@4917
   125
    </taskdef>
martin@5458
   126
    <imageloading userId="0" adminMode="true" propertiesFile="${base.config}/Openbravo.properties" basePath="${basedir}/../"
antonio@4917
   127
      imagePaths="web/images/CompanyLogo_big.png,web/images/SupportLogo_big.png,web/images/CompanyLogo_small.png,web/skins/Default/Login/initialOpenbravoLogo.png,web/images/CompanyLogo_big.png"
antonio@4917
   128
      propertyNames="yourCompanyLoginImage,yourItServiceLoginImage,yourCompanyMenuImage,yourCompanyBigImage,yourCompanyDocumentImage"/>
antonio@4917
   129
  </target>
carlos@0
   130
martin@2868
   131
  <target name="trl.clean" if="translation">
martin@2868
   132
    <java classname="org.openbravo.translate.Translate" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
asier@3980
   133
      <arg line="clean '${base.config}/Openbravo.properties'" />
martin@2868
   134
      <classpath refid="project.class.path" />
martin@2868
   135
    </java>
martin@2868
   136
  </target>
asier@5937
   137
  
asier@5937
   138
  <target name="trl.remove.unused" if="translation">
asier@5937
   139
    <java classname="org.openbravo.translate.Translate" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
asier@5937
   140
      <arg line="remove '${base.config}/Openbravo.properties'" />
asier@5937
   141
      <classpath refid="project.class.path" />
asier@5937
   142
    </java>
asier@5937
   143
  </target>
martin@2346
   144
martin@2868
   145
  <target name="clean" depends="trl.clean">
martin@2868
   146
    <property name="complete" value="true" />
martin@2868
   147
    <delete includeEmptyDirs="true" failonerror="false">
martin@2868
   148
      <fileset dir="${base.design}" />
martin@2868
   149
      <fileset dir="${build}" />
martin@2868
   150
      <fileset dir="${build.docs}" />
martin@2868
   151
      <fileset dir="${build.AD}" />
martin@2868
   152
      <fileset dir="${build.sqlc}" />
martin@2868
   153
      <fileset dir="${base.context}">
martin@2868
   154
        <exclude name=".svn" />
martin@2868
   155
        <exclude name="META-INF/MANIFEST.MF" />
juanpablo@3236
   156
        <exclude name="**/.keep" />
martin@2868
   157
      </fileset>
martin@2868
   158
    </delete>
martin@2868
   159
  </target>
carlos@0
   160
martin@2868
   161
  <target name="sqlc" depends="copy.srcClient">
asier@3189
   162
    <java classname="org.openbravo.data.Sqlc" fork="yes" jvm="${env.JAVA_HOME}/bin/java" maxmemory="${build.maxmemory}" failonerror="true">
martin@2868
   163
      <arg line="'${base.config}'/Openbravo.properties .xsql . '${build.sqlc}'/src" />
martin@2868
   164
      <classpath refid="project.class.path" />
martin@2868
   165
    </java>
asier@3189
   166
    <java classname="org.openbravo.data.Sqlc" fork="yes" jvm="${env.JAVA_HOME}/bin/java" maxmemory="${build.maxmemory}" failonerror="true">
martin@2868
   167
      <arg line="'${base.config}'/Openbravo.properties .xsql '${base.modules}' '${build.sqlc}'/src */src" />
stefan@5227
   168
      <jvmarg value="-Dsqlc.queryExecutionStrategy=traditional"/>
martin@2868
   169
      <classpath refid="project.class.path" />
martin@2868
   170
    </java>
martin@2868
   171
    <copy file="${base.src}/buildAD.xml" tofile="${build.AD}/build.xml" />
martin@2868
   172
    <copy file="${base.src}/log4j.lcf" tofile="${build.AD}/log4j.lcf" />
martin@2868
   173
    <ant dir="${build.AD}" target="buildAD" inheritAll="true" inheritRefs="true" />
martin@2868
   174
  </target>
carlos@0
   175
martin@2868
   176
  <target name="copy.srcClient">
martin@2868
   177
    <mkdir dir="${base.client.src}" />
martin@2868
   178
    <copy todir="${basedir}" overwrite="true" failonerror="false">
martin@2868
   179
      <fileset dir="${base.client.src}">
martin@2868
   180
        <exclude name="**/web.xml" />
martin@2868
   181
      </fileset>
martin@2868
   182
    </copy>
martin@2868
   183
  </target>
martin@2346
   184
martin@2868
   185
  <target name="clean.src.gen">
martin@2868
   186
    <delete includeEmptyDirs="true" failonerror="false">
juanpablo@3236
   187
      <fileset dir="${base.src.gen}" >
juanpablo@3236
   188
        <exclude name="**/.keep" />
juanpablo@3236
   189
      </fileset>
martin@2868
   190
    </delete>
martin@2868
   191
  </target>
martin@2868
   192
martin@2868
   193
  <target name="export.sample.data" description="Exports Sample Data">
martin@2868
   194
    <taskdef name="exportsampledata" classname="org.openbravo.service.db.ExportReferenceDataTask">
martin@2868
   195
      <classpath refid="project.class.path" />
martin@2868
   196
    </taskdef>
martin@2868
   197
    <echo message="Exporting sample reference data" />
martin@5458
   198
    <exportsampledata userId="0" adminMode="true" propertiesFile="${base.config}/Openbravo.properties" clients="SmallBazaar" />
martin@5458
   199
    <exportsampledata userId="0" adminMode="true" propertiesFile="${base.config}/Openbravo.properties" clients="Accounting Test" />
martin@2868
   200
  </target>
martin@2868
   201
martin@3058
   202
  <target name="import.sample.data" description="Import Sample Data" depends="generate.entities">
martin@2868
   203
    <taskdef name="importsampledata" classname="org.openbravo.service.db.ImportReferenceDataTask">
martin@2868
   204
      <classpath refid="project.class.path" />
martin@2868
   205
    </taskdef>
martin@2868
   206
    <echo message="Importing sample reference data" />
martin@5458
   207
    <importsampledata userId="0" adminMode="true" propertiesFile="${base.config}/Openbravo.properties" />
martin@2868
   208
    <ant dir="${base.db}" target="database.postupdate.${bbdd.rdbms}" inheritAll="true" inheritRefs="true" />
martin@2868
   209
  </target>
asier@1929
   210
martin@2868
   211
  <target name="generate.entities" depends="compile.src.gen,clean.src.gen">
martin@4287
   212
    <taskdef name="workflow" classpathref="project.class.path" classname="org.openbravo.base.gen.GenerateEntitiesTask" />
martin@2868
   213
    <!-- debug="true" will perform the in-memory model initialization before generating entities
asier@1929
   214
	if an error occurs then, then a stacktrace is printed. -->
martin@2868
   215
    <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@2868
   216
      <param name="ob.properties.location" value="${base.config}/Openbravo.properties" />
martin@2868
   217
      <param name="base.src.gen" value="${base.src.gen}" />
martin@2868
   218
      <classpath>
martin@2868
   219
        <path refid="project.class.path" />
martin@2868
   220
      </classpath>
martin@2868
   221
    </workflow>
martin@4106
   222
martin@4106
   223
    <!--
martin@4106
   224
    see issue: https://issues.openbravo.com/view.php?id=9331
martin@4106
   225
    Custom columns in standard tables should support a reference to a table in the module
martin@4106
   226
    if this occurs then possible the following javac has to be enabled instead of the two javacs below
martin@4106
   227
    <javac srcdir="${base.src}:${base.src.gen}" excludes="org/openbravo/base/*,org/openbravo/base/secureApp/**,org/openbravo/erpCommon/**,org/openbravo/erpReports/**,org/openbravo/scheduling/**,org/openbravo/service/web/**,org/openbravo/service/system/**,org/openbravo/service/rest/**,org/openbravo/service/db/**,org/openbravo/authentication/**,org/openbravo/services/**" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="true" debuglevel="lines,vars,source" deprecation="on">
martin@4106
   228
      <classpath refid="project.class.path" />
martin@4106
   229
    </javac>
martin@4106
   230
    -->
asier@3280
   231
    <javac srcdir="${base.src}:${base.src.gen}" includes="org/openbravo/model/**,org/openbravo/base/structure/**,org/openbravo/dal/**,org/openbravo/service/dataset/**" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="true" debuglevel="lines,vars,source" deprecation="on">
ivan@3322
   232
      <classpath refid="project.class.path" />
ivan@3322
   233
    </javac>
ivan@3322
   234
    <javac srcdir="${base.src.gen}" excludes="org/openbravo/model/**,org/openbravo/base/structure/**,org/openbravo/dal/**,org/openbravo/service/dataset/**" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="true" debuglevel="lines,vars,source" deprecation="on">
ivan@3322
   235
      <classpath refid="project.class.path" />
martin@2868
   236
    </javac>
martin@2868
   237
  </target>
martin@2830
   238
martin@2868
   239
  <!-- 
martin@2830
   240
		Generates entities only when the application dictionary has changed.
martin@2830
   241
		Difference with the generate.entities is that it does not clean the src-gen directory. The standard
martin@2830
   242
		GenerateEntitiesTask always checks if the AD was changed before regenerating. The check is to compare
martin@2830
   243
		the modified time of the generated sources with the updated time of the Application Dictionary. If there
martin@2830
   244
		is a source older than the last updated time of the Application Dictionary then the sources need to be regenerated.		
martin@2830
   245
	-->
martin@2868
   246
  <target name="generate.entities.quick" depends="compile.src.gen">
martin@2843
   247
martin@2868
   248
    <taskdef name="workflow" classpathref="project.class.path" classname="org.openbravo.base.gen.GenerateEntitiesTask" />
martin@2868
   249
    <!-- debug="true" will perform the in-memory model initialization before generating entities
martin@2830
   250
	if an error occurs then, then a stacktrace is printed. -->
martin@2868
   251
    <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@2868
   252
      <param name="ob.properties.location" value="${base.config}/Openbravo.properties" />
martin@2868
   253
      <param name="base.src.gen" value="${base.src.gen}" />
martin@2868
   254
      <classpath>
martin@2868
   255
        <path refid="project.class.path" />
martin@2868
   256
      </classpath>
martin@2868
   257
    </workflow>
martin@4106
   258
martin@4106
   259
    <!--
martin@4106
   260
      see issue: https://issues.openbravo.com/view.php?id=9331
martin@4106
   261
      Custom columns in standard tables should support a reference to a table in the module
martin@4106
   262
      if this occurs then possible the following javac has to be enabled instead of the two javacs below
martin@4106
   263
    <javac srcdir="${base.src}:${base.src.gen}" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="true" debuglevel="lines,vars,source" deprecation="on">
martin@4106
   264
      <classpath refid="project.class.path" />      
martin@4106
   265
    </javac>
martin@4106
   266
    -->
martin@2975
   267
    <javac srcdir="${base.src}:${base.src.gen}" includes="org/openbravo/model/**,org/openbravo/base/structure/**,org/openbravo/dal/**,org/openbravo/service/dataset/**" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="true" debuglevel="lines,vars,source" deprecation="on">
martin@2975
   268
      <classpath refid="project.class.path" />      
martin@2868
   269
    </javac>
ivan@3322
   270
    <javac srcdir="${base.src.gen}" excludes="org/openbravo/model/**,org/openbravo/base/structure/**,org/openbravo/dal/**,org/openbravo/service/dataset/**" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="true" debuglevel="lines,vars,source" deprecation="on">
ivan@3322
   271
      <classpath refid="project.class.path" />
ivan@3322
   272
    </javac>
martin@2868
   273
  </target>
juanpablo@131
   274
martin@3723
   275
  <target name="run.tests" depends="compileSqlc,generate.entities.quick">
martin@7346
   276
    
martin@7346
   277
    <copy todir="${build}">
martin@7346
   278
      <fileset dir="${base.src.test}" includes="**/*.xml" />
martin@7346
   279
    </copy>
martin@7346
   280
    
martin@3723
   281
    <junit printsummary="yes" haltonfailure="yes">
martin@3723
   282
      <classpath refid="project.class.path" />
martin@3723
   283
      <formatter type="plain" usefile="no"/>
martin@3754
   284
      <test name="org.openbravo.test.AntTaskTests" haltonfailure="no"/>
martin@3754
   285
    </junit>
martin@3754
   286
  </target>
martin@3754
   287
martin@3754
   288
  <target name="run.all.tests" depends="compileSqlc,generate.entities.quick">
martin@7346
   289
    
martin@7346
   290
    <copy todir="${build}">
martin@7346
   291
      <fileset dir="${base.src.test}" includes="**/*.xml" />
martin@7346
   292
    </copy>
martin@7346
   293
martin@3754
   294
    <junit printsummary="yes" haltonfailure="yes">
martin@3754
   295
      <classpath refid="project.class.path" />
martin@3754
   296
      <formatter type="plain" usefile="no"/>
ivan@3873
   297
      <test name="org.openbravo.test.AllAntTaskTests" haltonfailure="no" outfile="result">
ivan@3873
   298
	    <formatter type="xml" />
ivan@3873
   299
	  </test>
martin@3723
   300
    </junit>
martin@3723
   301
  </target>
martin@3723
   302
martin@3723
   303
  <target name="run.quick.tests" depends="compileSqlc,generate.entities.quick">
martin@7346
   304
    
martin@7346
   305
    <copy todir="${build}">
martin@7346
   306
      <fileset dir="${base.src.test}" includes="**/*.xml" />
martin@7346
   307
    </copy>
martin@7346
   308
    
martin@3723
   309
    <junit printsummary="yes" haltonfailure="yes">
martin@3723
   310
      <classpath refid="project.class.path" />
martin@3723
   311
      <formatter type="plain" usefile="no"/>
martin@3723
   312
      <test name="org.openbravo.test.AllQuickAntTaskTests" haltonfailure="no"/>
martin@3723
   313
    </junit>
martin@3723
   314
  </target>
ivan@3850
   315
priya@6948
   316
  <target name="run.webservice.tests" depends="compileSqlc,generate.entities.quick">
martin@7346
   317
    
martin@7346
   318
    <copy todir="${build}">
martin@7346
   319
      <fileset dir="${base.src.test}" includes="**/*.xml" />
martin@7346
   320
    </copy>
martin@7346
   321
priya@6948
   322
    <junit printsummary="yes" haltonfailure="yes">
priya@6948
   323
      <classpath refid="project.class.path" />
priya@6948
   324
      <formatter type="plain" usefile="no"/>
priya@6966
   325
      <test name="org.openbravo.test.AllWebserviceTests" haltonfailure="yes"/>
priya@6948
   326
    </junit>
priya@6948
   327
  </target>
priya@6948
   328
stefan@3934
   329
  <target name="run.api.test.javascript">
ivan@3850
   330
  	<taskdef name="jstest" classname="org.openbravo.test.javascript.JavaScriptAntTest" classpathref="project.class.path" />
ivan@4648
   331
	<property name="export" value="no" />
ivan@4648
   332
	<jstest apiDetailsPath="${api.test.javascript.details}" jsPath="${base.web}/js" export="${export}" />
ivan@3850
   333
  </target>
martin@3723
   334
  
martin@2868
   335
  <target name="compileSqlc" depends="sqlc">
antonio@6986
   336
    <javac  srcdir="${basedir}:${build.sqlc}/src:${build.sqlc}/srcAD:${base.src.test}:${base.modules}" excludes="${base.modules}/*/src-wad/**,${base.modules}/*/src-util/**" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="true" debuglevel="lines,vars,source" nowarn="${friendlyWarnings}">
asier@2967
   337
      <classpath refid="project.class.path" />
asier@2967
   338
    </javac>
antonio@6986
   339
antonio@6986
   340
    <javac srcdir="${build.AD}" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="true" debuglevel="lines,vars,source" nowarn="${friendlyWarnings}">
martin@2868
   341
      <classpath refid="project.class.path" />
martin@2868
   342
    </javac>
asier@4277
   343
  	<antcall target="calculate.version"/>
martin@2868
   344
  </target>
antonio@5595
   345
asier@4277
   346
	<target name="calculate.version" depends="init">
asier@4277
   347
	  <condition property="revision.from.file">
asier@4277
   348
		<and>
asier@4277
   349
		  <not>
asier@4277
   350
		 	<isset property="hg.id"/>
asier@4277
   351
		  </not>
asier@4277
   352
		  <available file="${basedir}/config/instance.revision"/>
asier@4277
   353
	    </and>
asier@4277
   354
	  </condition>
asier@4277
   355
	  <antcall inheritall="true" target="calculate.instance.version"/>
asier@4277
   356
	</target>
asier@4277
   357
	<target name="calculate.instance.version" depends="calculate.version.from.hg, calculate.version.from.file">
asier@4277
   358
	    <sql driver="${bbdd.driver}" url="${bbdd.owner.url}" userid="${bbdd.user}" password="${bbdd.password}" delimiter="/">
asier@4277
   359
	      <classpath>
asier@4277
   360
	        <fileset dir="${base.lib}">
asier@4277
   361
	          <include name="**/*.jar">
asier@4277
   362
	          </include>
asier@4277
   363
	        </fileset>
asier@4277
   364
	      </classpath>
asier@4277
   365
	      <transaction>
asier@4277
   366
		        UPDATE AD_MODULE 
asier@4277
   367
	      	       SET VERSION_ID='${instance.version}'
asier@4277
   368
                 WHERE AD_MODULE_ID='0'
asier@4277
   369
		      </transaction>
asier@4277
   370
	    </sql>
asier@4277
   371
	</target>
asier@4277
   372
	<target name="calculate.version.from.hg" if="is.hg">
asier@4277
   373
	  <property name="instance.version" value="${hg.id}"/>
asier@4277
   374
	</target>
asier@4277
   375
	<target name="calculate.version.from.file" if="revision.from.file">
asier@4277
   376
		<loadfile property="instance.version" srcfile="${basedir}/config/instance.revision"/>
asier@4277
   377
	</target>
martin@2346
   378
martin@2868
   379
  <target name="compile.src.gen" depends="init">
asier@2966
   380
    <javac srcdir="${basedir}" includes="org/openbravo/base/exception/**,org/openbravo/base/gen/**,org/openbravo/base/expression/**,org/openbravo/base/provider/**,org/openbravo/base/model/**,org/openbravo/base/session/**,org/openbravo/base/validation/**,org/openbravo/base/util/**" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="true" debuglevel="lines,vars,source" deprecation="on">
martin@2868
   381
      <classpath refid="project.class.path" />
martin@2868
   382
    </javac>
martin@2868
   383
    <copy todir="${build}">
martin@2868
   384
      <fileset dir="${basedir}" includes="**/*.hbm.xml" />
martin@2868
   385
    </copy>
martin@2868
   386
    <copy todir="${build}">
martin@2868
   387
      <fileset dir="${basedir}" includes="**/*.properties" />
martin@2868
   388
    </copy>
martin@6163
   389
    
martin@6163
   390
    <!-- also compile the domaintypes in modules -->
antonio@7537
   391
    <javac srcdir="${basedir}/../" includes="modules/*/src/**/model/domaintype/**/*.java" destdir="${build}"  fork="true" deprecation="on" encoding="UTF-8" debug="true" debuglevel="lines,vars,source">
martin@6163
   392
      <classpath refid="project.class.path" />
martin@6163
   393
    </javac>
martin@6163
   394
    
martin@6163
   395
    <!-- copy all configuration files in modules to the output path also -->
martin@6163
   396
    <copy todir="${build}" encoding="UTF-8">
martin@6163
   397
      <fileset dir="${base.modules}">
martin@6163
   398
          <include name="*/src/**/*" />
martin@6163
   399
          <exclude name="*/src/**/*.java" />
martin@6163
   400
          <exclude name="*/src/**/*.xsql" />
martin@6163
   401
      </fileset>
martin@6163
   402
      <mapper type="regexp" from="(.*\${file.separator}src)(.*)" to="\2" />
martin@6163
   403
    </copy>
martin@2868
   404
  </target>
martin@2346
   405
asier@5532
   406
  <target name="wadvalidation">
asier@5535
   407
    <taskdef name="WADValidation" classname="org.openbravo.wad.validation.WADValidatorTask">
asier@5532
   408
            <classpath refid="project.class.path" />
asier@5532
   409
          </taskdef>
asier@5532
   410
        
asier@5532
   411
        <WADValidation propertiesFile="${base.config}/Openbravo.properties"
asier@5532
   412
                       modules="${module}"
antonio@5700
   413
                       stoponerror="${stopOnWadError}"
antonio@5700
   414
                       friendlyWarnings="${friendlyWarnings}"/>
asier@5532
   415
  </target>
asier@5532
   416
  
asier@5532
   417
  <target name="wad" depends="init, wadvalidation">
asier@5265
   418
    <java classname="org.openbravo.wad.Wad" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}" failonerror="true">
asier@5532
   419
      <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}' 'noquick'" />
martin@2868
   420
      <classpath refid="project.class.path" />
martin@2868
   421
    </java>
martin@2868
   422
    <antcall target="postwad" inheritall="true" inheritrefs="true" />
martin@2868
   423
  </target>
martin@2346
   424
asier@5532
   425
  <target name="wad.quick" depends="init, wadvalidation">
martin@2868
   426
    <java classname="org.openbravo.wad.Wad" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
asier@5532
   427
      <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'" />
martin@2868
   428
      <classpath refid="project.class.path" />
martin@2868
   429
    </java>
martin@2868
   430
    <antcall target="postwad" inheritall="true" inheritrefs="true" />
martin@2868
   431
  </target>
asier@1929
   432
martin@2868
   433
  <target name="postsrc" depends="postsrc.modules">
antonio@5620
   434
martin@2868
   435
    <copy todir="${build}">
martin@2868
   436
      <fileset dir="${basedir}" includes="**/*.properties" />
martin@2868
   437
    </copy>
martin@2868
   438
    <copy todir="${build}">
martin@2868
   439
      <fileset dir="${basedir}" includes="**/*.xslt" />
martin@2868
   440
    </copy>
martin@2868
   441
    <copy todir="${build}">
martin@2868
   442
      <fileset dir="${basedir}" includes="**/*.hbm.xml" />
martin@2868
   443
    </copy>
martin@2868
   444
    <copy todir="${base.design}/design">
martin@2868
   445
      <fileset dir="${basedir}" includes="**/*.xml" />
martin@2868
   446
    </copy>
martin@2868
   447
    <copy todir="${base.design}/design">
martin@2868
   448
      <fileset dir="${basedir}" includes="**/*.fo" />
martin@2868
   449
    </copy>
martin@2868
   450
    <copy todir="${base.design}/design">
martin@2868
   451
      <fileset dir="${basedir}" includes="**/*.html" />
martin@2868
   452
    </copy>
martin@2868
   453
    <copy todir="${base.design}/design">
martin@2868
   454
      <fileset dir="${basedir}" includes="**/*.srpt" />
martin@2868
   455
    </copy>
martin@2868
   456
    <copy todir="${base.design}/design">
martin@2868
   457
      <fileset dir="${basedir}" includes="**/*.jrxml" />
martin@2868
   458
    </copy>
martin@2868
   459
    <copy todir="${base.design}/design">
martin@2868
   460
      <fileset dir="${basedir}" includes="**/*.jasper" />
martin@2868
   461
    </copy>
martin@2868
   462
    <copy todir="${build}">
martin@2868
   463
      <fileset file="${base.config}/quartz.properties" />
martin@2868
   464
    </copy>
martin@2868
   465
    <antcall target="build.local.context" inheritAll="true" inheritrefs="true" />
martin@2868
   466
  </target>
asier@1929
   467
martin@2868
   468
  <target name="postsrc.modules">
martin@2868
   469
    <copy todir="${base.design}/design">
martin@2868
   470
      <fileset dir="${base.modules}">
martin@2868
   471
        <include name="*/src/**/*.xml" />
martin@2868
   472
        <include name="*/src/**/*.fo" />
martin@2868
   473
        <include name="*/src/**/*.html" />
martin@2868
   474
        <include name="*/src/**/*.srpt" />
martin@2868
   475
        <include name="*/src/**/*.jrxml" />
martin@2868
   476
        <include name="*/src/**/*.jasper" />
martin@2868
   477
      </fileset>
martin@2868
   478
      <mapper type="regexp" from="(.*\${file.separator}src)(.*)" to="\2" />
martin@2868
   479
    </copy>
martin@6160
   480
    <copy todir="${build}">
martin@6160
   481
      <fileset dir="${base.modules}">
martin@6160
   482
        <include name="*/src/**" />
martin@6160
   483
        <exclude name="*/src/**/*.java" />
martin@6160
   484
      </fileset>
martin@6160
   485
      <mapper type="regexp" from="(.*\${file.separator}src)(.*)" to="\2" />
martin@6160
   486
    </copy>
martin@2868
   487
  </target>
asier@1929
   488
martin@2868
   489
  <!-- FIXME: These tasks is only for development and testing purposes, remove it afterwards-->
martin@2868
   490
  <target name="sqlcmod" depends="copy.srcClient">
asier@3189
   491
    <java classname="org.openbravo.data.Sqlc" fork="yes" jvm="${env.JAVA_HOME}/bin/java" maxmemory="${build.maxmemory}" failonerror="true">
martin@2868
   492
      <arg line="'${base.config}'/Openbravo.properties .xsql '${base.modules}' '${build.sqlc}'/src */src" />
martin@2868
   493
      <classpath refid="project.class.path" />
martin@2868
   494
    </java>
martin@2868
   495
  </target>
asier@1929
   496
martin@2868
   497
  <target name="compileSqlcmod" depends="sqlcmod">
martin@2868
   498
    <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@2868
   499
      <classpath refid="project.class.path" />
martin@2868
   500
    </javac>
martin@2868
   501
  </target>
martin@2868
   502
  <target name="postsrcmod">
martin@2868
   503
    <copy todir="${base.design}/design">
martin@2868
   504
      <fileset dir="${base.modules}" includes="*/src/**/*.html" />
martin@2868
   505
      <mapper type="regexp" from="(.*\${file.separator}src)(.*)" to="\2" />
martin@2868
   506
    </copy>
martin@2868
   507
  </target>
asier@1929
   508
martin@2868
   509
  <!-- end of auxiliar tasks-->
martin@2346
   510
martin@2868
   511
  <target name="build.local.context">
martin@2868
   512
    <copy todir="${base.context}" encoding="UTF-8">
martin@2868
   513
      <fileset file="${basedir}/index.html" />
martin@2868
   514
    </copy>
martin@2868
   515
    <copy todir="${base.context}/WEB-INF" encoding="UTF-8">
martin@2868
   516
      <fileset file="${build.sqlc}/src/web.xml" />
martin@2868
   517
      <fileset dir="${base.config}">
martin@2868
   518
        <exclude name="**/eclipse/**" />
martin@2868
   519
        <exclude name="**/setup-properties**" />
martin@2868
   520
        <exclude name="*.template" />
asier@2974
   521
        <exclude name="checksums"/>
martin@2868
   522
      </fileset>
martin@2868
   523
    </copy>
martin@2868
   524
    <copy todir="${base.context}/WEB-INF" encoding="UTF-8">
martin@2868
   525
      <fileset dir="${base.modules}">
martin@2868
   526
        <include name="*/config/**" />
martin@2868
   527
        <exclude name="*.template" />
martin@2868
   528
      </fileset>
martin@2868
   529
      <mapper type="regexp" from="(.*\${file.separator}config)(.*)" to="\2" />
martin@2868
   530
    </copy>
martin@2868
   531
    <copy todir="${base.context}/WEB-INF/lib" encoding="UTF-8">
martin@2868
   532
      <fileset dir="${base.lib}/runtime">
martin@2868
   533
        <exclude name="openbravo-wad.jar" />
martin@2868
   534
        <exclude name="openbravo-trl.jar" />
martin@2868
   535
        <exclude name="servlet-api.jar" />
martin@2868
   536
        <exclude name="*.war" />
martin@2868
   537
      </fileset>
martin@2868
   538
      <fileset dir="${base.db}/lib">
martin@2868
   539
        <include name="*" />
martin@2868
   540
      </fileset>
martin@2868
   541
    </copy>
martin@2346
   542
martin@2868
   543
    <copy todir="${base.context}/WEB-INF/lib" encoding="UTF-8">
martin@2868
   544
      <fileset dir="${base.modules}">
martin@2868
   545
        <include name="*/lib/runtime/**" />
martin@2868
   546
      </fileset>
martin@2868
   547
      <mapper type="regexp" from="(.*\${file.separator}lib\${file.separator}runtime)(.*)" to="\2" />
martin@2868
   548
    </copy>
martin@2868
   549
    <antcall target="build.web.folder" inheritAll="true" inheritrefs="true" />
martin@2868
   550
  </target>
martin@2346
   551
martin@2868
   552
  <target name="build.web.folder">
martin@2868
   553
    <copy todir="${base.context}/web" encoding="UTF-8">
martin@2868
   554
      <fileset dir="${base.web}">
martin@2868
   555
        <include name="*/**" />
martin@2868
   556
        <exclude name="skins/**" />
martin@2868
   557
      </fileset>
martin@2868
   558
    </copy>
asier@2994
   559
    
asier@2994
   560
    <taskdef name="CheckSumCondition" classname="org.openbravo.utils.CheckSumCondition">
asier@2994
   561
        <classpath refid="project.class.path" />
asier@2994
   562
      </taskdef>
asier@2994
   563
    
asier@2994
   564
    <CheckSumCondition obDir="${basedir}/.."
asier@2994
   565
                       type="md5.skins"
asier@2994
   566
                       property="changes.in.md5.skins"/>
asier@2994
   567
    <condition property="do.skins">
asier@2994
   568
      <or>
asier@2994
   569
        <istrue value="${changes.in.md5.skins}" />
asier@2994
   570
        <not>
asier@3013
   571
          <istrue value="${smart.mode}"/>
asier@2994
   572
        </not>
asier@2994
   573
      </or>
asier@2994
   574
    </condition>
asier@2994
   575
    
asier@2994
   576
    <antcall target="build.web.folder.skins"  inheritAll="true" inheritrefs="true" />
asier@2994
   577
    
asier@2994
   578
    <condition property="generateSpritesBool">
asier@2994
   579
        <istrue value="${generateSprites}" />
asier@2994
   580
    </condition>
asier@2994
   581
    <antcall target="generate.sprites" inheritAll="true" inheritrefs="true" />
asier@2994
   582
    <antcall target="minimizeJSandCSS" inheritAll="true" inheritrefs="true" />
asier@2994
   583
  </target>
asier@2994
   584
    
martin@2346
   585
asier@2994
   586
  <target name="build.web.folder.skins" if="do.skins">
asier@2994
   587
asier@2994
   588
    <delete includeEmptyDirs="true" dir="${base.context}/web/skins" quiet="yes" />
asier@2994
   589
    <mkdir dir="${base.context}/web" />
martin@2868
   590
    <mkdir dir="${base.context}/web/skins" />
martin@2868
   591
    <mkdir dir="${base.context}/web/skins/ltr" />
martin@2868
   592
    <copy todir="${base.context}/web/skins/ltr" encoding="UTF-8">
martin@2868
   593
      <fileset dir="${base.web}/skins" />
martin@2868
   594
    </copy>
martin@2868
   595
    <mkdir dir="${base.context}/web/skins/rtl" />
martin@2868
   596
    <copy todir="${base.context}/web/skins/rtl" encoding="UTF-8">
martin@2868
   597
      <fileset dir="${base.web}/skins" />
martin@2868
   598
    </copy>
martin@2346
   599
martin@2868
   600
    <copy todir="${base.context}/web" encoding="UTF-8">
martin@2868
   601
      <fileset dir="${base.modules}">
martin@2868
   602
        <include name="*/web/*/**" />
david@5270
   603
        <exclude name="*/web/*/skins/**" />
martin@2868
   604
      </fileset>
martin@2868
   605
      <mapper type="regexp" from="(.*)(\${file.separator}web)(.*)" to="\3" />
martin@2868
   606
    </copy>
martin@2346
   607
martin@2868
   608
    <copy todir="${base.context}/web/skins/ltr" encoding="UTF-8">
martin@2868
   609
      <fileset dir="${base.modules}">
david@5270
   610
        <include name="*/web/*/skins/**" />
martin@2868
   611
      </fileset>
asier@3604
   612
      <mapper type="regexp" from="(.*)(\${file.separator}web)(.*\${file.separator})(skins\${file.separator})(.*)" to="\3\5" />
martin@2868
   613
    </copy>
carlos@0
   614
martin@2868
   615
    <copy todir="${base.context}/web/skins/rtl" encoding="UTF-8">
martin@2868
   616
      <fileset dir="${base.modules}">
david@5270
   617
        <include name="*/web/*/skins/**" />
martin@2868
   618
      </fileset>
asier@3604
   619
      <mapper type="regexp" from="(.*)(\${file.separator}web)(.*\${file.separator})(skins\${file.separator})(.*)" to="\3\5" />
martin@2868
   620
    </copy>
stefan@2143
   621
martin@2868
   622
    <java classname="org.openbravo.translate.RTLSkin" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
david@3771
   623
      <arg line="${base.context}/web/skins/rtl ${base.context}/web/skins/ltr" />
martin@2868
   624
      <classpath refid="project.class.path" />
martin@2868
   625
    </java>
asier@2994
   626
    
martin@2868
   627
  </target>
juanpablo@131
   628
martin@2868
   629
  <target name="generate.sprites" description="Performs CSS sprite processing" if="generateSpritesBool">
martin@2868
   630
    <property name="skins.location" location="${base.context}/web/skins/" />
martin@2868
   631
    <taskdef name="smartsprites" classname="org.carrot2.labs.smartsprites.ant.SmartSpritesTask">
martin@2868
   632
      <classpath refid="project.class.path" />
martin@2868
   633
    </taskdef>
martin@2868
   634
    <smartsprites rootdir="${skins.location}" documentrootdir="${skins.location}" outputdir="${skins.location}" cssfilesuffix="-sprite" csspropertyindent="  " loglevel="WARN" spritepngdepth="DIRECT" spritepngie6="false" />
martin@2868
   635
    <move todir="${skins.location}">
martin@2868
   636
      <fileset dir="${skins.location}">
martin@2868
   637
        <include name="*/*-sprite.css" />
martin@2868
   638
        <include name="*/*/*-sprite.css" />
martin@2868
   639
      </fileset>
martin@2868
   640
      <mapper type="glob" from="*-sprite.css" to="*.css" />
martin@2868
   641
    </move>
martin@2868
   642
  </target>
juanpablo@131
   643
martin@2868
   644
  <target name="minimizeJSandCSS" description="minimize JS and CSS files" if="minimizeJSandCSSbool">
martin@2868
   645
    <yuicompress linebreak="300" warn="false" munge="yes" preserveallsemicolons="true" outputfolder="${base.context}/web" charset="UTF-8">
martin@2868
   646
      <fileset dir="${base.web}">
martin@2868
   647
        <include name="**/*.js" />
martin@2868
   648
        <include name="**/*.css" />
martin@2868
   649
        <!-- The following scripts break in minification process -->
martin@2868
   650
        <exclude name="**/js/dojo/src/docs.js" />
martin@2868
   651
        <exclude name="**/js/dojo/src/hostenv_jsc.js" />
martin@2868
   652
        <exclude name="**/js/jscalendar/lang/calendar-al.js" />
martin@2868
   653
        <exclude name="**/js/jscalendar/lang/calendar-he-utf8.js" />
martin@2868
   654
        <exclude name="**/js/jscalendar/lang/calendar-hr.js" />
martin@2868
   655
        <exclude name="**/js/xinha/lang/**" />
martin@2868
   656
        <exclude name="**/js/xinha/plugins/**" />
martin@2868
   657
        <!-- dojotoolkit files are already compressd -->
martin@2868
   658
        <exclude name="**/dojotoolkit/**" />
martin@2868
   659
        <!-- from old dojo, only compress main file -->
martin@2868
   660
        <exclude name="**/dojo/**" />
martin@2868
   661
        <include name="js/dojo/dojo.js" />
martin@2868
   662
      </fileset>
martin@2868
   663
    </yuicompress>
martin@2868
   664
  </target>
david@1883
   665
martin@2868
   666
  <target name="postwad">
martin@2868
   667
    <copy todir="${base.design}/design">
martin@2868
   668
      <fileset dir="${build.AD}" includes="**/*.xml" />
martin@2868
   669
    </copy>
martin@2868
   670
    <copy todir="${base.design}/design">
martin@2868
   671
      <fileset dir="${build.AD}" includes="**/*.fo" />
martin@2868
   672
    </copy>
martin@2868
   673
    <copy todir="${base.design}/design">
martin@2868
   674
      <fileset dir="${build.AD}" includes="**/*.html" />
martin@2868
   675
    </copy>
martin@2868
   676
    <copy todir="${base.design}/design">
martin@2868
   677
      <fileset dir="${build.AD}" includes="**/*.srpt" />
martin@2868
   678
    </copy>
martin@2868
   679
    <copy todir="${base.design}/design">
martin@2868
   680
      <fileset dir="${build.AD}" includes="**/*.jrxml" />
martin@2868
   681
    </copy>
martin@2868
   682
    <copy todir="${base.design}/design">
martin@2868
   683
      <fileset dir="${build.AD}" includes="**/*.jasper" />
martin@2868
   684
    </copy>
martin@2868
   685
  </target>
martin@2346
   686
carlos@0
   687
asier@5937
   688
  <target name="eclipse.compile.complete" depends="clean,generate.entities,wad,sqlc,postsrc,translate, trl.remove.unused">
martin@2868
   689
    <antcall target="update.build.timestamp" />
martin@2868
   690
  </target>
martin@2868
   691
martin@2868
   692
  <target name="eclipse.compile" depends="wad,sqlc, postsrc, translate">
martin@2868
   693
  </target>
martin@2868
   694
martin@2868
   695
  <target name="compile.src" depends="compileSqlc, postsrc, copy.files">
martin@2868
   696
  </target>
martin@2868
   697
asier@5937
   698
  <target name="compile.complete" depends="clean,generate.entities,wad,compileSqlc,postsrc,translate, trl.remove.unused">
martin@2868
   699
    <antcall target="update.build.timestamp" />
martin@2868
   700
  </target>
martin@2868
   701
martin@2868
   702
asier@3013
   703
  <target name="smartbuild.new.wad" if="new.wad">
martin@2868
   704
    <antcall inheritall="true" inheritrefs="true" target="wad" />
asier@2854
   705
    <taskdef name="updateWADmd5" classname="org.openbravo.utils.WADCheckSumTask">
asier@2854
   706
      <classpath refid="project.class.path" />
asier@2854
   707
    </taskdef>
martin@2868
   708
    <updateWADmd5 obDir="${basedir}/.." />
martin@2868
   709
  </target>
asier@2854
   710
asier@3013
   711
  <target name="smartbuild.no.new.wad" unless="new.wad">
martin@2868
   712
    <antcall inheritall="true" inheritrefs="true" target="wad.quick" />
asier@2974
   713
  </target>
asier@2974
   714
asier@3013
   715
  <target name="smartbuild">
asier@3013
   716
    <antcall inheritall="true" inheritrefs="true" target="smartbuild.new.wad" />
asier@3013
   717
    <antcall inheritall="true" inheritrefs="true" target="smartbuild.no.new.wad" />
martin@2868
   718
    <antcall inheritall="true" inheritrefs="true" target="compileSqlc" />
martin@2868
   719
    <antcall inheritall="true" inheritrefs="true" target="postsrc" />
martin@2868
   720
    <antcall inheritall="true" inheritrefs="true" target="translate" />
martin@2868
   721
    <antcall inheritall="true" inheritrefs="true" target="update.build.timestamp" />
martin@2868
   722
  </target>
carlos@0
   723
martin@2868
   724
  <target name="translate" if="translation">
martin@2868
   725
    <antcall inheritall="true" inheritrefs="true" target="compile.translate">
martin@2868
   726
      <param name="extension" value="html" />
martin@2868
   727
    </antcall>
martin@2868
   728
    <antcall inheritall="true" inheritrefs="true" target="compile.translate">
martin@2868
   729
      <param name="extension" value="fo" />
martin@2868
   730
    </antcall>
martin@2868
   731
    <antcall inheritall="true" inheritrefs="true" target="compile.translate">
martin@2868
   732
      <param name="extension" value="srpt" />
martin@2868
   733
    </antcall>
martin@2868
   734
    <antcall inheritall="true" inheritrefs="true" target="compile.translate">
martin@2868
   735
      <param name="extension" value="jrxml" />
martin@2868
   736
    </antcall>
martin@2868
   737
    <antcall inheritall="true" inheritrefs="true" target="translate.modules" />
martin@2868
   738
  </target>
carlos@0
   739
martin@2868
   740
  <target name="compile" depends="wad,compileSqlc, postsrc, translate">
martin@2868
   741
  </target>
asier@1929
   742
martin@2868
   743
  <target name="translate.modules" if="translation">
martin@2868
   744
    <antcall inheritall="true" inheritrefs="true" target="compile.translate.modules">
martin@2868
   745
      <param name="extension" value="html" />
martin@2868
   746
    </antcall>
martin@2868
   747
    <antcall inheritall="true" inheritrefs="true" target="compile.translate.modules">
martin@2868
   748
      <param name="extension" value="fo" />
martin@2868
   749
    </antcall>
martin@2868
   750
    <antcall inheritall="true" inheritrefs="true" target="compile.translate.modules">
martin@2868
   751
      <param name="extension" value="srpt" />
martin@2868
   752
    </antcall>
martin@2868
   753
    <antcall inheritall="true" inheritrefs="true" target="compile.translate.modules">
martin@2868
   754
      <param name="extension" value="jrxml" />
martin@2868
   755
    </antcall>
martin@2868
   756
  </target>
asier@1929
   757
martin@2868
   758
  <target name="compile.translate.modules">
martin@2868
   759
    <java classname="org.openbravo.translate.Translate" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
asier@3980
   760
      <arg line="'${base.config}/Openbravo.properties' ${extension} '${base.modules}' '*/src'" />
martin@2868
   761
      <classpath refid="project.class.path" />
martin@2868
   762
    </java>
martin@2868
   763
  </target>
carlos@0
   764
martin@2868
   765
  <target name="installWebService" depends="init" if="wsdd">
asier@4307
   766
    <taskdef name="wsAdmin" classname="org.openbravo.erpCommon.utility.WebServiceAdmin">
martin@2868
   767
      <classpath refid="project.class.path" />
asier@4307
   768
    </taskdef>
asier@4307
   769
    <wsAdmin axisServlet="${context.url}/servlet/AxisServlet"
asier@4307
   770
             baseDir="${source.path}"
asier@4307
   771
             action="deploy"/>
martin@2868
   772
  </target>
carlos@0
   773
asier@4307
   774
  <target name="uninstallWebService" depends="init">
asier@4307
   775
    <taskdef name="wsAdmin" classname="org.openbravo.erpCommon.utility.WebServiceAdmin">
asier@4307
   776
      <classpath refid="project.class.path" />
asier@4307
   777
    </taskdef>
asier@4307
   778
    <wsAdmin axisServlet="${context.url}/servlet/AxisServlet"
asier@4307
   779
             baseDir="${source.path}"
asier@4307
   780
             action="undeploy"/>
asier@4307
   781
  </target>
carlos@0
   782
martin@2868
   783
  <target name="compile.translate">
martin@2868
   784
    <java classname="org.openbravo.translate.Translate" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
asier@3980
   785
      <arg line="'${base.config}/Openbravo.properties' ${extension} '${basedir}'" />
martin@2868
   786
      <classpath refid="project.class.path" />
martin@2868
   787
    </java>
martin@2868
   788
  </target>
carlos@0
   789
asier@7208
   790
  <target name="copy.files" if="mode.class">
martin@2868
   791
    <mkdir dir="${jakarta.base}/webapps/${context.name}" />
martin@2868
   792
    <copy todir="${jakarta.base}/webapps/${context.name}" encoding="UTF-8">
martin@2868
   793
      <fileset dir="${base.context}" />
martin@2868
   794
    </copy>
martin@2868
   795
    <mkdir dir="${jakarta.base}/webapps/${context.name}/WEB-INF/classes" />
martin@2868
   796
    <copy todir="${jakarta.base}/webapps/${context.name}/WEB-INF/classes" encoding="UTF-8">
martin@2868
   797
      <fileset dir="${build}" />
martin@2868
   798
    </copy>
asier@7208
   799
    <mkdir dir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib" />
asier@7208
   800
      <copy todir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib" file="${build.core.lib}/openbravo-core.jar" encoding="UTF-8">
asier@7208
   801
    </copy>
martin@2868
   802
  </target>
ivan@1738
   803
martin@2868
   804
  <target name="compile.development" depends="generate.entities, compile, copy.files">
martin@2868
   805
  </target>
asier@1929
   806
martin@2868
   807
  <target name="compile.complete.development" depends="compile.complete, copy.files">
antonio@5620
   808
    <updatesystemstatus v="RB51"/>
martin@2868
   809
  </target>
asier@1929
   810
martin@2868
   811
  <target name="compile.web" depends="build.web.folder">
martin@2868
   812
  </target>
asier@1929
   813
martin@2868
   814
  <target name="compile.web.development" depends="build.web.folder, copy.files">
martin@2868
   815
  </target>
asier@1929
   816
martin@2868
   817
  <target name="build.war">
martin@2868
   818
    <delete failonerror="false" file="${base.lib}/${context.name}.war" />
martin@2868
   819
    <war compress="true" destfile="${base.lib}/${context.name}.war" encoding="UTF-8" webxml="${base.context}/WEB-INF/web.xml">
martin@2868
   820
      <zipfileset dir="${base.context}">
martin@2868
   821
        <exclude name="**/WEB-INF/web.xml" />
martin@2868
   822
        <exclude name="**/WEB-INF/lib/servlet-api.jar" />
martin@2868
   823
      </zipfileset>
martin@2868
   824
      <classes dir="${build}" />
martin@2868
   825
    </war>
antonio@6504
   826
    <updatesystemstatus v="RB51"/>
martin@2868
   827
  </target>
martin@2868
   828
martin@2868
   829
  <target name="generate-wsdd">
martin@2868
   830
    <delete failonerror="false">
martin@2868
   831
      <fileset dir="${base.src}/org/openbravo/services/webservice" includes="**/*" />
martin@2868
   832
    </delete>
martin@2868
   833
martin@2868
   834
    <mkdir dir="${build}" />
ivan@5062
   835
     <axis-wsdl2java output="${base.src}" verbose="false" url="http://centralrepository.openbravo.com/openbravo/services/WebService2?wsdl" serverside="true" debug="false">
ivan@5062
   836
      <mapping namespace="http://centralrepository.openbravo.com/openbravo/services/WebService2" package="org.openbravo.services.webservice" />
asier@5027
   837
      <mapping namespace="/services/WebService2" package="org.openbravo.services.webservice" />
martin@2868
   838
    </axis-wsdl2java>
martin@2868
   839
  </target>
martin@2868
   840
antonio@3372
   841
  <target name="update.build.timestamp" unless="timestamp">
martin@2868
   842
    <sql driver="${bbdd.driver}" url="${bbdd.owner.url}" userid="${bbdd.user}" password="${bbdd.password}" delimiter="/">
martin@2868
   843
      <classpath>
martin@2868
   844
        <fileset dir="${base.lib}">
martin@2868
   845
          <include name="**/*.jar">
martin@2868
   846
          </include>
martin@2868
   847
        </fileset>
martin@2868
   848
      </classpath>
martin@2868
   849
      <transaction>
asier@2819
   850
	        UPDATE AD_SYSTEM_INFO SET LAST_BUILD=NOW()
asier@2819
   851
	      </transaction>
martin@2868
   852
    </sql>
martin@2868
   853
  </target>
asier@1929
   854
carlos@0
   855
</project>