src-wad/build.xml
author RM packaging bot <staff.rm@openbravo.com>
Thu, 13 Mar 2014 10:13:41 +0000
changeset 22702 83952b65ffe7
parent 21973 7844d93d8b2b
child 32768 8a37ee35c54f
permissions -rw-r--r--
CI: merge back from main
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 
augusto@21973
    16
 * All portions are Copyright (C) 2005-2014 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}">
augusto@21973
    62
      <arg line="'${base.config}'/Openbravo.properties .xsql ./src/org '${build.wad.sqlc}' null false" />
martin@2870
    63
      <classpath refid="wad.class.path" />
antonio@7592
    64
      <syspropertyset>
antonio@7592
    65
        <propertyref name="java.security.egd" />
antonio@7592
    66
      </syspropertyset>
carlos@0
    67
    </java>
asier@6121
    68
  	
asier@6121
    69
  	<java classname="org.openbravo.data.Sqlc" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
augusto@21973
    70
      <arg line="'${base.config}'/Openbravo.properties .xsql '${base.modules}' '${build.wad.sqlc}'/src */src-wad false" />
asier@6121
    71
  	  <classpath refid="wad.class.path" />
antonio@7592
    72
      <syspropertyset>
antonio@7592
    73
         <propertyref name="java.security.egd" />
antonio@7592
    74
      </syspropertyset>
asier@6121
    75
  	</java>
carlos@0
    76
  </target>
carlos@0
    77
carlos@0
    78
  <target name="compileSqlc" depends="sqlc">
stefan@11995
    79
    <javac srcdir="${build.wad.sqlc}/src" includes="**/*.java" destdir="${build.wad}" encoding="UTF-8" debug="true" debuglevel="lines,vars,source" fork="true" includeantruntime="false">
martin@2870
    80
      <classpath refid="wad.class.path" />
carlos@0
    81
    </javac>
carlos@0
    82
  </target>
carlos@0
    83
antonio@16458
    84
  <path id="my-src-wad-dirs">
antonio@16458
    85
    <pathelement path="src" />
antonio@16458
    86
    <dirset dir="../modules">
antonio@16461
    87
      <include name="*/src-wad" />
antonio@16458
    88
    </dirset>
antonio@16458
    89
  </path>
antonio@16458
    90
martin@2870
    91
  <target name="compile" depends="compileSqlc">
antonio@16458
    92
    <javac destdir="${build.wad}" deprecation="on" encoding="UTF-8" debug="true" debuglevel="lines,vars,source" fork="true" includeantruntime="false">
antonio@16458
    93
      <src refid="my-src-wad-dirs" />
martin@2870
    94
      <classpath refid="wad.class.path" />
carlos@0
    95
    </javac>
antonio@16458
    96
carlos@0
    97
    <copy todir="${build.wad}" encoding="UTF-8">
martin@2870
    98
      <fileset dir="${build.wad.src}" includes="**/*xml" />
martin@2870
    99
      <fileset dir="${build.wad.src}" includes="**/*html" />
carlos@0
   100
    </copy>
martin@6158
   101
    <copy todir="${build.wad}" encoding="UTF-8">
martin@6158
   102
      <fileset dir="${base.modules}">
martin@6158
   103
          <include name="*/src-wad/**/*" />
martin@6158
   104
          <exclude name="*/src-wad/**/*.java" />
martin@6158
   105
          <exclude name="*/src-wad/**/*.xsql" />
martin@6158
   106
      </fileset>
martin@6158
   107
      <mapper type="regexp" from="(.*\${file.separator}src-wad)(.*)" to="\2" />
martin@6158
   108
    </copy>
carlos@0
   109
  </target>
juanpablo@213
   110
juanpablo@213
   111
  <target name="build.jar">
carlos@0
   112
    <jar destfile="${build.wad.lib}/openbravo-wad.jar">
martin@2870
   113
      <fileset dir="${build.wad}" />
carlos@0
   114
      <manifest>
ggi@6702
   115
        <attribute name="Built-By" value="Openbravo S.L.U." />
carlos@0
   116
        <!--section name="common/class1.class">
juanpablo@213
   117
        <attribute name="Sealed" value="false"/>
juanpablo@213
   118
      </section-->
martin@2870
   119
      </manifest>
martin@2870
   120
    </jar>
martin@2870
   121
  </target>
carlos@0
   122
martin@2870
   123
  <target name="build" depends="compile, build.jar">
martin@2870
   124
  </target>
juanpablo@213
   125
martin@2870
   126
  <target name="doc" depends="init" description="Generate api">
martin@2870
   127
    <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
   128
      <classpath refid="wad.class.path" />
martin@2870
   129
    </javadoc>
martin@2870
   130
  </target>
carlos@0
   131
</project>