<?xml version="1.0" ?>
<!DOCTYPE project [
        <!ENTITY properties SYSTEM "file:../xmls/properties.xml">
        <!ENTITY paths  SYSTEM "file:../xmls/path_refs.xml">
        <!ENTITY taskdefs SYSTEM "file:../xmls/taskdefs.xml">
        <!ENTITY targets SYSTEM "file:../xmls/targets.xml">
]>

<!-- ===================================================================
<description>
   Tools Component file for Axis

Notes:
   This is a build file for use with the Jakarta Ant build tool.

Prerequisites:

   jakarta-ant from http://jakarta.apache.org

Build Instructions:
   To compile
        ant compile
   To execute
        ant run

Author:
  Matt Seibert mseibert@us.ibm.com

Copyright:
  Copyright (c) 2002-2003 Apache Software Foundation.
</description>
==================================================================== -->

<project name="axis tools" default="compile">
 <description>
 Builds the tools jars used with Axis
 </description>

<property name="axis.home" location=".." />
<property name="tools.dir" location="${axis.home}/tools" />

<property name="componentName" value="org/apache/axis/tools/ant" />
        &properties;
        &paths;
        &taskdefs;
        &targets;
<property name="tools.build.dir" location="${build.dir}/tools" />


<target name="clean" description="cleanup">
    <property name="dir.to.clean" 
      location="${tools.build.dir}/${componentName}" />
    <echo message="Removing ${dir.to.clean}" />
    <delete dir="${dir.to.clean}" />
    <delete file="${build.lib}/axis-ant.jar" failonerror="false"/>
</target>

<target name="copy" depends="setenv"/>

<target name="compile" depends="copy" unless="axis-ant.present"
  description="compile everthing and make the JARs">
  <echo message="Compiling tools.*"/>
  <mkdir dir="${tools.build.dir}"/>
    <!-- build my ForEach task -->
  <echo message="Building ForEach" />
  <javac srcdir="${tools.dir}/${componentName}/foreach" 
    debug="${debug}"
      destdir="${tools.build.dir}">
    <classpath refid="classpath"/>
    <include name="*.java" />
  </javac>

    <!-- build the RunAxisFunctionalTest task -->
  <echo message="Building RunAxisFunctionalTest" />
  <javac srcdir="${tools.dir}/${componentName}/axis" 
    debug="${debug}"
      destdir="${tools.build.dir}">
    <classpath refid="classpath"/>
    <include name="*.java" />
  </javac>

    <!-- build the wsdl2java and java2wsdl tasks -->
  <echo message="Building WSDL tasks" />
  <javac srcdir="${tools.dir}/${componentName}/wsdl"
    debug="${debug}"
    destdir="${tools.build.dir}">
    <classpath>
      <pathelement location="${build.lib}/${name}.jar"/>
      <pathelement location="${build.lib}/${jaxrpc}.jar"/>
      <path refid="classpath"/>
    </classpath>
    <include name="*.java" />
  </javac>

  <copy todir="${build.dir}/tools/${componentName}/foreach" >
     <fileset dir="${tools.dir}/${componentName}/foreach" excludes="**/*.java"/>
  </copy>

  <tstamp/>
  <jar jarfile="${build.lib}/axis-ant.jar" >
    <fileset dir="${tools.build.dir}">
      <include name="${componentName}/**"/>
    </fileset>
    <fileset dir="${tools.dir}"
      includes="*-tasks.properties"/>
    <fileset dir="." file="org/apache/axis.xml"/>
    <manifest>
      <section name="org/apache/axis/tools">
        <attribute name="Implementation-Title" value="Apache Axis"/>
        <attribute name="Implementation-Version" value="${axis.version} ${TSTAMP} ${TODAY}"/> 
        <attribute name="Implementation-Vendor" value="Apache Web Services"/>
      </section>
    </manifest>
  </jar>
</target>

<target name="test" unless="axis-ant.present" description="tests">
   <ant inheritAll="${ant.inheritAll}" inheritRefs="${ant.inheritRefs}" dir="${tools.dir}" antfile="test.xml" /> 
</target>

<property name="xdocs.dir" location="${env.ANT_HOME}/proposal/xdocs" />
<path id="xdoclet.extra.classpath">
  <fileset dir="${build.lib}">
    <include name="**/*.jar"/>
  </fileset>
</path>

<property name="xdoclet.extra.classpath.asprop"
  refid="xdoclet.extra.classpath"/>

<!-- probe for xdocs, which is only in CVS, not redist packages --> 
<target name="probe-xdocs" >
  <available property="xdocs.found" file="${xdocs.dir}/build.xml"/>
</target>



<target name="xdocs" depends="probe-xdocs,compile"
  description="Run xdoclet over the ant tasks to create doc pages"
  if="xdocs.found">
  <echo>
    running xdocs with classpath=${xdoclet.extra.classpath.asprop}
  </echo>  
  <ant inheritAll="${ant.inheritAll}" inheritRefs="${ant.inheritRefs}" dir="${xdocs.dir}">
    <property name="src.dir" location="org/apache/axis/tools/ant/"/>
    <property name="src.root" location="."/>
    <property name="xdoclet.extra.classpath" 
      value="${xdoclet.extra.classpath.asprop}"/>
  </ant>
</target>

  
</project>
