src-util/buildvalidation/build.xml
author Antonio Moreno <antonio.moreno@openbravo.com>
Mon, 12 Apr 2010 16:39:13 +0200
changeset 7002 91219b829738
parent 6951 bd47ae1e2e06
child 7537 24cd5a49d2c5
permissions -rw-r--r--
Fixed issue 12942. org.openbravo folders will no longer be created inside modules, when compiling build validations or module scripts.
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@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@6907
    65
    </java>
antonio@6951
    66
    <javac srcdir="${build.validation.sqlc}/src" includes="**/*.java" destdir="${build.validation}" encoding="UTF-8" debug="true" debuglevel="lines,vars,source">
antonio@6951
    67
      <classpath refid="buildvalidation.class.path" />
stefan@6923
    68
    </javac>
antonio@6916
    69
  </target>
antonio@6916
    70
antonio@6916
    71
  <target name="sqlcModules" depends="init" unless="checkCore">
stefan@6923
    72
    <java classname="org.openbravo.data.Sqlc" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
stefan@6923
    73
      <arg line="'${base.config}'/Openbravo.properties .xsql '${base.modules}' '${base.modules}'/'${module}'/src-util/buildvalidation/src */src-util/buildvalidation" />
antonio@6951
    74
      <classpath refid="buildvalidation.class.path" />
stefan@6923
    75
    </java>
stefan@6923
    76
    <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@6951
    77
      <classpath refid="buildvalidation.class.path" />
stefan@6923
    78
    </javac>
antonio@6907
    79
  </target>
antonio@6907
    80
antonio@6907
    81
  <target name="javacCore" if="checkCore">
antonio@6951
    82
    <javac srcdir="${main.dir}" includes="src-util/buildvalidation/src/**/*.java" destdir="${build.validation}" deprecation="on" encoding="UTF-8" debug="true" debuglevel="lines,vars,source">
antonio@6951
    83
      <classpath refid="buildvalidation.class.path" />
antonio@6907
    84
    </javac>
antonio@6907
    85
  </target>
antonio@6917
    86
antonio@6907
    87
  <target name="javacModule" unless="checkCore">
antonio@6917
    88
    <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@6951
    89
      <classpath refid="buildvalidation.class.path" />
antonio@6907
    90
    </javac>
antonio@6907
    91
  </target>
antonio@6907
    92
  
stefan@6923
    93
  <target name="compile" depends="checkmodule, sqlcCore, sqlcModules, javacCore, javacModule">
antonio@6907
    94
  </target>
antonio@6907
    95
antonio@6918
    96
  <target name="buildvalidation" >
antonio@6925
    97
    <java classname="org.openbravo.buildvalidation.BuildValidationHandler" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}" failonerror="yes">
antonio@6925
    98
      <arg value="${base.src}/../"/>
antonio@6925
    99
      <arg value="${module}"/>
antonio@6951
   100
      <classpath refid="buildvalidation.class.path" />
antonio@6925
   101
    </java>
antonio@6907
   102
  </target>
antonio@6907
   103
  
antonio@6907
   104
  <target name="checkmodule"  if="module.not.provided">
antonio@6907
   105
    <fail>You need to specify a module</fail>
antonio@6907
   106
  </target>
antonio@6907
   107
  
antonio@6907
   108
</project>