src-wad/build.xml
author Asier Lostalé <asier.lostale@openbravo.com>
Fri, 23 Apr 2010 13:51:11 +0200
changeset 7502 b349f71af836
parent 7480 2772436041d8
child 7519 432ccd399d73
permissions -rw-r--r--
fixed bug 12683: Oracle build takes a lot of time
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 
asier@7502
    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
 ************************************************************************
juanpablo@213
    20
-->
juanpablo@213
    21
<!--
juanpablo@213
    22
List of targets:
juanpablo@213
    23
juanpablo@213
    24
init: creates the needed folders.
juanpablo@213
    25
clean: removes all the created files and folders.
juanpablo@213
    26
sqlc: generates java files from xsql's files.
juanpablo@213
    27
compileSqlc: compile the java files generated from xsql's files.
juanpablo@213
    28
compile: compile the java files of the project.
juanpablo@213
    29
build.jar: generates the jar file in the lib folder.
juanpablo@213
    30
build: compile the project, including the xsql's files and generates the jar and doc.
fernando@204
    31
doc: generates the api for the project.
carlos@0
    32
-->
carlos@0
    33
<project name="openbravo-wad" default="compile" basedir=".">
martin@2870
    34
  <property name="build.wad" value="${basedir}/build/classes" />
martin@2870
    35
  <property name="build.wad.docs" value="${basedir}/docs" />
martin@2870
    36
  <property name="build.wad.sqlc" value="${basedir}/build/javasqlc" />
martin@2870
    37
  <property name="build.wad.src" value="${basedir}/src" />
martin@6158
    38
  <property name="main.dir" value="${basedir}/.." />
juanpablo@213
    39
carlos@0
    40
  <path id="wad.class.path">
martin@2870
    41
    <pathelement path="../src-core/build/classes" />
jordi@1711
    42
    <fileset dir="${base.lib}">
martin@2870
    43
      <include name="**/*.jar" />
carlos@0
    44
    </fileset>
juanpablo@213
    45
  </path>
carlos@0
    46
carlos@0
    47
  <target name="init">
martin@2870
    48
    <mkdir dir="${build.wad}" />
martin@2870
    49
    <mkdir dir="${build.wad.docs}" />
martin@2870
    50
    <mkdir dir="${build.wad.sqlc}" />
carlos@0
    51
  </target>
juanpablo@213
    52
carlos@0
    53
  <target name="clean">
martin@2870
    54
    <delete dir="${build.wad}" failonerror="false" includeemptydirs="true" />
martin@2870
    55
    <delete dir="${build.wad.sqlc}" failonerror="false" includeemptydirs="true" />
martin@2870
    56
    <delete dir="${build.wad.docs}" failonerror="false" includeemptydirs="true" />
martin@2870
    57
    <delete failonerror="false" file="${build.wad.lib}/openbravo-wad.jar" />
carlos@0
    58
  </target>
carlos@0
    59
carlos@0
    60
  <target name="sqlc" depends="init">
carlos@0
    61
    <java classname="org.openbravo.data.Sqlc" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
martin@2870
    62
      <arg line="'${base.config}'/Openbravo.properties .xsql ./src/org '${build.wad.sqlc}'" />
martin@2870
    63
      <classpath refid="wad.class.path" />
asier@7502
    64
      <sysproperty key="java.security.egd" value="${java.security.egd}"/>
carlos@0
    65
    </java>
asier@6121
    66
  	
asier@6121
    67
  	<java classname="org.openbravo.data.Sqlc" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
asier@6121
    68
      <arg line="'${base.config}'/Openbravo.properties .xsql '${base.modules}' '${build.wad.sqlc}'/src */src-wad" />
asier@6121
    69
  	  <classpath refid="wad.class.path" />
asier@7502
    70
  	  <sysproperty key="java.security.egd" value="${java.security.egd}"/>
asier@6121
    71
  	</java>
carlos@0
    72
  </target>
carlos@0
    73
carlos@0
    74
  <target name="compileSqlc" depends="sqlc">
antonio@7480
    75
    <javac srcdir="${build.wad.sqlc}/src" includes="**/*.java" destdir="${build.wad}" encoding="UTF-8" debug="true" debuglevel="lines,vars,source" fork="true" >
martin@2870
    76
      <classpath refid="wad.class.path" />
carlos@0
    77
    </javac>
carlos@0
    78
  </target>
carlos@0
    79
martin@2870
    80
  <target name="compile" depends="compileSqlc">
antonio@7480
    81
    <javac srcdir="${main.dir}" includes="src-wad/src/**/*.java,modules/*/src-wad/**/*.java" destdir="${build.wad}" deprecation="on" encoding="UTF-8" debug="true" debuglevel="lines,vars,source" fork="true" >
martin@2870
    82
      <classpath refid="wad.class.path" />
carlos@0
    83
    </javac>
carlos@0
    84
    <copy todir="${build.wad}" encoding="UTF-8">
martin@2870
    85
      <fileset dir="${build.wad.src}" includes="**/*xml" />
martin@2870
    86
      <fileset dir="${build.wad.src}" includes="**/*html" />
carlos@0
    87
    </copy>
martin@6158
    88
    <copy todir="${build.wad}" encoding="UTF-8">
martin@6158
    89
      <fileset dir="${base.modules}">
martin@6158
    90
          <include name="*/src-wad/**/*" />
martin@6158
    91
          <exclude name="*/src-wad/**/*.java" />
martin@6158
    92
          <exclude name="*/src-wad/**/*.xsql" />
martin@6158
    93
      </fileset>
martin@6158
    94
      <mapper type="regexp" from="(.*\${file.separator}src-wad)(.*)" to="\2" />
martin@6158
    95
    </copy>
carlos@0
    96
  </target>
juanpablo@213
    97
juanpablo@213
    98
  <target name="build.jar">
carlos@0
    99
    <jar destfile="${build.wad.lib}/openbravo-wad.jar">
martin@2870
   100
      <fileset dir="${build.wad}" />
carlos@0
   101
      <manifest>
ggi@6702
   102
        <attribute name="Built-By" value="Openbravo S.L.U." />
carlos@0
   103
        <!--section name="common/class1.class">
juanpablo@213
   104
        <attribute name="Sealed" value="false"/>
juanpablo@213
   105
      </section-->
martin@2870
   106
      </manifest>
martin@2870
   107
    </jar>
martin@2870
   108
  </target>
carlos@0
   109
martin@2870
   110
  <target name="build" depends="compile, build.jar">
martin@2870
   111
  </target>
juanpablo@213
   112
martin@2870
   113
  <target name="doc" depends="init" description="Generate api">
martin@2870
   114
    <javadoc packagenames="org.openbravo.*" sourcepath="${build.wad.sqlc}/src:${build.wad.src}" destdir="${build.wad.docs}" author="true" version="true" use="true" docencoding="UTF-8" encoding="UTF-8" failonerror="false" windowtitle="${ant.project.name}">
martin@2870
   115
      <classpath refid="wad.class.path" />
martin@2870
   116
    </javadoc>
martin@2870
   117
  </target>
carlos@0
   118
</project>