src-util/buildvalidation/build.xml
author Stefan Hühner <stefan.huehner@openbravo.com>
Wed, 04 May 2011 13:53:41 +0200
changeset 11995 e7b20e55553e
parent 9085 79e55dfc8af0
child 22160 b2b40bda6f96
permissions -rw-r--r--
[cleanup] avoid deprecation warnings with ant >= 1.8
set includeanruntime=no to avoid having the ant runtime libs in the classpath
also when compiling something. That's recommended and safer as the compilation
will be more independt from environment 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
priya@9085
     5
* Version  1.1  (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@6951
    21
<project name="openbravo-buildvalidation" default="compile" basedir=".">
antonio@6951
    22
  <property name="build.validation" value="build/classes" />
antonio@6951
    23
  <property name="build.validation.sqlc" value="build/javasqlc" />
antonio@6951
    24
  <property name="build.validation.src" value="src" />
antonio@6907
    25
  <property name="main.dir" value="${basedir}/../.." />
antonio@6907
    26
antonio@6951
    27
  <path id="buildvalidation.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@7002
    43
  
antonio@7002
    44
  <target name="createModuleFolder" unless="checkCore">
antonio@7002
    45
    <mkdir dir="${base.modules}/${module}/build/" />
antonio@7002
    46
    <mkdir dir="${base.modules}/${module}/build/javasqlc" />
antonio@7002
    47
    <mkdir dir="${base.modules}/${module}/build/classes" />
antonio@7002
    48
  </target>
antonio@7002
    49
    
antonio@7002
    50
  <target name="init" depends="createModuleFolder">
antonio@6951
    51
    <mkdir dir="${build.validation}" />
antonio@6951
    52
    <mkdir dir="${build.validation.sqlc}" />
antonio@6951
    53
    <mkdir dir="${build.validation.sqlc}/src" />
antonio@6907
    54
  </target>
antonio@6907
    55
antonio@6907
    56
  <target name="clean">
antonio@6951
    57
    <delete dir="${build.validation}" failonerror="false" includeemptydirs="true" />
antonio@6951
    58
    <delete dir="${build.validation.sqlc}" failonerror="false" includeemptydirs="true" />
antonio@6907
    59
  </target>
antonio@6907
    60
antonio@6916
    61
  <target name="sqlcCore" depends="init" if="checkCore">
antonio@6907
    62
    <java classname="org.openbravo.data.Sqlc" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
antonio@6951
    63
      <arg line="'${base.config}'/Openbravo.properties .xsql ./src/org '${build.validation.sqlc}'" />
antonio@6951
    64
      <classpath refid="buildvalidation.class.path" />
antonio@7592
    65
      <syspropertyset>
antonio@7592
    66
        <propertyref name="java.security.egd" />
antonio@7592
    67
      </syspropertyset>
antonio@6907
    68
    </java>
stefan@11995
    69
    <javac srcdir="${build.validation.sqlc}/src" includes="**/*.java" destdir="${build.validation}" fork="true" encoding="UTF-8" debug="true" debuglevel="lines,vars,source" includeantruntime="false">
antonio@6951
    70
      <classpath refid="buildvalidation.class.path" />
stefan@6923
    71
    </javac>
antonio@6916
    72
  </target>
antonio@6916
    73
antonio@6916
    74
  <target name="sqlcModules" depends="init" unless="checkCore">
stefan@6923
    75
    <java classname="org.openbravo.data.Sqlc" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
antonio@9034
    76
      <arg line="'${base.config}'/Openbravo.properties .xsql '${base.modules}' '${base.modules}'/'${module}'/src-util/buildvalidation/src '${module}'/src-util/buildvalidation" />
antonio@6951
    77
      <classpath refid="buildvalidation.class.path" />
antonio@7592
    78
      <syspropertyset>
antonio@7592
    79
        <propertyref name="java.security.egd" />
antonio@7592
    80
      </syspropertyset>
stefan@6923
    81
    </java>
stefan@11995
    82
    <javac srcdir="${base.modules}/${module}/src-util/buildvalidation/src" includes="**/*.java" destdir="${base.modules}/${module}/build/classes" fork="true" encoding="UTF-8" debug="true" debuglevel="lines,vars,source" includeantruntime="false">
antonio@6951
    83
      <classpath refid="buildvalidation.class.path" />
stefan@6923
    84
    </javac>
antonio@6907
    85
  </target>
antonio@6907
    86
antonio@6907
    87
  <target name="javacCore" if="checkCore">
stefan@11995
    88
    <javac srcdir="${main.dir}" includes="src-util/buildvalidation/src/**/*.java" destdir="${build.validation}" fork="true" deprecation="on" encoding="UTF-8" debug="true" debuglevel="lines,vars,source" includeantruntime="false">
antonio@6951
    89
      <classpath refid="buildvalidation.class.path" />
antonio@6907
    90
    </javac>
antonio@6907
    91
  </target>
antonio@6917
    92
antonio@6907
    93
  <target name="javacModule" unless="checkCore">
stefan@11995
    94
    <javac srcdir="${main.dir}" includes="modules/${module}/src-util/buildvalidation/**/*.java" fork="true" destdir="${base.modules}/${module}/build/classes" deprecation="on" encoding="UTF-8" debug="true" debuglevel="lines,vars,source" includeantruntime="false">
antonio@6951
    95
      <classpath refid="buildvalidation.class.path" />
antonio@6907
    96
    </javac>
antonio@6907
    97
  </target>
antonio@6907
    98
  
stefan@6923
    99
  <target name="compile" depends="checkmodule, sqlcCore, sqlcModules, javacCore, javacModule">
antonio@6907
   100
  </target>
antonio@6907
   101
antonio@7974
   102
  <target name="buildvalidation" if="buildValidation.var">
antonio@6925
   103
    <java classname="org.openbravo.buildvalidation.BuildValidationHandler" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}" failonerror="yes">
antonio@6925
   104
      <arg value="${base.src}/../"/>
antonio@6925
   105
      <arg value="${module}"/>
antonio@6951
   106
      <classpath refid="buildvalidation.class.path" />
antonio@7592
   107
      <syspropertyset>
antonio@7592
   108
        <propertyref name="java.security.egd" />
antonio@7592
   109
      </syspropertyset>
antonio@6925
   110
    </java>
antonio@6907
   111
  </target>
antonio@6907
   112
  
antonio@6907
   113
  <target name="checkmodule"  if="module.not.provided">
antonio@6907
   114
    <fail>You need to specify a module</fail>
antonio@6907
   115
  </target>
antonio@6907
   116
  
antonio@6907
   117
</project>