<!-- ============================================= -->
<!-- Print                                         -->
<!-- ============================================= -->
<!-- $Header: /cvs/adempiere/print/build.xml,v 1.2 2006/07/03 16:52:01 jjanke Exp $ -->

<project name="print" default="printDistribute" basedir=".">

  <description>
    This buildfile is used to build the print subproject within 
    the Adempiere project.
  </description>

  <!-- set global properties for this build -->
  <!--<property environment="env"/>-->
  <import file="../utils_dev/properties.xml"/>
  <property name="src" value="src"/>
  <property name="build.dir" value="build"/>
  <property name="dist.dir" value="."/>
  <property name="jar.path" value="../lib"/>
  <property name="jar.name" value="Print"/>

  <!-- set path to include the necessary jar files for javac -->
  <path id="project.class.path">
    <pathelement path="${classpath}"/>
    <pathelement path="../lib/CCTools.jar"/>
    <pathelement path="../looks/CLooks.jar"/>
    <pathelement path="../dbPort/dbPort.jar"/>
    <pathelement path="../lib/customization.jar"/>
    <pathelement path="../lib/patches.jar"/>
	<pathelement path="../tools/lib/jpedal.jar"/>
	<pathelement path="../tools/lib/itext-1.4.8.jar"/>
  </path>


  <target name="printInit" description="initialization target">
    <echo message="=========== Build Print"/>
    <!-- create the time stamp -->
    <tstamp/>
    <!-- create the build directory structure used by compile -->
    <mkdir dir="${build.dir}"/>
    <!-- check for the distribution directory -->
    <available file="${dist.dir}" type="dir" property="dist.dir.exists"/>
  </target>

  <target name="printMakedir" depends="printInit" unless="dist.dir.exists">
    <!-- create the distribution directory if not available -->
    <mkdir dir="${dist}/${dist.dir}"/>
  </target>

  
  <target name="printCompile" depends="printMakedir">
    <!-- compile the java code from ${src} into ${build.dir} -->
    <javac srcdir="${src}" destdir="${build.dir}" 
    	deprecation="on" debug="on" encoding="${env.ENCODING}">
      <classpath refid="project.class.path"/>
    </javac>
    <!-- copy all image & sound files from src to the build directory -->
    <copy todir="${build.dir}">
      <fileset dir="${src}">
        <include name="**/images/*"/>
        <include name="**/*.gif"/>
        <include name="**/*.png"/>
        <include name="**/*.jpg"/>
        <include name="**/*.wav"/>
        <include name="**/*.htm"/>
        <include name="**/*.html"/>
        <include name="**/*.properties"/>
        <exclude name="**/package.html"/>
      </fileset>
    </copy>
  </target>


  <!-- =========================================== -->
  <!-- Distribution                                -->
  <!-- =========================================== -->
  <target name="printDistribute" depends="printCompile">
    <!-- put everything from ${build.dir} into the ${jar.name}.jar file -->
    <jar jarfile="${dist.dir}/${jar.name}.jar" basedir="${build.dir}"/>
  </target>


  <target name="clean">
    <!-- Delete the ${build.dir} directory trees -->
    <delete dir="${build.dir}"/>
    <delete file="${dist.dir}/${jar.name}.jar" failonerror="false"/>
  </target>

</project>