src-util/buildvalidation/build.xml
author Antonio Moreno <antonio.moreno@openbravo.com>
Tue, 30 Mar 2010 19:20:38 +0200
changeset 6901 43a7191bdeb6
parent 6897 d6f0fa8b4070
child 6902 d8e5536b1186
permissions -rw-r--r--
[validation] Corrected build.xml
antonio@6886
     1
<?xml version="1.0" encoding="UTF-8" ?>
antonio@6886
     2
<!--
antonio@6901
     3
*************************************************************************
antonio@6901
     4
* The contents of this file are subject to the Openbravo  Public  License
antonio@6901
     5
* Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
antonio@6901
     6
* Version 1.1  with a permitted attribution clause; you may not  use this
antonio@6901
     7
* file except in compliance with the License. You  may  obtain  a copy of
antonio@6901
     8
* the License at http://www.openbravo.com/legal/license.html
antonio@6901
     9
* Software distributed under the License  is  distributed  on  an "AS IS"
antonio@6901
    10
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
antonio@6901
    11
* License for the specific  language  governing  rights  and  limitations
antonio@6901
    12
* under the License.
antonio@6901
    13
* The Original Code is Openbravo ERP.
antonio@6901
    14
* The Initial Developer of the Original Code is Openbravo SLU
antonio@6901
    15
* All portions are Copyright (C) 2010 Openbravo SLU
antonio@6901
    16
* All Rights Reserved.
antonio@6901
    17
* Contributor(s):  ______________________________________.
antonio@6901
    18
************************************************************************
antonio@6886
    19
-->
antonio@6886
    20
antonio@6886
    21
<project name="openbravo-pre-install" default="compile" basedir=".">
antonio@6896
    22
  <property name="build.pre" value="build/classes" />
antonio@6896
    23
  <property name="build.pre.sqlc" value="build/javasqlc" />
antonio@6896
    24
  <property name="build.pre.src" value="src" />
antonio@6886
    25
  <property name="main.dir" value="${basedir}/../.." />
antonio@6886
    26
antonio@6886
    27
  <path id="pre.class.path">
antonio@6886
    28
    <pathelement path="build/classes" />
antonio@6886
    29
    <dirset dir="${base.modules}">
antonio@6886
    30
      <include name="*/build/classes/" />
antonio@6886
    31
    </dirset>
antonio@6896
    32
    <pathelement path="${base.src}"/>
antonio@6886
    33
    <fileset dir="${base.lib}">
antonio@6886
    34
      <include name="**/*.jar" />
antonio@6886
    35
    </fileset>
antonio@6886
    36
  </path>
antonio@6886
    37
antonio@6886
    38
  <condition property="module.not.provided">
antonio@6886
    39
    <equals arg1="${module}" arg2="%" />
antonio@6886
    40
  </condition>
antonio@6886
    41
  <condition property="checkCore">
antonio@6886
    42
    <equals arg1="${module}" arg2="org.openbravo" />
antonio@6886
    43
  </condition>
antonio@6896
    44
antonio@6886
    45
  <target name="init">
antonio@6886
    46
    <mkdir dir="${build.pre}" />
antonio@6886
    47
    <mkdir dir="${build.pre.sqlc}" />
antonio@6886
    48
    <mkdir dir="${build.pre.sqlc}/src" />
antonio@6896
    49
    <mkdir dir="${base.modules}/${module}/build/" />
antonio@6896
    50
    <mkdir dir="${base.modules}/${module}/build/javasqlc" />
antonio@6896
    51
    <mkdir dir="${base.modules}/${module}/build/classes" />
antonio@6886
    52
  </target>
antonio@6886
    53
antonio@6886
    54
  <target name="clean">
antonio@6886
    55
    <delete dir="${build.pre}" failonerror="false" includeemptydirs="true" />
antonio@6886
    56
    <delete dir="${build.pre.sqlc}" failonerror="false" includeemptydirs="true" />
antonio@6886
    57
  </target>
antonio@6886
    58
antonio@6895
    59
  <target name="sqlcCore" depends="init" if="checkCore">
antonio@6886
    60
    <java classname="org.openbravo.data.Sqlc" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
antonio@6886
    61
      <arg line="'${base.config}'/Openbravo.properties .xsql ./src/org '${build.pre.sqlc}'" />
antonio@6886
    62
      <classpath refid="pre.class.path" />
antonio@6886
    63
    </java>
antonio@6895
    64
      <javac srcdir="${build.pre.sqlc}/src" includes="**/*.java" destdir="${build.pre}" encoding="UTF-8" debug="true" debuglevel="lines,vars,source">
antonio@6895
    65
        <classpath refid="pre.class.path" />
antonio@6895
    66
      </javac>
antonio@6895
    67
  </target>
antonio@6895
    68
antonio@6895
    69
  <target name="sqlcModules" depends="init" unless="checkCore">
antonio@6886
    70
  	
antonio@6895
    71
      <java classname="org.openbravo.data.Sqlc" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
antonio@6895
    72
        <arg line="'${base.config}'/Openbravo.properties .xsql '${base.modules}' '${base.modules}'/'${module}'/src-util/buildvalidation/src */src-util/buildvalidation" />
antonio@6895
    73
        <classpath refid="pre.class.path" />
antonio@6895
    74
      </java>
antonio@6895
    75
      <javac srcdir="${base.modules}/${module}/src-util/buildvalidation/src" includes="**/*.java" destdir="${base.modules}/${module}/build/classes" encoding="UTF-8" debug="true" debuglevel="lines,vars,source">
antonio@6895
    76
        <classpath refid="pre.class.path" />
antonio@6895
    77
      </javac>
antonio@6895
    78
  </target>
antonio@6895
    79
antonio@6895
    80
  <target name="sqlc" depends="init, sqlcCore, sqlcModules">
antonio@6895
    81
  	
antonio@6886
    82
  </target>
antonio@6886
    83
antonio@6886
    84
  <target name="compileSqlc" depends="sqlc">
antonio@6886
    85
  </target>
antonio@6886
    86
antonio@6886
    87
  <target name="javacCore" if="checkCore">
antonio@6886
    88
    <javac srcdir="${main.dir}" includes="src-util/buildvalidation/src/**/*.java" destdir="${build.pre}" deprecation="on" encoding="UTF-8" debug="true" debuglevel="lines,vars,source">
antonio@6886
    89
      <classpath refid="pre.class.path" />
antonio@6886
    90
    </javac>
antonio@6886
    91
  </target>
antonio@6896
    92
antonio@6886
    93
  <target name="javacModule" unless="checkCore">
antonio@6896
    94
    <javac srcdir="${main.dir}" includes="modules/${module}/src-util/buildvalidation/**/*.java" destdir="${base.modules}/${module}/build/classes" deprecation="on" encoding="UTF-8" debug="true" debuglevel="lines,vars,source">
antonio@6886
    95
      <classpath refid="pre.class.path" />
antonio@6886
    96
    </javac>
antonio@6886
    97
  </target>
antonio@6886
    98
  
antonio@6886
    99
  <target name="compile" depends="checkmodule,compileSqlc,javacCore,javacModule">
antonio@6886
   100
  </target>
antonio@6886
   101
antonio@6897
   102
  <target name="buildvalidation" >
antonio@6886
   103
    <taskdef name="ValidationHandler" classname="org.openbravo.buildvalidation.ValidationHandler" onerror="failall">
antonio@6886
   104
      <classpath refid="pre.class.path" />
antonio@6886
   105
    </taskdef>
antonio@6886
   106
    <ValidationHandler basedir="${base.src}/../" module="${module}" />
antonio@6886
   107
  </target>
antonio@6886
   108
  
antonio@6886
   109
  <target name="checkmodule"  if="module.not.provided">
antonio@6886
   110
    <fail>You need to specify a module</fail>
antonio@6886
   111
  </target>
antonio@6886
   112
  
antonio@6886
   113
</project>