src/build.xml
author Juan Pablo Aroztegi <juanpablo.aroztegi@openbravo.com>
Tue, 27 Nov 2007 09:51:44 +0000
changeset 131 9af536877763
parent 92 1a94aa1f6b52
child 134 590ce3de05b4
permissions -rw-r--r--
Remove base.subversion, clean build.xml files
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
  </target>
carlos@0
    73
carlos@0
    74
  <target name="copy.srcClient">
carlos@0
    75
    <mkdir dir="${base.client.src}"/>
carlos@0
    76
    <copy todir="${basedir}" overwrite="true" failonerror="false">
carlos@0
    77
      <fileset dir="${base.client.src}">
carlos@0
    78
        <exclude name="**/web.xml"/>
carlos@0
    79
      </fileset>
carlos@0
    80
    </copy>
carlos@0
    81
  </target>
carlos@0
    82
carlos@0
    83
  <target name="sqlc" depends="copy.srcClient">
carlos@0
    84
    <java classname="org.openbravo.data.Sqlc" fork="yes" jvm="${env.JAVA_HOME}/bin/java" maxmemory="${build.maxmemory}">
asier@45
    85
      <arg line="${base.config}/Openbravo.properties .xsql . ${build.sqlc}/src"/>
carlos@0
    86
      <classpath refid="project.class.path"/>
carlos@0
    87
    </java>
juanpablo@131
    88
    <copy file="${base.source}/src/buildAD.xml" tofile="${base.source}/srcAD/build.xml"/>
juanpablo@131
    89
    <copy file="${base.source}/src/log4j.lcf" tofile="${base.source}/srcAD/log4j.lcf"/>
carlos@0
    90
    <ant dir="${base.source}/srcAD" target="buildAD" inheritAll="true" inheritRefs="true"/>
carlos@0
    91
  </target>
carlos@0
    92
carlos@0
    93
  <target name="compileSqlc" depends="sqlc">
carlos@0
    94
    <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
    95
      <classpath refid="project.class.path"/>
carlos@0
    96
    </javac>
carlos@0
    97
    <javac srcdir="${build.sqlc}/srcAD" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="${debug.level}" deprecation="on">
carlos@0
    98
      <classpath refid="project.class.path"/>
carlos@0
    99
    </javac>
carlos@0
   100
    <javac srcdir="${build.AD}" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="${debug.level}" deprecation="on">
carlos@0
   101
      <classpath refid="project.class.path"/>
carlos@0
   102
    </javac>
carlos@0
   103
  </target>
carlos@0
   104
carlos@0
   105
  <target name="wad" depends="init">
carlos@0
   106
    <java classname="org.openbravo.wad.Wad" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
carlos@0
   107
      <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
   108
      <classpath refid="project.class.path"/>
carlos@0
   109
    </java>
carlos@0
   110
    <antcall target="postwad" inheritall="true" inheritrefs="true"/>
carlos@0
   111
  </target>
juanpablo@131
   112
carlos@0
   113
  <target name="postwad">
carlos@0
   114
    <copy todir="${base.design}/design" >
carlos@0
   115
      <fileset dir="${build.AD}" includes="**/*.xml"/>
carlos@0
   116
    </copy>
carlos@0
   117
    <copy todir="${base.design}/design" >
carlos@0
   118
      <fileset dir="${build.AD}" includes="**/*.fo"/>
carlos@0
   119
    </copy>
carlos@0
   120
    <copy todir="${base.design}/design" >
carlos@0
   121
      <fileset dir="${build.AD}" includes="**/*.html"/>
carlos@0
   122
    </copy>
carlos@0
   123
    <copy todir="${base.design}/design" >
carlos@0
   124
      <fileset dir="${build.AD}" includes="**/*.srpt"/>
carlos@0
   125
    </copy>
carlos@0
   126
    <copy todir="${base.design}/design" >
carlos@0
   127
      <fileset dir="${build.AD}" includes="**/*.jrxml"/>
carlos@0
   128
    </copy>
carlos@0
   129
    <copy todir="${base.design}/design" >
carlos@0
   130
      <fileset dir="${build.AD}" includes="**/*.jasper"/>
carlos@0
   131
    </copy>
carlos@0
   132
  </target>
carlos@0
   133
carlos@0
   134
  <target name="postsrc">
carlos@0
   135
    <copy todir="${base.design}/design" >
carlos@0
   136
      <fileset dir="${basedir}" includes="**/*.xml"/>
carlos@0
   137
    </copy>
carlos@0
   138
    <copy todir="${base.design}/design" >
carlos@0
   139
      <fileset dir="${basedir}" includes="**/*.fo"/>
carlos@0
   140
    </copy>
carlos@0
   141
    <copy todir="${base.design}/design" >
carlos@0
   142
      <fileset dir="${basedir}" includes="**/*.html"/>
carlos@0
   143
    </copy>
carlos@0
   144
    <copy todir="${base.design}/design" >
carlos@0
   145
      <fileset dir="${basedir}" includes="**/*.srpt"/>
carlos@0
   146
    </copy>
carlos@0
   147
    <copy todir="${base.design}/design" >
carlos@0
   148
      <fileset dir="${basedir}" includes="**/*.jrxml"/>
carlos@0
   149
    </copy>
carlos@0
   150
    <copy todir="${base.design}/design" >
carlos@0
   151
      <fileset dir="${basedir}" includes="**/*.jasper"/>
carlos@0
   152
    </copy>
carlos@0
   153
    <java classname="org.openbravo.translate.CommandLine_CopyFiles" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
asier@75
   154
      <arg line="'${base.config}/Openbravo.properties' '${basedir}' '${base.design}' '.xml' 'true' 'false'"/>
carlos@0
   155
      <classpath refid="project.class.path"/>
carlos@0
   156
    </java>
carlos@0
   157
    <java classname="org.openbravo.translate.CommandLine_CopyFiles" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
asier@45
   158
      <arg line="'${base.config}/Openbravo.properties' '${basedir}' '${base.design}' 'jasper' 'true' 'false'"/>
carlos@0
   159
      <classpath refid="project.class.path"/>
carlos@0
   160
    </java>
carlos@0
   161
    <antcall target="build.local.context"/>
carlos@0
   162
  </target>
juanpablo@131
   163
carlos@0
   164
  <target name="build.local.context">
carlos@0
   165
    <copy todir="${base.context}"  encoding="UTF-8">
carlos@0
   166
      <fileset file="${basedir}/index.html"/>
carlos@0
   167
    </copy>
carlos@0
   168
    <copy todir="${base.context}/WEB-INF"  encoding="UTF-8">
carlos@0
   169
      <fileset file="${build.sqlc}/src/web.xml"/>
carlos@0
   170
      <fileset dir="${base.config}"/>
carlos@0
   171
    </copy>
carlos@0
   172
    <copy todir="${base.context}/WEB-INF/lib"  encoding="UTF-8">
carlos@0
   173
      <fileset dir="${base.lib}">
carlos@0
   174
        <exclude name="openbravo-wad.jar"/>
carlos@0
   175
        <exclude name="openbravo-trl.jar"/>
carlos@0
   176
        <exclude name="*.war"/>
carlos@0
   177
      </fileset>
carlos@0
   178
    </copy>
carlos@0
   179
    <mkdir dir="${base.context}/web"/>
carlos@0
   180
    <copy todir="${base.context}/web"  encoding="UTF-8">
juanpablo@131
   181
      <fileset dir="${base.source}/web/"/>
carlos@0
   182
    </copy>
carlos@0
   183
    <chmod dir="${base.context}" perm="775"/>
carlos@0
   184
  </target>   
carlos@0
   185
carlos@0
   186
  <target name="compile.src" depends="compileSqlc, postsrc, copy.files">
carlos@0
   187
  </target>
juanpablo@131
   188
carlos@0
   189
  <target name="eclipse.compile" depends="wad,sqlc, postsrc, translate">
carlos@0
   190
  </target>
juanpablo@131
   191
carlos@0
   192
  <target name="eclipse.compile.complete" depends="clean,wad,sqlc, postsrc, translate">
juanpablo@131
   193
  </target>
carlos@0
   194
carlos@0
   195
  <target name="compile" depends="wad,compileSqlc, postsrc, translate">
carlos@0
   196
  </target>
carlos@0
   197
carlos@0
   198
  <target name="compile.complete" depends="clean,wad,compileSqlc,postsrc, translate">
carlos@0
   199
  </target>
carlos@0
   200
carlos@0
   201
  <target name="translate" if="translation">
carlos@0
   202
    <antcall inheritall="true" inheritrefs="true" target="compile.translate">
carlos@0
   203
      <param name="extension" value="html"/>
carlos@0
   204
    </antcall>
carlos@0
   205
    <antcall inheritall="true" inheritrefs="true" target="compile.translate">
carlos@0
   206
      <param name="extension" value="fo"/>
carlos@0
   207
    </antcall>
carlos@0
   208
    <antcall inheritall="true" inheritrefs="true" target="compile.translate">
carlos@0
   209
      <param name="extension" value="srpt"/>
carlos@0
   210
    </antcall>
carlos@0
   211
    <antcall inheritall="true" inheritrefs="true" target="compile.translate">
carlos@0
   212
      <param name="extension" value="jrxml"/>
carlos@0
   213
    </antcall>
carlos@0
   214
  </target>
carlos@0
   215
carlos@0
   216
  <target name="compile.translate">
carlos@0
   217
    <java classname="org.openbravo.translate.Translate" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
asier@45
   218
      <arg line="${base.config}/Openbravo.properties ${extension} ${basedir} ${base.design} ${package}"/>
carlos@0
   219
      <classpath refid="project.class.path"/>
carlos@0
   220
    </java>
carlos@0
   221
  </target>
carlos@0
   222
carlos@0
   223
  <target name="installWebService" depends="init" if="wsdd">
carlos@0
   224
    <java classname="org.apache.axis.client.AdminClient" fork="yes" jvm="${env.JAVA_HOME}/bin/java" maxmemory="${build.maxmemory}">
carlos@0
   225
      <arg line="-l${context.url}/servlet/AxisServlet ${src}/deploy.wsdd"/>
carlos@0
   226
      <classpath refid="project.class.path"/>
carlos@0
   227
    </java>
carlos@0
   228
  </target>
carlos@0
   229
carlos@0
   230
  <target name="uninstallWebService" depends="init">
carlos@0
   231
    <java classname="org.apache.axis.client.AdminClient" fork="yes" jvm="${env.JAVA_HOME}/bin/java" maxmemory="${build.maxmemory}">
carlos@8
   232
      <arg line="-l${context.url}/servlet/AxisServlet ${src}/undeploy.wsdd"/>
carlos@0
   233
      <classpath refid="project.class.path"/>
carlos@0
   234
    </java>
carlos@0
   235
  </target>
carlos@0
   236
carlos@0
   237
  <target name="copy.files">
carlos@0
   238
    <chmod dir="${build}" perm="755"/>
carlos@0
   239
    <mkdir dir="${jakarta.base}/webapps/${context.name}"/>
carlos@0
   240
    <copy todir="${jakarta.base}/webapps/${context.name}"  encoding="UTF-8">
carlos@0
   241
      <fileset dir="${base.context}"/>
carlos@0
   242
    </copy>
carlos@0
   243
    <mkdir dir="${jakarta.base}/webapps/${context.name}/WEB-INF/classes"/>
juanpablo@131
   244
    <copy todir="${jakarta.base}/webapps/${context.name}/WEB-INF/classes" encoding="UTF-8">
carlos@0
   245
      <fileset dir="${build}"/>
carlos@0
   246
    </copy> 
carlos@0
   247
    <chmod dir="${jakarta.base}/webapps/${context.name}" perm="775"/>
carlos@0
   248
  </target>
carlos@0
   249
carlos@0
   250
  <target name="compile.development" depends="compile, copy.files">
carlos@0
   251
    <mkdir dir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib"/>
carlos@0
   252
    <copy todir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib" file="${build.core.lib}/openbravo-core.jar" encoding="UTF-8">
carlos@0
   253
    </copy>
carlos@0
   254
  </target>
carlos@0
   255
carlos@0
   256
  <target name="compile.complete.development" depends="compile.complete, copy.files">
carlos@0
   257
    <mkdir dir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib"/>
carlos@0
   258
    <copy todir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib" file="${build.core.lib}/openbravo-core.jar" encoding="UTF-8">
carlos@0
   259
    </copy>
carlos@0
   260
  </target>
carlos@0
   261
carlos@0
   262
  <target name="build.war">
carlos@0
   263
    <chmod dir="${build}" perm="755"/>
carlos@0
   264
    <delete failonerror="false" file="${base.lib}/${context.name}.war"/>
carlos@0
   265
    <war compress="true" destfile="${base.lib}/${context.name}.war" encoding="UTF-8" webxml="${base.context}/WEB-INF/web.xml">
carlos@0
   266
      <zipfileset dir="${base.context}"/>
carlos@0
   267
      <classes dir="${build}"/>
carlos@0
   268
    </war>
carlos@0
   269
  </target>
carlos@0
   270
</project>