alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Friki example source code file (compile-internal.xml)

This example Friki source code file (compile-internal.xml) 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.

Java - Friki tags/keywords

The Friki compile-internal.xml 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>

Other Friki examples (source code examples)

Here is a short list of links related to this Friki compile-internal.xml source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.