<!-- ============================================= -->
<!-- NNCompiereJR                                  -->
<!-- ============================================= -->

<project name="NNCompiereJR" default="dist" basedir=".">

  <description>
    Make jar for JasperReports.
  </description>

  <!-- Set global properties for this build -->
  <property name="src.dir" value="src"/>
  <property name="build.dir" value="build"/>
  <property name="dist.dir" value="dist"/>
  <property name="jar.path.dir" value="../lib"/>
  <property name="jar.name" value="NNCompiereJR"/>

  <!-- Set path to include the necessary jar files for javac -->
  <path id="project.classpath">
    <pathelement path="${jar.path.dir}/CTools.jar"/>
    <pathelement path="${jar.path.dir}/oracle.jar"/>
    <pathelement path="../dbPort/dbPort.jar"/>
    <pathelement path="../looks/CLooks.jar"/>
    <pathelement path="../print/Print.jar"/>
    <pathelement path="../tools/lib/junit.jar"/>
    <pathelement path="../interfaces/Interfaces.jar"/>
    <pathelement path="../tools/lib/servlet.jar" />
    <pathelement path="${build.dir}" />
  </path>

  <target name="init" description="Initialization target">
    <echo message="Build NNCompiereJR .........."/>
    <!-- Create the time stamp -->
    <tstamp/>
    <!-- Create the build directory structure used by compile -->
    <mkdir dir="${build.dir}"/>
    <!-- Extract jars for compile and for packing the new jar. -->
    <unjar dest="${build.dir}">
      <fileset dir="lib">
        <include name="**/*.jar"/>
      </fileset>
    </unjar>
    <delete file="${build.dir}/META-INF/MANIFEST.MF" failonerror="false"/>
    <!-- Check for the distribution directory -->
    <available file="${dist.dir}" type="dir" property="dist.dir.exists"/>
  </target>

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

  <target name="compile" depends="makedir">
    <!-- Compile the java code from ${src} into ${build.dir} -->
    <javac srcdir="${src.dir}" destdir="${build.dir}" deprecation="on" source="1.4" target="1.4" debug="on">
      <classpath refid="project.classpath"/>
    </javac>
  </target>

  <target name="dist" depends="compile">
    <!-- Put everything from ${build.dir} into the ${jar.name}.jar file. -->
    <jar jarfile="${dist.dir}/${jar.name}.jar" basedir="${build.dir}"/>
    <!-- Sign the jar. -->
    <signjar jar="${dist.dir}/${jar.name}.jar"
      alias="compiere"
      storepass="${password}" keystore="../keystore/myKeystore"/>
    <!-- Move to the lib directory. -->
    <copy file="${dist.dir}/${jar.name}.jar" todir="../lib"/>
  </target>

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

</project>

<!-- Marco LOMBARDO, 2004-03-17, Lucca, Italy.     -->


