build.xml
author Asier Lostalé <asier.lostale@openbravo.com>
Wed, 27 May 2015 14:58:33 +0200
changeset 602 d5d21a543e48
parent 483 28c8ab882195
child 717 dc2cd045e1fd
permissions -rw-r--r--
fixed bug 30016: upgrading from 2.50 to pi some FKs are missing

There were 2 scenarios where this occurred:
* FKs from recreated to non recreated tables in case none of them are in AD
* both tables participating in the FK are recreated and the referenced one
is loaded before the referencing one in the model
<?xml version="1.0" encoding="UTF-8" ?>
<!--
************************************************************************************
* Copyright (C) 2001-2008 Openbravo S.L.U.
* Licensed under the Apache Software License version 2.0
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to  in writing,  software  distributed
* under the License is distributed  on  an  "AS IS"  BASIS,  WITHOUT  WARRANTIES  OR
* CONDITIONS OF ANY KIND, either  express  or  implied.  See  the  License  for  the
* specific language governing permissions and limitations under the License.
************************************************************************************
-->
<project default="jar" basedir="." name="dbsourcemanager">

  <property name="build.db.classes" value="${basedir}/build/classes" />
  <property name="build.db.lib" value="${basedir}/build/lib" />
  <property name="build.db.docs" value="${basedir}/docs" />
  <property name="build.db.src" value="${basedir}/src" />
  <property file="dbsm.properties" />

  <path id="db.class.path">
    <fileset dir="${basedir}/lib">
      <include name="**/*.jar" />
    </fileset>
    <fileset dir="${basedir}/lib/build-only">
      <include name="**/*.jar" />
    </fileset>
    <pathelement path="${pathOB}/build/classes/" />
    <fileset dir="${pathOB}/lib">
      <include name="**/*.jar" />
    </fileset>
  </path>

  <target name="init">
    <mkdir dir="${build.db.classes}" />
    <mkdir dir="${build.db.lib}" />
    <mkdir dir="${build.db.docs}" />
  </target>

  <target name="clean">
    <delete dir="${build.db.classes}" failonerror="false" includeemptydirs="true" />
    <delete dir="${build.db.lib}" failonerror="false" includeemptydirs="true" />
    <delete dir="${build.db.docs}" failonerror="false" includeemptydirs="true" />
  </target>

  <target name="set.code.rev" depends="init">
    <exec executable="hg" outputproperty="hg.id" failifexecutionfails="false">
      <arg value="id"/>
      <arg value="-i"/>
    </exec>
    <echo message="${hg.id}" file="${build.db.classes}/rev.id"/>
  </target>
  
  <target name="compile" depends="init">
    <javac srcdir="${build.db.src}" destdir="${build.db.classes}" deprecation="on" encoding="UTF-8" debug="true" debuglevel="lines,vars,source" includeantruntime="false" source="1.6" target="1.6">
      <classpath refid="db.class.path" />
    </javac>
    <copy todir="${build.db.classes}">
      <fileset dir="${build.db.src}" excludes="**/*.java,**/*.form" />
    </copy>
  </target>

  <target name="build.jar">
    <jar destfile="${build.db.lib}/dbsourcemanager.jar">
      <fileset dir="${build.db.classes}" />
      <manifest>
        <attribute name="Built-By" value="Openbravo S.L.U." />
      </manifest>
    </jar>
  </target>


  <target name="doc" depends="init" description="Generate api">
    <javadoc packagenames="*" sourcepath="${build.db.src}" destdir="${build.db.docs}" author="true" version="true" use="true" docencoding="UTF-8" encoding="UTF-8" failonerror="false" windowtitle="${ant.project.name}">
      <classpath refid="db.class.path" />
    </javadoc>
  </target>

  <target name="jar" depends="set.code.rev, compile, build.jar">
  </target>

  <target name="build" depends="jar, doc">
  </target>
  
  <target name="run.tests" depends="compile">
    <ant dir="src-test" target="run.tests" inheritAll="false" inheritRefs="false" useNativeBasedir="true"/>
  </target>

</project>