src-wad/build.xml
author Juan Pablo Aroztegi <juanpablo.aroztegi@openbravo.com>
Tue, 29 Jan 2008 11:08:22 +0000
changeset 378 5c93458e2916
parent 213 7bc683ea98e9
child 1337 13017300f790
permissions -rw-r--r--
[1881705] Force file eol to LF (UNIX)
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
 ************************************************************************
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=".">
carlos@0
    34
  <property name="build.wad" value="${basedir}/build/classes"/>
carlos@0
    35
  <property name="build.wad.docs" value="${basedir}/docs"/>
carlos@0
    36
  <property name="build.wad.sqlc" value="${basedir}/build/javasqlc"/>
carlos@0
    37
  <property name="build.wad.src" value="${basedir}/src"/>
juanpablo@213
    38
carlos@0
    39
  <path id="wad.class.path">
carlos@0
    40
    <pathelement path="../src-core/build/classes"/>
carlos@0
    41
    <fileset dir="${build.wad.lib}">
carlos@0
    42
      <include name="**/*.jar"/>
carlos@0
    43
    </fileset>
juanpablo@213
    44
  </path>
carlos@0
    45
carlos@0
    46
  <target name="init">
carlos@0
    47
    <mkdir dir="${build.wad}"/>
carlos@0
    48
    <mkdir dir="${build.wad.docs}"/>
carlos@0
    49
    <mkdir dir="${build.wad.sqlc}"/>
carlos@0
    50
  </target>
juanpablo@213
    51
carlos@0
    52
  <target name="clean">
carlos@0
    53
    <delete dir="${build.wad}" failonerror="false" includeemptydirs="true"/>
carlos@0
    54
    <delete dir="${build.wad.sqlc}" failonerror="false" includeemptydirs="true"/>
carlos@0
    55
    <delete dir="${build.wad.docs}" failonerror="false" includeemptydirs="true"/>
carlos@0
    56
    <delete failonerror="false" file="${build.wad.lib}/openbravo-wad.jar"/>
carlos@0
    57
  </target>
carlos@0
    58
carlos@0
    59
  <target name="sqlc" depends="init">
carlos@0
    60
    <java classname="org.openbravo.data.Sqlc" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
asier@41
    61
      <arg line="${base.config}/Openbravo.properties .xsql ./src/org ${build.wad.sqlc}"/>
carlos@0
    62
      <classpath refid="wad.class.path"/>
carlos@0
    63
    </java>
carlos@0
    64
  </target>
carlos@0
    65
carlos@0
    66
  <target name="compileSqlc" depends="sqlc">
carlos@0
    67
    <javac srcdir="${build.wad.sqlc}/src" destdir="${build.wad}" encoding="UTF-8" debug="${debug.level}">
carlos@0
    68
      <classpath refid="wad.class.path"/>
carlos@0
    69
    </javac>
carlos@0
    70
  </target>
carlos@0
    71
carlos@0
    72
  <target name="compile" depends="clean, compileSqlc">
carlos@0
    73
    <javac srcdir="${build.wad.src}" destdir="${build.wad}" deprecation="on" encoding="UTF-8" debug="${debug.level}">
carlos@0
    74
      <classpath refid="wad.class.path"/>  
carlos@0
    75
    </javac>
carlos@0
    76
    <copy todir="${build.wad}" encoding="UTF-8">
carlos@0
    77
      <fileset dir="${build.wad.src}" includes="**/*xml"/>
carlos@0
    78
      <fileset dir="${build.wad.src}" includes="**/*html"/>
carlos@0
    79
    </copy>
carlos@0
    80
  </target>
juanpablo@213
    81
juanpablo@213
    82
  <target name="build.jar">
carlos@0
    83
    <jar destfile="${build.wad.lib}/openbravo-wad.jar">
carlos@0
    84
      <fileset dir="${build.wad}"/>
carlos@0
    85
      <manifest>
carlos@0
    86
        <attribute name="Built-By" value="Openbravo S.L."/>
carlos@0
    87
        <!--section name="common/class1.class">
juanpablo@213
    88
        <attribute name="Sealed" value="false"/>
juanpablo@213
    89
      </section-->
juanpablo@213
    90
    </manifest>
juanpablo@213
    91
  </jar>  
juanpablo@213
    92
</target>   
carlos@0
    93
juanpablo@213
    94
<target name="build" depends="compile, doc, build.jar">
juanpablo@213
    95
</target>
juanpablo@213
    96
juanpablo@213
    97
<target name="doc" depends="init" description="Generate api">
juanpablo@213
    98
  <javadoc packagenames="org.openbravo.*" 
juanpablo@213
    99
    sourcepath="${build.wad.sqlc}/src:${build.wad}"
juanpablo@213
   100
    destdir="${build.wad.docs}"
juanpablo@213
   101
    author="true"
juanpablo@213
   102
    version="true"
juanpablo@213
   103
    use="true"
juanpablo@213
   104
    docencoding="UTF-8"
juanpablo@213
   105
    encoding="UTF-8"
juanpablo@213
   106
    failonerror="false"
juanpablo@213
   107
    windowtitle="${ant.project.name}">
juanpablo@213
   108
    <classpath refid="wad.class.path"/>
juanpablo@213
   109
  </javadoc>
juanpablo@213
   110
</target>
carlos@0
   111
</project>