devdaily home | apple | java | perl | unix | directory | blog

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

<project default="compile-internal">

  <property name="source.root" value="src"/>
  <property name="dest.root" value="build"/>
  
  <property name="source.delivery" value="${source.root}/delivery/java"/>
  <property name="source.loadable" value="${source.root}/delivery/loadable"/>
  <property name="source.test" value="${source.root}/test/java"/>
  <property name="source.remotetest" value="${source.root}/test/remote"/>
  
  <property name="build.delivery" value="${dest.root}/delivery/classes"/>
  <property name="build.loadable" value="${dest.root}/delivery/WEB-INF/classes"/>
  <property name="build.test" value="${dest.root}/test/classes"/>
  
  <property name="build.compiler" value="javac1.3"/>
  
  <target name="init-compile-internal">
    <tstamp/>
    <mkdir dir="_ext"/>
    <mkdir dir="_lib"/>
    <available property="has.delivery.classes" file="${source.delivery}"/>
    <available property="has.loadable.classes" file="${source.loadable}"/>
    <available property="has.test.classes" file="${source.test}"/>
    <available property="has.remotetest.classes" file="${source.remotetest}"/>
    <available property="junit.found" classname="junit.framework.TestSuite"/>

    <condition property="do.local.tests">
      <and>
        <istrue value="${has.test.classes}"/>
        <istrue value="${junit.found}"/>
      </and>
    </condition>

    <condition property="do.remote.tests">
      <and>
        <istrue value="${has.remotetest.classes}"/>
        <istrue value="${junit.found}"/>
      </and>
    </condition>  

  </target>

  <path id="classpath">
    <pathelement location="${build.delivery}"/>
    <pathelement location="${build.loadable}"/>
    <pathelement location="${build.test}"/>
    <fileset dir="_ext">
      <include name="**/*.jar"/>
    </fileset>
    <fileset dir="_lib">
      <include name="**/*.jar"/>
    </fileset>
    <pathelement path="${java.class.path}"/>
  </path>

  <target name="compile-delivery" depends="init-compile-internal" if="has.delivery.classes">
    <mkdir dir="${build.delivery}"/>
    <javac compiler="${build.compiler}" srcdir="${source.delivery}" destdir="${build.delivery}" debug="on">
      <classpath refid="classpath"/>
    </javac>
  </target>

  <target name="compile-loadable" depends="init-compile-internal" if="has.loadable.classes">
    <mkdir dir="${build.loadable}"/>
    <javac compiler="${build.compiler}" srcdir="${source.loadable}" destdir="${build.loadable}" debug="on">
      <classpath refid="classpath"/>
    </javac>
  </target>

  <target name="compile-local-test" depends="init-compile-internal" if="do.local.tests">
    <mkdir dir="${build.test}"/>
    <javac compiler="${build.compiler}" srcdir="${source.test}" destdir="${build.test}" debug="on">
      <classpath refid="classpath"/>
    </javac>
  </target>

  <target name="compile-remote-test" depends="init-compile-internal" if="do.remote.tests">
    <mkdir dir="${build.test}"/>
    <javac compiler="${build.compiler}" srcdir="${source.remotetest}" destdir="${build.test}" debug="on">
      <classpath refid="classpath"/>
    </javac>
  </target>

  <target name="compile-internal" depends="compile-delivery,compile-loadable,compile-local-test"/>

</project>




Copyright 1998-2008 Alvin Alexander
All Rights Reserved.
 
devdaily.com is based in louisville, kentucky, and this web site is hosted by godaddy.com