src-util/buildvalidation/build.xml
author Antonio Moreno <antonio.moreno@openbravo.com>
Wed, 31 Mar 2010 14:18:01 +0200
changeset 6925 a3266e52e42c
parent 6923 d8e5536b1186
child 6951 bd47ae1e2e06
permissions -rw-r--r--
[validation] Fixed problems with buildvalidations (classloading and classpath issues)
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@6925
    28
    <pathelement path="build/classes/" />
antonio@6907
    29
    <dirset dir="${base.modules}">
antonio@6907
    30
      <include name="*/build/classes/" />
antonio@6907
    31
    </dirset>
antonio@6907
    32
    <fileset dir="${base.lib}">
antonio@6907
    33
      <include name="**/*.jar" />
antonio@6907
    34
    </fileset>
antonio@6907
    35
  </path>
antonio@6907
    36
antonio@6907
    37
  <condition property="module.not.provided">
antonio@6907
    38
    <equals arg1="${module}" arg2="%" />
antonio@6907
    39
  </condition>
antonio@6907
    40
  <condition property="checkCore">
antonio@6907
    41
    <equals arg1="${module}" arg2="org.openbravo" />
antonio@6907
    42
  </condition>
antonio@6917
    43
antonio@6907
    44
  <target name="init">
antonio@6907
    45
    <mkdir dir="${build.pre}" />
antonio@6907
    46
    <mkdir dir="${build.pre.sqlc}" />
antonio@6907
    47
    <mkdir dir="${build.pre.sqlc}/src" />
antonio@6917
    48
    <mkdir dir="${base.modules}/${module}/build/" />
antonio@6917
    49
    <mkdir dir="${base.modules}/${module}/build/javasqlc" />
antonio@6917
    50
    <mkdir dir="${base.modules}/${module}/build/classes" />
antonio@6907
    51
  </target>
antonio@6907
    52
antonio@6907
    53
  <target name="clean">
antonio@6907
    54
    <delete dir="${build.pre}" failonerror="false" includeemptydirs="true" />
antonio@6907
    55
    <delete dir="${build.pre.sqlc}" failonerror="false" includeemptydirs="true" />
antonio@6907
    56
  </target>
antonio@6907
    57
antonio@6916
    58
  <target name="sqlcCore" depends="init" if="checkCore">
antonio@6907
    59
    <java classname="org.openbravo.data.Sqlc" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
antonio@6907
    60
      <arg line="'${base.config}'/Openbravo.properties .xsql ./src/org '${build.pre.sqlc}'" />
antonio@6907
    61
      <classpath refid="pre.class.path" />
antonio@6907
    62
    </java>
stefan@6923
    63
    <javac srcdir="${build.pre.sqlc}/src" includes="**/*.java" destdir="${build.pre}" encoding="UTF-8" debug="true" debuglevel="lines,vars,source">
stefan@6923
    64
      <classpath refid="pre.class.path" />
stefan@6923
    65
    </javac>
antonio@6916
    66
  </target>
antonio@6916
    67
antonio@6916
    68
  <target name="sqlcModules" depends="init" unless="checkCore">
stefan@6923
    69
    <java classname="org.openbravo.data.Sqlc" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
stefan@6923
    70
      <arg line="'${base.config}'/Openbravo.properties .xsql '${base.modules}' '${base.modules}'/'${module}'/src-util/buildvalidation/src */src-util/buildvalidation" />
stefan@6923
    71
      <classpath refid="pre.class.path" />
stefan@6923
    72
    </java>
stefan@6923
    73
    <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
    74
      <classpath refid="pre.class.path" />
stefan@6923
    75
    </javac>
antonio@6907
    76
  </target>
antonio@6907
    77
antonio@6907
    78
  <target name="javacCore" if="checkCore">
antonio@6907
    79
    <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
    80
      <classpath refid="pre.class.path" />
antonio@6907
    81
    </javac>
antonio@6907
    82
  </target>
antonio@6917
    83
antonio@6907
    84
  <target name="javacModule" unless="checkCore">
antonio@6917
    85
    <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
    86
      <classpath refid="pre.class.path" />
antonio@6907
    87
    </javac>
antonio@6907
    88
  </target>
antonio@6907
    89
  
stefan@6923
    90
  <target name="compile" depends="checkmodule, sqlcCore, sqlcModules, javacCore, javacModule">
antonio@6907
    91
  </target>
antonio@6907
    92
antonio@6918
    93
  <target name="buildvalidation" >
antonio@6925
    94
    <java classname="org.openbravo.buildvalidation.BuildValidationHandler" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}" failonerror="yes">
antonio@6925
    95
      <arg value="${base.src}/../"/>
antonio@6925
    96
      <arg value="${module}"/>
antonio@6907
    97
      <classpath refid="pre.class.path" />
antonio@6925
    98
    </java>
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>