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