src/build.xml
author Carlos Romero <carlos.romero@openbravo.com>
Tue, 06 Nov 2007 08:33:31 +0000
changeset 0 0247c26f10c6
child 8 10b4fc1ea5b4
permissions -rw-r--r--
Modified PostgreSQL post script in order to include C_DEBT_PAYMENT_GENERATE modification tules
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@0
    15
 * The Initial Developer of the Original Code is [Autores] and Openbravo SL 
carlos@0
    16
 * All portions are Copyright (C) 2005-2006 Openbravo SL 
carlos@0
    17
 * All Rights Reserved. 
carlos@0
    18
 * Contributor(s): Openbravo S.L.
carlos@0
    19
 ************************************************************************
carlos@0
    20
-->
carlos@0
    21
carlos@0
    22
<project name="openbravo sources" default="compile" basedir=".">
carlos@0
    23
  <property name="webTab" value="all"/>
carlos@0
    24
  <property name="tab" value="%"/>
carlos@0
    25
  <property name="base.language" value="${base.source}/src"/>
carlos@0
    26
  <property name="base.translate.structure" value="org/openbravo/erpWindows"/>
carlos@0
    27
  <property name="client.web.xml" value="${base.client.src}/web.xml"/>
carlos@0
    28
  <property name="package" value="/org"/>
carlos@0
    29
  <property name="extension" value="html"/>
carlos@0
    30
  <property name="src" value="."/>
carlos@0
    31
  <property name="tr" value="yes"/>
carlos@0
    32
  <condition property="translation">
carlos@0
    33
    <not> 
carlos@0
    34
      <equals arg1="no" arg2="${tr}"/>
carlos@0
    35
    </not>
carlos@0
    36
  </condition>
carlos@0
    37
carlos@0
    38
  <target name="init">
carlos@0
    39
    <mkdir dir="${build}"/>
carlos@0
    40
    <mkdir dir="${base.design}/design"/>
carlos@0
    41
    <mkdir dir="${build.sqlc}"/>
carlos@0
    42
    <mkdir dir="${build.sqlc}/src"/>
carlos@0
    43
    <mkdir dir="${build.sqlc}/srcAD"/>
carlos@0
    44
    <mkdir dir="${build.AD}"/>
carlos@0
    45
    <mkdir dir="${build.AD}/org/openbravo/erpWindows"/>
carlos@0
    46
    <mkdir dir="${build.AD}/org/openbravo/erpCommon/ad_actionButton"/>
carlos@0
    47
    <mkdir dir="${build.AD}/org/openbravo/erpCommon/ad_callouts"/>
carlos@0
    48
    <mkdir dir="${build.AD}/org/openbravo/erpCommon/reference"/>
carlos@0
    49
    <mkdir dir="${build.docs}"/>
carlos@0
    50
  </target>
carlos@0
    51
carlos@0
    52
  <target name="clean">
carlos@0
    53
    <property name="complete" value="true"/>
carlos@0
    54
    <delete includeEmptyDirs="true" failonerror="false">
carlos@0
    55
      <fileset dir="${base.design}"/>
carlos@0
    56
      <fileset dir="${build}"/>
carlos@0
    57
      <fileset dir="${build.docs}"/>
carlos@0
    58
      <fileset dir="${build.AD}"/>
carlos@0
    59
      <fileset dir="${build.sqlc}"/>
carlos@0
    60
    </delete>
carlos@0
    61
    <basename property="attach.path.filename" file="${attach.path}"/>
carlos@0
    62
    <condition property="attach.path.condition" value="**/${attach.path.filename}/**" else="">
carlos@0
    63
      <and>
carlos@0
    64
        <contains string="${attach.path}" substring="${jakarta.context}" casesensitive="false"/>
carlos@0
    65
      </and>
carlos@0
    66
    </condition>
carlos@0
    67
    <delete includeEmptyDirs="true" failonerror="false">
carlos@0
    68
      <fileset dir="${jakarta.context}">
carlos@0
    69
        <exclude name="${attach.path.condition}"/>
carlos@0
    70
      </fileset>
carlos@0
    71
    </delete>
carlos@0
    72
    <delete file="${jakarta.home}/webapps/${context.name}.war" failonerror="false"/>
carlos@0
    73
  </target>
carlos@0
    74
carlos@0
    75
  <target name="copy.srcClient">
carlos@0
    76
    <mkdir dir="${base.client.src}"/>
carlos@0
    77
    <copy todir="${basedir}" overwrite="true" failonerror="false">
carlos@0
    78
      <fileset dir="${base.client.src}">
carlos@0
    79
        <exclude name="**/web.xml"/>
carlos@0
    80
      </fileset>
carlos@0
    81
    </copy>
carlos@0
    82
  </target>
carlos@0
    83
carlos@0
    84
  <target name="sqlc" depends="copy.srcClient">
carlos@0
    85
    <java classname="org.openbravo.data.Sqlc" fork="yes" jvm="${env.JAVA_HOME}/bin/java" maxmemory="${build.maxmemory}">
carlos@0
    86
      <arg line="${base.config}/dbCon5.xml .xsql . ${build.sqlc}/src"/>
carlos@0
    87
      <classpath refid="project.class.path"/>
carlos@0
    88
    </java>
carlos@0
    89
    <copy file="${base.subversion}/src/buildAD.xml" tofile="${base.source}/srcAD/build.xml"/>
carlos@0
    90
    <copy file="${base.subversion}/src/log4j.lcf" tofile="${base.source}/srcAD/log4j.lcf"/>
carlos@0
    91
    <ant dir="${base.source}/srcAD" target="buildAD" inheritAll="true" inheritRefs="true"/>
carlos@0
    92
  </target>
carlos@0
    93
carlos@0
    94
  <target name="compileSqlc" depends="sqlc">
carlos@0
    95
    <javac srcdir="${build.sqlc}/src:${basedir}:${build.sqlc}/srcAD/org/openbravo/erpCommon/reference" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="${debug.level}" deprecation="on">
carlos@0
    96
      <classpath refid="project.class.path"/>
carlos@0
    97
    </javac>
carlos@0
    98
    <javac srcdir="${build.sqlc}/srcAD" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="${debug.level}" deprecation="on">
carlos@0
    99
      <classpath refid="project.class.path"/>
carlos@0
   100
    </javac>
carlos@0
   101
    <javac srcdir="${build.AD}" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="${debug.level}" deprecation="on">
carlos@0
   102
      <classpath refid="project.class.path"/>
carlos@0
   103
    </javac>
carlos@0
   104
  </target>
carlos@0
   105
carlos@0
   106
  <target name="wad" depends="init">
carlos@0
   107
    <java classname="org.openbravo.wad.Wad" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
carlos@0
   108
      <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}' '${base.source}' '${attach.path}' '${web.url}' '${base.src}' '${complete}'"/>
carlos@0
   109
      <classpath refid="project.class.path"/>
carlos@0
   110
    </java>
carlos@0
   111
    <antcall target="postwad" inheritall="true" inheritrefs="true"/>
carlos@0
   112
  </target>
carlos@0
   113
  
carlos@0
   114
  <target name="postwad">
carlos@0
   115
    <copy todir="${base.design}/design" >
carlos@0
   116
      <fileset dir="${build.AD}" includes="**/*.xml"/>
carlos@0
   117
    </copy>
carlos@0
   118
    <copy todir="${base.design}/design" >
carlos@0
   119
      <fileset dir="${build.AD}" includes="**/*.fo"/>
carlos@0
   120
    </copy>
carlos@0
   121
    <copy todir="${base.design}/design" >
carlos@0
   122
      <fileset dir="${build.AD}" includes="**/*.html"/>
carlos@0
   123
    </copy>
carlos@0
   124
    <copy todir="${base.design}/design" >
carlos@0
   125
      <fileset dir="${build.AD}" includes="**/*.srpt"/>
carlos@0
   126
    </copy>
carlos@0
   127
    <copy todir="${base.design}/design" >
carlos@0
   128
      <fileset dir="${build.AD}" includes="**/*.jrxml"/>
carlos@0
   129
    </copy>
carlos@0
   130
    <copy todir="${base.design}/design" >
carlos@0
   131
      <fileset dir="${build.AD}" includes="**/*.jasper"/>
carlos@0
   132
    </copy>
carlos@0
   133
  </target>
carlos@0
   134
carlos@0
   135
  <target name="postsrc">
carlos@0
   136
    <copy todir="${base.design}/design" >
carlos@0
   137
      <fileset dir="${basedir}" includes="**/*.xml"/>
carlos@0
   138
    </copy>
carlos@0
   139
    <copy todir="${base.design}/design" >
carlos@0
   140
      <fileset dir="${basedir}" includes="**/*.fo"/>
carlos@0
   141
    </copy>
carlos@0
   142
    <copy todir="${base.design}/design" >
carlos@0
   143
      <fileset dir="${basedir}" includes="**/*.html"/>
carlos@0
   144
    </copy>
carlos@0
   145
    <copy todir="${base.design}/design" >
carlos@0
   146
      <fileset dir="${basedir}" includes="**/*.srpt"/>
carlos@0
   147
    </copy>
carlos@0
   148
    <copy todir="${base.design}/design" >
carlos@0
   149
      <fileset dir="${basedir}" includes="**/*.jrxml"/>
carlos@0
   150
    </copy>
carlos@0
   151
    <copy todir="${base.design}/design" >
carlos@0
   152
      <fileset dir="${basedir}" includes="**/*.jasper"/>
carlos@0
   153
    </copy>
carlos@0
   154
    <java classname="org.openbravo.translate.CommandLine_CopyFiles" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
carlos@0
   155
      <arg line="'${base.config}/XmlPool.xml' '${basedir}' '${base.design}' 'xml' 'true' 'false'"/>
carlos@0
   156
      <classpath refid="project.class.path"/>
carlos@0
   157
    </java>
carlos@0
   158
    <!--java classname="org.openbravo.translate.CommandLine_CopyFiles" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
carlos@0
   159
      <arg line="'${base.config}/XmlPool.xml' '${basedir}' '${base.design}' 'fo' 'true' 'false'"/>
carlos@0
   160
      <classpath refid="project.class.path"/>
carlos@0
   161
    </java>
carlos@0
   162
    <java classname="org.openbravo.translate.CommandLine_CopyFiles" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
carlos@0
   163
      <arg line="'${base.config}/XmlPool.xml' '${basedir}' '${base.design}' 'html' 'true' 'false'"/>
carlos@0
   164
      <classpath refid="project.class.path"/>
carlos@0
   165
    </java>
carlos@0
   166
    <java classname="org.openbravo.translate.CommandLine_CopyFiles" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
carlos@0
   167
      <arg line="'${base.config}/XmlPool.xml' '${basedir}' '${base.design}' 'srpt' 'true' 'false'"/>
carlos@0
   168
      <classpath refid="project.class.path"/>
carlos@0
   169
    </java>
carlos@0
   170
    <java classname="org.openbravo.translate.CommandLine_CopyFiles" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
carlos@0
   171
      <arg line="'${base.config}/XmlPool.xml' '${basedir}' '${base.design}' 'jrxml' 'true' 'false'"/>
carlos@0
   172
      <classpath refid="project.class.path"/>
carlos@0
   173
    </java-->
carlos@0
   174
    <java classname="org.openbravo.translate.CommandLine_CopyFiles" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
carlos@0
   175
      <arg line="'${base.config}/XmlPool.xml' '${basedir}' '${base.design}' 'jasper' 'true' 'false'"/>
carlos@0
   176
      <classpath refid="project.class.path"/>
carlos@0
   177
    </java>
carlos@0
   178
    <antcall target="build.local.context"/>
carlos@0
   179
  </target>
carlos@0
   180
    
carlos@0
   181
  <target name="build.local.context">
carlos@0
   182
    <copy todir="${base.context}"  encoding="UTF-8">
carlos@0
   183
      <fileset file="${basedir}/index.html"/>
carlos@0
   184
    </copy>
carlos@0
   185
    <copy todir="${base.context}/WEB-INF"  encoding="UTF-8">
carlos@0
   186
      <fileset file="${build.sqlc}/src/web.xml"/>
carlos@0
   187
      <fileset dir="${base.config}"/>
carlos@0
   188
    </copy>
carlos@0
   189
    <copy todir="${base.context}/WEB-INF/lib"  encoding="UTF-8">
carlos@0
   190
      <fileset dir="${base.lib}">
carlos@0
   191
        <exclude name="openbravo-wad.jar"/>
carlos@0
   192
        <exclude name="openbravo-trl.jar"/>
carlos@0
   193
        <exclude name="*.war"/>
carlos@0
   194
      </fileset>
carlos@0
   195
    </copy>
carlos@0
   196
    <mkdir dir="${base.context}/web"/>
carlos@0
   197
    <copy todir="${base.context}/web"  encoding="UTF-8">
carlos@0
   198
      <fileset dir="${base.subversion}/web/"/>
carlos@0
   199
    </copy>
carlos@0
   200
    <chmod dir="${base.context}" perm="775"/>
carlos@0
   201
  </target>   
carlos@0
   202
carlos@0
   203
  <target name="compile.src" depends="compileSqlc, postsrc, copy.files">
carlos@0
   204
    <!--antcall inheritall="true" inheritrefs="true" target="compile.translate">
carlos@0
   205
      <param name="extension" value="html"/>
carlos@0
   206
    </antcall>
carlos@0
   207
    <antcall inheritall="true" inheritrefs="true" target="compile.translate">
carlos@0
   208
      <param name="extension" value="fo"/>
carlos@0
   209
    </antcall-->
carlos@0
   210
  </target>
carlos@0
   211
  
carlos@0
   212
  <target name="eclipse.compile" depends="wad,sqlc, postsrc, translate">
carlos@0
   213
  </target>
carlos@0
   214
 
carlos@0
   215
  <target name="eclipse.compile.complete" depends="clean,wad,sqlc, postsrc, translate">
carlos@0
   216
  </target>   
carlos@0
   217
carlos@0
   218
  <target name="compile" depends="wad,compileSqlc, postsrc, translate">
carlos@0
   219
  </target>
carlos@0
   220
carlos@0
   221
  <target name="compile.complete" depends="clean,wad,compileSqlc,postsrc, translate">
carlos@0
   222
    <!--antcall inheritall="true" inheritrefs="true" target="compile.translate">
carlos@0
   223
      <param name="extension" value="html"/>
carlos@0
   224
    </antcall>
carlos@0
   225
    <antcall inheritall="true" inheritrefs="true" target="compile.translate">
carlos@0
   226
      <param name="extension" value="fo"/>
carlos@0
   227
    </antcall-->
carlos@0
   228
  </target>
carlos@0
   229
carlos@0
   230
  <target name="translate" if="translation">
carlos@0
   231
    <antcall inheritall="true" inheritrefs="true" target="compile.translate">
carlos@0
   232
      <param name="extension" value="html"/>
carlos@0
   233
    </antcall>
carlos@0
   234
    <antcall inheritall="true" inheritrefs="true" target="compile.translate">
carlos@0
   235
      <param name="extension" value="fo"/>
carlos@0
   236
    </antcall>
carlos@0
   237
    <antcall inheritall="true" inheritrefs="true" target="compile.translate">
carlos@0
   238
      <param name="extension" value="srpt"/>
carlos@0
   239
    </antcall>
carlos@0
   240
    <antcall inheritall="true" inheritrefs="true" target="compile.translate">
carlos@0
   241
      <param name="extension" value="jrxml"/>
carlos@0
   242
    </antcall>
carlos@0
   243
  </target>
carlos@0
   244
carlos@0
   245
  <target name="compile.translate">
carlos@0
   246
    <java classname="org.openbravo.translate.Translate" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
carlos@0
   247
      <arg line="${base.config}/XmlPool.xml ${extension} ${basedir} ${base.design} ${package}"/>
carlos@0
   248
      <classpath refid="project.class.path"/>
carlos@0
   249
    </java>
carlos@0
   250
  </target>
carlos@0
   251
carlos@0
   252
  <target name="installWebService" depends="init" if="wsdd">
carlos@0
   253
    <java classname="org.apache.axis.client.AdminClient" fork="yes" jvm="${env.JAVA_HOME}/bin/java" maxmemory="${build.maxmemory}">
carlos@0
   254
      <arg line="-l${context.url}/servlet/AxisServlet ${src}/deploy.wsdd"/>
carlos@0
   255
      <classpath refid="project.class.path"/>
carlos@0
   256
    </java>
carlos@0
   257
  </target>
carlos@0
   258
carlos@0
   259
  <target name="uninstallWebService" depends="init">
carlos@0
   260
    <java classname="org.apache.axis.client.AdminClient" fork="yes" jvm="${env.JAVA_HOME}/bin/java" maxmemory="${build.maxmemory}">
carlos@0
   261
      <arg line="-l${context.url}/servlet/AxisServlet ${src}undeploy.wsdd"/>
carlos@0
   262
      <classpath refid="project.class.path"/>
carlos@0
   263
    </java>
carlos@0
   264
  </target>
carlos@0
   265
carlos@0
   266
  <target name="copy.files">
carlos@0
   267
    <chmod dir="${build}" perm="755"/>
carlos@0
   268
    <mkdir dir="${jakarta.base}/webapps/${context.name}"/>
carlos@0
   269
    <copy todir="${jakarta.base}/webapps/${context.name}"  encoding="UTF-8">
carlos@0
   270
      <fileset dir="${base.context}"/>
carlos@0
   271
    </copy>
carlos@0
   272
    <mkdir dir="${jakarta.base}/webapps/${context.name}/WEB-INF/classes"/>
carlos@0
   273
      <copy todir="${jakarta.base}/webapps/${context.name}/WEB-INF/classes" encoding="UTF-8">
carlos@0
   274
      <fileset dir="${build}"/>
carlos@0
   275
    </copy> 
carlos@0
   276
    <!-- mkdir dir="${jakarta.base}/webapps/${context.name}/src-loc"/>
carlos@0
   277
    <copy todir="${jakarta.base}/webapps/${context.name}/src-loc"  encoding="UTF-8">
carlos@0
   278
      <fileset dir="${base.design}"/>
carlos@0
   279
    </copy>
carlos@0
   280
    <mkdir dir="${jakarta.base}/webapps/${context.name}/WEB-INF"/>
carlos@0
   281
    <copy todir="${jakarta.base}/webapps/${context.name}/WEB-INF"  encoding="UTF-8">
carlos@0
   282
      <fileset file="${build.sqlc}/src/web.xml"/>
carlos@0
   283
      <fileset dir="${base.config}"/>
carlos@0
   284
    </copy>
carlos@0
   285
    <mkdir dir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib"/>
carlos@0
   286
    <copy todir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib"  encoding="UTF-8">
carlos@0
   287
      <fileset dir="${base.lib}">
carlos@0
   288
        <exclude name="openbravo-wad.jar"/>
carlos@0
   289
        <exclude name="openbravo-trl.jar"/>
carlos@0
   290
        <exclude name="*.war"/>
carlos@0
   291
      </fileset>
carlos@0
   292
    </copy>
carlos@0
   293
    <mkdir dir="${jakarta.base}/webapps/${context.name}/WEB-INF/classes"/>
carlos@0
   294
    <copy todir="${jakarta.base}/webapps/${context.name}/WEB-INF/classes" encoding="UTF-8">
carlos@0
   295
      <fileset dir="${build}"/>
carlos@0
   296
    </copy>
carlos@0
   297
    <mkdir dir="${jakarta.base}/webapps/${context.name}/web"/>
carlos@0
   298
    <copy todir="${jakarta.base}/webapps/${context.name}/web"  encoding="UTF-8">
carlos@0
   299
      <fileset dir="${base.subversion}/web/"/>
carlos@0
   300
    </copy -->
carlos@0
   301
    <chmod dir="${jakarta.base}/webapps/${context.name}" perm="775"/>
carlos@0
   302
  </target>
carlos@0
   303
carlos@0
   304
  <target name="compile.development" depends="compile, copy.files">
carlos@0
   305
    <mkdir dir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib"/>
carlos@0
   306
    <copy todir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib" file="${build.core.lib}/openbravo-core.jar" encoding="UTF-8">
carlos@0
   307
    </copy>
carlos@0
   308
  </target>
carlos@0
   309
carlos@0
   310
  <target name="compile.complete.development" depends="compile.complete, copy.files">
carlos@0
   311
    <mkdir dir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib"/>
carlos@0
   312
    <copy todir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib" file="${build.core.lib}/openbravo-core.jar" encoding="UTF-8">
carlos@0
   313
    </copy>
carlos@0
   314
  </target>
carlos@0
   315
carlos@0
   316
  <target name="build.war">
carlos@0
   317
    <chmod dir="${build}" perm="755"/>
carlos@0
   318
    <delete failonerror="false" file="${base.lib}/${context.name}.war"/>
carlos@0
   319
    <war compress="true" destfile="${base.lib}/${context.name}.war" encoding="UTF-8" webxml="${base.context}/WEB-INF/web.xml">
carlos@0
   320
      <zipfileset dir="${base.context}"/>
carlos@0
   321
      <classes dir="${build}"/>
carlos@0
   322
      <lib dir="${build.core.lib}">
carlos@0
   323
        <include name="openbravo-core.jar"/>
carlos@0
   324
      </lib>
carlos@0
   325
      <!-- lib dir="${base.lib}">
carlos@0
   326
        <exclude name="openbravo-wad.jar"/>
carlos@0
   327
        <exclude name="openbravo-trl.jar"/>
carlos@0
   328
        <exclude name="servlet-api.jar"/>
carlos@0
   329
      </lib>
carlos@0
   330
      <classes dir="${build}"/>
carlos@0
   331
      <zipfileset dir="${base.subversion}/web" 
carlos@0
   332
                  prefix="web"/>
carlos@0
   333
      <zipfileset dir="${base.config}" 
carlos@0
   334
                  prefix="WEB-INF"/>
carlos@0
   335
      <zipfileset dir="${base.design}" 
carlos@0
   336
                  prefix="src-loc"/ -->
carlos@0
   337
    </war>
carlos@0
   338
  </target>
carlos@0
   339
</project>