<!--
  JBoss, Home of Professional Open Source
  Copyright 2006, Red Hat Middleware LLC, and individual contributors
  as indicated by the @author tags.
  See the copyright.txt in the distribution for a full listing
  of individual contributors.
  This copyrighted material is made available to anyone wishing to use,
  modify, copy, or redistribute it subject to the terms and conditions
  of the GNU Lesser General Public License, v. 2.1.
  This program is distributed in the hope that it will be useful, but WITHOUT A
  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
  You should have received a copy of the GNU Lesser General Public License,
  v.2.1 along with this distribution; if not, write to the Free Software
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  MA  02110-1301, USA.


  (C) 2005-2006,
  @author JBoss Inc.
-->
<project name="WSTX" default="com.arjuna.mw.wstx.war" basedir=".">
	<!-- Set module name -->
	<property name="com.arjuna.mwlabs.ts.modulename" value="wstx"/>

	<!-- Set default properties filename -->
	<property name="com.arjuna.mw.wstx.properties" value="wstx.properties"/>

	<!-- Load Build Properties File -->
	<property file="${com.arjuna.mw.wstx.properties}"/>

	<!-- Set property defaults -->
	<property environment="env"/>
	<property name="jboss.home" value="${env.JBOSS_HOME}"/>
	<property name="jboss.server" value="default"/>
	<property name="jboss.lib.dir" location="${jboss.home}/lib"/>
	<property name="jboss.client.lib.dir" location="${jboss.home}/client"/>
	<property name="jboss.server.dir" location="${jboss.home}/server/${jboss.server}"/>
	<property name="jboss.server.lib.dir" location="${jboss.server.dir}/lib"/>
    <property name="jboss.common.lib.dir" location="${jboss.home}/common/lib"/>

	<property name="deploy.dir" value="${jboss.server.dir}/deploy"/>

	<!-- Path names -->
    <property name="com.arjuna.mwlabs.wstx.src" value="classes"/>
    <property name="com.arjuna.mwlabs.wstx.src10" value="classes10"/>
    <property name="com.arjuna.mwlabs.wstx.src11" value="classes11"/>
	<property name="com.arjuna.mwlabs.wstx.dest.root" value="build"/>
    <property name="com.arjuna.mwlabs.wstx.dest" value="build/classes"/>
    <property name="com.arjuna.mwlabs.wstx.dest10" value="build/classes10/classes"/>
    <property name="com.arjuna.mwlabs.wstx.dest11" value="build/classes11/classes"/>
	<property name="com.arjuna.mwlabs.wstx.webapps.dest" value="build/webapps"/>
	<property name="com.arjuna.mwlabs.wstx.jar.dest" value="build/lib"/>
	<property name="com.arjuna.mwlabs.wstx.htdocs.dest" value="build/htdocs"/>

    <!-- classes provided for clients via api jars -->
    <property name="wstx.api.classes" value="com/arjuna/mw/wst/TxContext.class"/>
    <property name="wstx10.api.classes" value="com/arjuna/mw/wst/UserTransaction.class
            com/arjuna/mw/wst/UserTransactionFactory.class com/arjuna/mw/wst/TransactionManager.class
            com/arjuna/mw/wst/TransactionManagerFactory.class com/arjuna/mw/wst/UserBusinessActivity.class
            com/arjuna/mw/wst/UserBusinessActivityFactory.class com/arjuna/mw/wst/BusinessActivityManager.class
            com/arjuna/mw/wst/BusinessActivityManagerFactory.class
            com/arjuna/mw/wst/client/JaxWSHeaderContextProcessor.class
            com/arjuna/mw/wst/client/JaxRPCHeaderContextProcessor.class
            com/arjuna/mw/wst/client/JaxBaseHeaderContextProcessor.class
            com/arjuna/mw/wst/service/JaxWSHeaderContextProcessor.class
            com/arjuna/mw/wst/service/JaxWSSubordinateHeaderContextProcessor.class
            com/arjuna/mw/wst/service/JaxRPCHeaderContextProcessor.class
            com/arjuna/mw/wst/service/JaxBaseHeaderContextProcessor.class"/>
    <property name="wstx11.api.classes" value="com/arjuna/mw/wst11/UserTransaction.class
            com/arjuna/mw/wst11/UserTransactionFactory.class com/arjuna/mw/wst11/TransactionManager.class
            com/arjuna/mw/wst11/TransactionManagerFactory.class com/arjuna/mw/wst11/UserBusinessActivity.class
            com/arjuna/mw/wst11/UserBusinessActivityFactory.class com/arjuna/mw/wst11/BusinessActivityManager.class
            com/arjuna/mw/wst11/BusinessActivityManagerFactory.class
            com/arjuna/mw/wst11/client/JaxWSHeaderContextProcessor.class
            com/arjuna/mw/wst11/client/JaxBaseHeaderContextProcessor.class
            com/arjuna/mw/wst11/service/JaxWSHeaderContextProcessor.class
            com/arjuna/mw/wst11/service/JaxWSSubordinateHeaderContextProcessor.class
            com/arjuna/mw/wst11/service/JaxBaseHeaderContextProcessor.class"/>

	<property name="com.arjuna.mwlabs.wstx.tests.src" value="tests/classes"/>
	<property name="com.arjuna.mwlabs.wstx.tests.dd" value="tests/dd"/>
	<property name="com.arjuna.mwlabs.wstx.tests.dest.root" value="tests/build"/>
	<property name="com.arjuna.mwlabs.wstx.tests.dest" value="tests/build/classes"/>
	<property name="com.arjuna.mwlabs.wstx.tests.dd.dest" value="tests/build/dd"/>
	<property name="com.arjuna.mwlabs.wstx.tests.webapps.dest" value="tests/build/webapps"/>
	<property name="com.arjuna.mwlabs.wstx.tests.jar.dest" value="tests/build/lib"/>

    <property name="com.arjuna.buildsystem.dir" location="../../antbuildsystem"/>
    <property name="com.arjuna.jta.install" location="../../install"/>

    <property name="com.arjuna.buildsystem.lib" location="${com.arjuna.buildsystem.dir}/build/lib"/>
    <property name="com.arjuna.jta.install.lib" location="${com.arjuna.jta.install}/lib"/>
    <property name="com.arjuna.jta.install.ext" location="${com.arjuna.jta.install.lib}/ext"/>
    <property name="com.arjuna.xts.ext" location="../ext"/>

    <property name="com.arjuna.buildsystem.lib.jars" value="buildsystem.jar"/>

    <property name="jta.lib.jars" value="jbossjta.jar jbossjts.jar"/>
    <property name="jta.ext.jars" value="jbossts-common.jar"/>
    <property name="jta.ext.compile.jars" value="commons-logging.jar"/>
    <property name="jboss.client.lib.jars" value="jaxb-api.jar jboss-javaee.jar jbossws-native-jaxrpc.jar
            jbossws-native-jaxws.jar jbossws-client.jar stax-api.jar jbossws-native-saaj.jar
            jbossws-native-jaxws-ext.jar jbossws-native-core.jar jbossws-common.jar jboss-logging-spi.jar"/>
    <property name="jboss.common.lib.jars" value="servlet-api.jar"/>
    <property name="jboss.lib.jars" value="dom4j.jar"/>

    <property name="wsas.libs" value="wsas.jar"/>
    <property name="wsc.libs" value="ws-c.jar"/>
    <property name="wsc-api.libs" value="ws-c-api.jar"/>
    <property name="wsc10.libs" value="ws-c10.jar"/>
    <property name="wsc11.libs" value="ws-c11.jar"/>
    <property name="wsc.all.libs" value="${wsc.libs} ${wsc10.libs} ${wsc11.libs}"/>
    <property name="wscf.libs" value="wscf.jar"/>
    <property name="wscf10.libs" value="wscf10.jar"/>
    <property name="wscf11.libs" value="wscf11.jar"/>
    <property name="wscf.all.libs" value="${wscf.libs} ${wscf10.libs} ${wscf11.libs}"/>
    <property name="wst.libs" value="ws-t.jar"/>
    <property name="wst-api.libs" value="ws-t-api.jar"/>
    <property name="wst10.libs" value="ws-t10.jar"/>
    <property name="wst10-api.libs" value="ws-t10-api.jar"/>
    <property name="wst11.libs" value="ws-t11.jar"/>
    <property name="wst11-api.libs" value="ws-t11-api.jar"/>
    <property name="wst.all.libs" value="${wst.libs} ${wst10.libs} ${wst11.libs}"/>
    <property name="wstx.libs" value="${com.arjuna.mwlabs.ts.modulename}.jar"/>
    <property name="wstx10.libs" value="${com.arjuna.mwlabs.ts.modulename}10.jar"/>
    <property name="wstx11.libs" value="${com.arjuna.mwlabs.ts.modulename}11.jar"/>
    <property name="wstx.all.libs" value="${wstx.libs} ${wstx10.libs} ${wstx11.libs}"/>

    <!--
    <property name="tests.libs" value="junit.jar"/>
    -->
    <property name="tests.libs" value="junit.jar"/>
    <property name="tests.all.libs" value="${wsas.libs} ${wsc.all.libs} ${wscf.all.libs} ${wst.all.libs} ${wstx.all.libs} ${tests.libs}"/>

    <path id="com.arjuna.mwlabs.wstx.tests.lib.path">
        <fileset dir="${com.arjuna.xts.ext}" includes="${tests.libs}"/>
	<fileset dir="${jboss.lib.dir}" includes="${jboss.lib.jars}"/>
    </path>

    <!-- Define classpath builder task -->
    <path id="com.arjuna.buildsystem.classpath">
        <fileset dir="${com.arjuna.buildsystem.lib}" includes="${com.arjuna.buildsystem.lib.jars}"/>
    </path>
    <property name="com.arjuna.buildsystem.classpath" refid="com.arjuna.buildsystem.classpath"/>
	<taskdef name="classpath-builder" classname="com.hp.mw.buildsystem.ant.ClasspathBuilder" classpathref="com.arjuna.buildsystem.classpath"/>
	<!-- class path behaviour -->
	<property name="build.sysclasspath" value="last"/>
	<property name="com.arjuna.mwlabs.classpathbuilderfilename" location="buildsystem.classpath"/>

    <property name="com.arjuna.mwlabs.wstx.resourcebundle"
	      value="wstx_msg_en_US.properties"/>

	<!--Set external directories -->

	<property name="com.arjuna.mwlabs.wsas.jar.dest" value="../WSAS/build/lib"/>
	<property name="com.arjuna.mwlabs.wsc.jar.dest" value="../WS-C/build/dev/lib"/>
	<property name="com.arjuna.mwlabs.wscf.jar.dest" value="../WSCF/build/lib"/>
	<property name="com.arjuna.mwlabs.wst.jar.dest" value="../WS-T/build/dev/lib"/>

    <path id="com.arjuna.mwlabs.wstx.lib.classpath">
        <fileset dir="${com.arjuna.jta.install.lib}" includes="${jta.lib.jars}"/>
        <fileset dir="${com.arjuna.jta.install.ext}" includes="${jta.ext.jars} ${jta.ext.compile.jars}"/>
        <fileset dir="${jboss.client.lib.dir}" includes="${jboss.client.lib.jars}"/>
        <fileset dir="${jboss.common.lib.dir}" includes="${jboss.common.lib.jars}"/>
        <fileset dir="${com.arjuna.mwlabs.wsas.jar.dest}" includes="${wsas.libs}"/>
        <fileset dir="${com.arjuna.mwlabs.wsc.jar.dest}" includes="${wsc.libs} ${wsc-api.libs}"/>
        <fileset dir="${com.arjuna.mwlabs.wscf.jar.dest}" includes="${wscf.libs}"/>
        <fileset dir="${com.arjuna.mwlabs.wst.jar.dest}" includes="${wst.libs} ${wst-api.libs}"/>
    </path>

    <path id="com.arjuna.mwlabs.wstx.lib.classpath10">
        <fileset dir="${com.arjuna.mwlabs.wsc.jar.dest}" includes="${wsc10.libs}"/>
        <fileset dir="${com.arjuna.mwlabs.wscf.jar.dest}" includes="${wscf10.libs}"/>
        <fileset dir="${com.arjuna.mwlabs.wst.jar.dest}" includes="${wst10.libs}  ${wst10-api.libs}"/>
    </path>

    <path id="com.arjuna.mwlabs.wstx.lib.classpath11">
        <fileset dir="${com.arjuna.mwlabs.wsc.jar.dest}" includes="${wsc11.libs}"/>
        <fileset dir="${com.arjuna.mwlabs.wscf.jar.dest}" includes="${wscf11.libs}"/>
        <fileset dir="${com.arjuna.mwlabs.wst.jar.dest}" includes="${wst11.libs}  ${wst11-api.libs}"/>
    </path>

	<!-- Initialisation -->
	<target name="com.arjuna.mwlabs.wstx.init">
		<!-- Define default build properties -->
		<tstamp>
			<format property="com.arjuna.mw.wstx.date" pattern="yyyy/mm/dd hh:mm aa"/>
		</tstamp>
		<!-- Make the destination directory -->
        <mkdir dir="${com.arjuna.mwlabs.wstx.dest}"/>
        <mkdir dir="${com.arjuna.mwlabs.wstx.dest10}"/>
        <mkdir dir="${com.arjuna.mwlabs.wstx.dest11}"/>
		<mkdir dir="${com.arjuna.mwlabs.wstx.webapps.dest}"/>
	</target>

	<!-- Compilation targets -->

	<target name="com.arjuna.mw.wstx.compile"
	depends="com.arjuna.mwlabs.wstx.compile,
		com.arjuna.mw.wstx.htdocs, com.arjuna.mwlabs.wstx.generateresourcebundle"/>

    <target name="com.arjuna.mwlabs.wstx.compile" depends="com.arjuna.mwlabs.wstx.compile11, com.arjuna.mwlabs.wstx.compile10"/>

    <target name="com.arjuna.mwlabs.wstx.compile10" depends="com.arjuna.mwlabs.wstx.compile-generic">
        <echo message="Compiling module 1.0 code"/>
        <javac srcdir="${com.arjuna.mwlabs.wstx.src10}"
                       destdir="${com.arjuna.mwlabs.wstx.dest10}"
                       debug="on">
            <classpath>
                <path>
                    <pathelement path="${com.arjuna.mwlabs.wstx.dest}"/>
                </path>
                <path refid="com.arjuna.mwlabs.wstx.lib.classpath10"/>
                <path refid="com.arjuna.mwlabs.wstx.lib.classpath"/>
            </classpath>
        </javac>
    </target>

    <target name="com.arjuna.mwlabs.wstx.compile11" depends="com.arjuna.mwlabs.wstx.compile-generic">
        <echo message="Compiling module 1.1 code"/>
        <javac srcdir="${com.arjuna.mwlabs.wstx.src11}"
                       destdir="${com.arjuna.mwlabs.wstx.dest11}"
                       debug="on">
            <classpath>
                <path>
                    <pathelement path="${com.arjuna.mwlabs.wstx.dest}"/>
                </path>
                <path refid="com.arjuna.mwlabs.wstx.lib.classpath11"/>
                <path refid="com.arjuna.mwlabs.wstx.lib.classpath"/>
            </classpath>
        </javac>
    </target>

    <target name="com.arjuna.mwlabs.wstx.compile-generic" depends="com.arjuna.mwlabs.wstx.init">
        <echo message="Compiling module generic code"/>
        <javac srcdir="${com.arjuna.mwlabs.wstx.src}"
                       destdir="${com.arjuna.mwlabs.wstx.dest}"
                       debug="on">
            <classpath>
                <path refid="com.arjuna.mwlabs.wstx.lib.classpath"/>
            </classpath>
        </javac>
    </target>

	<!-- htdocs paths -->
	<path id="com.arjuna.mw.wstx.htdocs.path">
		<pathelement path="classes"/>
	</path>

	<!-- Build htdocs for just mw, or mw and mwlabs -->
	<property name="com.arjuna.mwlabs.wstx.htdocs.list" value="com.arjuna.mw.*"/>

    <target name="com.arjuna.mw.wstx.war" depends="com.arjuna.mw.wstx.jar">
        <war warfile="${com.arjuna.mwlabs.wstx.webapps.dest}/${com.arjuna.mwlabs.ts.modulename}10.war" webxml="xml/wstx_web-app.xml"/>
        <war warfile="${com.arjuna.mwlabs.wstx.webapps.dest}/${com.arjuna.mwlabs.ts.modulename}11.war" webxml="xml/wstx_web-app11.xml"/>
    </target>

	<!-- Jar targets -->
	<target name="com.arjuna.mw.wstx.jar" depends="com.arjuna.mw.wstx.compile">
		<echo message="Building jar file"/>
		<mkdir dir="${com.arjuna.mwlabs.wstx.jar.dest}"/>

        <copy file="xml/UserTwoPhaseTx.xml"
              tofile="${com.arjuna.mwlabs.wstx.dest10}/com/arjuna/mwlabs/wstx/model/as/twophase/UserTwoPhaseTx.xml"/>

        <copy file="xml/UserTwoPhaseTx.xml"
              tofile="${com.arjuna.mwlabs.wstx.dest11}/com/arjuna/mwlabs/wstx11/model/as/twophase/UserTwoPhaseTx.xml"/>

        <copy file="xml/AtomicTransaction.xml"
              tofile="${com.arjuna.mwlabs.wstx.dest10}/com/arjuna/mwlabs/wst/at/ContextFactoryImple.xml"/>
        <copy file="xml/BusinessActivity.xml"
              tofile="${com.arjuna.mwlabs.wstx.dest10}/com/arjuna/mwlabs/wst/ba/ContextFactoryImple.xml"/>

        <copy file="xml/AtomicTransaction11.xml"
              tofile="${com.arjuna.mwlabs.wstx.dest11}/com/arjuna/mwlabs/wst11/at/ContextFactoryImple.xml"/>
        <copy file="xml/BusinessActivity11.xml"
              tofile="${com.arjuna.mwlabs.wstx.dest11}/com/arjuna/mwlabs/wst11/ba/ContextFactoryImple.xml"/>


        <jar jarfile="${com.arjuna.mwlabs.wstx.jar.dest}/${com.arjuna.mwlabs.ts.modulename}.jar">
            <fileset dir="../WS-C/build/dev/dd/" includes="wsdl/*"/>
            <fileset dir="../WS-T/build/dev/dd/" includes="wsdl/*"/>
            <fileset dir="${com.arjuna.mwlabs.wstx.dest}" excludes="${wstx.api.classes}"/>
        </jar>
        <jar jarfile="${com.arjuna.mwlabs.wstx.jar.dest}/${com.arjuna.mwlabs.ts.modulename}-api.jar">
            <fileset dir="${com.arjuna.mwlabs.wstx.dest}" includes="${wstx.api.classes}"/>
        </jar>
        <jar jarfile="${com.arjuna.mwlabs.wstx.jar.dest}/${com.arjuna.mwlabs.ts.modulename}10.jar">
            <fileset dir="${com.arjuna.mwlabs.wstx.dest10}" excludes="${wstx10.api.classes}"/>
        </jar>
        <jar jarfile="${com.arjuna.mwlabs.wstx.jar.dest}/${com.arjuna.mwlabs.ts.modulename}10-api.jar">
            <fileset dir="${com.arjuna.mwlabs.wstx.dest10}" includes="${wstx10.api.classes}"/>
        </jar>
        <jar jarfile="${com.arjuna.mwlabs.wstx.jar.dest}/${com.arjuna.mwlabs.ts.modulename}11.jar">
            <fileset dir="${com.arjuna.mwlabs.wstx.dest11}" excludes="${wstx11.api.classes}"/>
        </jar>
        <jar jarfile="${com.arjuna.mwlabs.wstx.jar.dest}/${com.arjuna.mwlabs.ts.modulename}11-api.jar">
            <fileset dir="${com.arjuna.mwlabs.wstx.dest11}" includes="${wstx11.api.classes}"/>
        </jar>
	</target>

	<target name="com.arjuna.mw.wstx.htdocs"
				depends="com.arjuna.mwlabs.wstx.init">
		<echo message="Building htdocs "/>
		<mkdir dir="${com.arjuna.mwlabs.wstx.htdocs.dest}"/>
		<path id="com.arjuna.mwlabs.wstx.htdocs.path">
			<path refid="com.arjuna.mw.wstx.htdocs.path"/>
		</path>

		<javadoc
			sourcepathref="com.arjuna.mwlabs.wstx.htdocs.path"
			destdir="${com.arjuna.mwlabs.wstx.htdocs.dest}"
			packagenames="${com.arjuna.mwlabs.wstx.htdocs.list}"
	        >
			<classpath>
                <path refid="com.arjuna.mwlabs.wstx.lib.classpath"/>
				<path path="${com.arjuna.mwlabs.wstx.src}"/>
			</classpath>
		</javadoc>
	</target>

        <target name="com.arjuna.mwlabs.wstx.generateresourcebundle">

            <echo message="Generating WSTX Bundle"/>

            <classpath-builder filename="${com.arjuna.mwlabs.classpathbuilderfilename}" inproperty="build.classpath"/>

            <javadoc    packagenames="com.arjuna.*"
                        failonerror="yes"
                        private="yes"
                        defaultexcludes="yes"
                        classpath="${build.classpath}">

                <packageset dir="${com.arjuna.mwlabs.wstx.src}" defaultexcludes="yes">
                  <include name="com/arjuna/**"/>
                </packageset>

                <packageset dir="${com.arjuna.mwlabs.wstx.src10}" defaultexcludes="yes">
                  <include name="com/arjuna/**"/>
                </packageset>

                <packageset dir="${com.arjuna.mwlabs.wstx.src11}" defaultexcludes="yes">
                  <include name="com/arjuna/**"/>
                </packageset>

                 <doclet name="com.hp.mw.buildsystem.doclet.resbundledoclet.ResourceBundleDoclet">
                    <path>
                        <pathelement path="${com.arjuna.buildsystem.classpath}"/>
                    </path>
                    <param name="-basedir" value="${basedir}/${com.arjuna.mwlabs.wstx.dest}"/>
                    <param name="-resourcebundle" value="${com.arjuna.mwlabs.wstx.resourcebundle}"/>
                 </doclet>
            </javadoc>

        </target>

	<target name="com.arjuna.mwlabs.wstx.tests.init">
        <!-- delete the test destination directories -->
        <delete dir="${com.arjuna.mwlabs.wstx.tests.dest.root}"/>
		<!-- make the test destination directories -->
		<mkdir dir="${com.arjuna.mwlabs.wstx.tests.dest.root}"/>
		<mkdir dir="${com.arjuna.mwlabs.wstx.tests.dest}"/>
		<mkdir dir="${com.arjuna.mwlabs.wstx.tests.dd.dest}"/>
		<mkdir dir="${com.arjuna.mwlabs.wstx.tests.webapps.dest}"/>
		<mkdir dir="${com.arjuna.mwlabs.wstx.tests.jar.dest}"/>
	</target>

    <!-- this assumes all the rwuired libs have been built -->
	<target name="com.arjuna.mwlabs.wstx.tests.compile" depends="com.arjuna.mwlabs.wstx.tests.init">
	  <javac destdir="${com.arjuna.mwlabs.wstx.tests.dest}" debug="yes" optimize="no">
	    <classpath>
            <pathelement path="${com.arjuna.mwlabs.wstx.jar.dest}/${com.arjuna.mwlabs.ts.modulename}.jar"/>
            <pathelement path="${com.arjuna.mwlabs.wstx.jar.dest}/${com.arjuna.mwlabs.ts.modulename}-api.jar"/>
            <pathelement path="${com.arjuna.mwlabs.wstx.jar.dest}/${com.arjuna.mwlabs.ts.modulename}10.jar"/>
            <pathelement path="${com.arjuna.mwlabs.wstx.jar.dest}/${com.arjuna.mwlabs.ts.modulename}10-api.jar"/>
            <pathelement path="${com.arjuna.mwlabs.wstx.jar.dest}/${com.arjuna.mwlabs.ts.modulename}11.jar"/>
            <pathelement path="${com.arjuna.mwlabs.wstx.jar.dest}/${com.arjuna.mwlabs.ts.modulename}11-api.jar"/>
            <path refid="com.arjuna.mwlabs.wstx.tests.lib.path"/>
            <path refid="com.arjuna.mwlabs.wstx.lib.classpath10"/>
            <path refid="com.arjuna.mwlabs.wstx.lib.classpath11"/>
            <path refid="com.arjuna.mwlabs.wstx.lib.classpath"/>
	    </classpath>
	    <src path="${com.arjuna.mwlabs.wstx.tests.src}"/>
	  </javac>
	</target>

    <!-- this assumes all the rwuired libs have been built -->
    <target name="com.arjuna.mwlabs.wstx.tests.compile11" depends="com.arjuna.mwlabs.wstx.tests.init">
      <javac destdir="${com.arjuna.mwlabs.wstx.tests.dest}" debug="yes" optimize="no">
        <classpath>
            <pathelement path="${com.arjuna.mwlabs.wstx.jar.dest}/${com.arjuna.mwlabs.ts.modulename}.jar"/>
            <pathelement path="${com.arjuna.mwlabs.wstx.jar.dest}/${com.arjuna.mwlabs.ts.modulename}-api.jar"/>
            <pathelement path="${com.arjuna.mwlabs.wstx.jar.dest}/${com.arjuna.mwlabs.ts.modulename}11.jar"/>
            <pathelement path="${com.arjuna.mwlabs.wstx.jar.dest}/${com.arjuna.mwlabs.ts.modulename}11-api.jar"/>
            <path refid="com.arjuna.mwlabs.wstx.tests.lib.path"/>
            <path refid="com.arjuna.mwlabs.wstx.lib.classpath10"/>
            <path refid="com.arjuna.mwlabs.wstx.lib.classpath11"/>
            <path refid="com.arjuna.mwlabs.wstx.lib.classpath"/>
        </classpath>
        <src path="${com.arjuna.mwlabs.wstx.tests.src}"/>
        <include  name="com/arjuna/qa/**"/>
        <include  name="com/arjuna/wst/tests/common/**"/>
        <include  name="com/arjuna/wst11/tests/**"/>
        <include  name="com/arjuna/wstx11/tests/**"/>
      </javac>
    </target>

	<target name="com.arjuna.mwlabs.wstx.tests.webapps" depends="com.arjuna.mwlabs.wstx.tests.compile">
	  <copy file="${com.arjuna.mwlabs.wstx.tests.dd}/wstx-tests_web-app.xml" tofile="${com.arjuna.mwlabs.wstx.tests.dd.dest}/web-app.xml">
	  </copy>
	  <copy file="${com.arjuna.mwlabs.wstx.tests.dd}/wstx11-tests_web-app.xml" tofile="${com.arjuna.mwlabs.wstx.tests.dd.dest}/web-app11.xml">
	  </copy>
	  <jar jarfile="${com.arjuna.mwlabs.wstx.tests.webapps.dest}/wstx-tests.jar">
	    <fileset dir="${com.arjuna.mwlabs.wstx.tests.dest}"/>
	  </jar>
	  <war warfile="${com.arjuna.mwlabs.wstx.tests.webapps.dest}/wstx-tests.war" webxml="${com.arjuna.mwlabs.wstx.tests.dd.dest}/web-app.xml">
	    <classes dir="${com.arjuna.mwlabs.wstx.tests.dest}"/>
	  </war>
	  <war warfile="${com.arjuna.mwlabs.wstx.tests.webapps.dest}/wstx11-tests.war" webxml="${com.arjuna.mwlabs.wstx.tests.dd.dest}/web-app11.xml"/>
	  <ear earfile="${com.arjuna.mwlabs.wstx.tests.webapps.dest}/wstx-tests.ear" appxml="${com.arjuna.mwlabs.wstx.tests.dd}/wstx-tests_application.xml">
        <!--
	    <fileset dir="${com.arjuna.jta.install.ext}" includes="${jta.ext.jars}"/>
	    -->
	    <fileset dir="${com.arjuna.xts.ext}" includes="${tests.libs}"/>
	    <!-- we don't need to include these libs if we are
	         deploying to JBossAs. The XTS libs are already
	         deployed as a sar and the JTA lib is in the app
	         server lib directory


	    <fileset dir="${com.arjuna.jta.install.lib}" includes="${jta.lib.jars}"/>
	    <fileset dir="${com.arjuna.mwlabs.wsas.jar.dest}" includes="${wsas.libs}"/>
	    <fileset dir="${com.arjuna.mwlabs.wsc.jar.dest}" includes="${wsc.libs}"/>
	    <fileset dir="${com.arjuna.mwlabs.wscf.jar.dest}" includes="${wscf.libs}"/>
	    <fileset dir="${com.arjuna.mwlabs.wst.jar.dest}" includes="${wst.libs}"/>
	    <fileset dir="${com.arjuna.mwlabs.wstx.jar.dest}" includes="${wstx.libs}"/>
	    -->
	    <fileset dir="${com.arjuna.mwlabs.wstx.tests.webapps.dest}" includes="wstx-tests.war wstx11-tests.war wstx-tests.jar"/>
	  </ear>
	</target>

	<target name="com.arjuna.mwlabs.wstx.tests.webapps11" depends="com.arjuna.mwlabs.wstx.tests.compile11">
	  <copy file="${com.arjuna.mwlabs.wstx.tests.dd}/wstx11-tests_web-app.xml" tofile="${com.arjuna.mwlabs.wstx.tests.dd.dest}/web-app11.xml">
	  </copy>
	  <jar jarfile="${com.arjuna.mwlabs.wstx.tests.webapps.dest}/wstx-tests.jar">
	    <fileset dir="${com.arjuna.mwlabs.wstx.tests.dest}"/>
	  </jar>
	  <war warfile="${com.arjuna.mwlabs.wstx.tests.webapps.dest}/wstx11-tests.war" webxml="${com.arjuna.mwlabs.wstx.tests.dd.dest}/web-app11.xml"/>
	  <ear earfile="${com.arjuna.mwlabs.wstx.tests.webapps.dest}/wstx-tests.ear" appxml="${com.arjuna.mwlabs.wstx.tests.dd}/wstx11-tests_application.xml">
	    <fileset dir="${com.arjuna.xts.ext}" includes="${tests.libs}"/>
	    <fileset dir="${com.arjuna.mwlabs.wstx.tests.webapps.dest}" includes="wstx11-tests.war wstx-tests.jar"/>
	  </ear>
	</target>

	<target name="com.arjuna.mwlabs.wstx.tests.deploy" depends="com.arjuna.mwlabs.wstx.tests.webapps, com.arjuna.mwlabs.wstx.tests.undeploy">
	  <copy file="${com.arjuna.mwlabs.wstx.tests.webapps.dest}/wstx-tests.ear" tofile="${deploy.dir}/wstx-tests.ear"/>
	</target>

    <target name="com.arjuna.mwlabs.wstx.tests.deploy11" depends="com.arjuna.mwlabs.wstx.tests.webapps11, com.arjuna.mwlabs.wstx.tests.undeploy">
      <copy file="${com.arjuna.mwlabs.wstx.tests.webapps.dest}/wstx-tests.ear" tofile="${deploy.dir}/wstx-tests.ear"/>
    </target>

	<target name="com.arjuna.mwlabs.wstx.tests.undeploy">
	  <delete file="${deploy.dir}/wstx-tests.ear"/>
	</target>

	<!-- Clean targets -->
	<target name="com.arjuna.mw.wstx.clean">
		<echo message="Cleaning module"/>
		<delete dir="${com.arjuna.mwlabs.wstx.dest}"/>
		<delete dir="${com.arjuna.mwlabs.wstx.dest.root}"/>
		<delete dir="${com.arjuna.mwlabs.wstx.htdocs.dest}"/>
        <delete file="${com.arjuna.mwlabs.wstx.jar.dest}/${com.arjuna.mwlabs.ts.modulename}.jar"/>
		<delete file="${com.arjuna.mwlabs.wstx.info.dest}"/>
		<!-- delete the test destination directories -->
		<delete dir="${com.arjuna.mwlabs.wstx.tests.dest.root}"/>
	</target>

	<!-- Short target names -->
	<target name="compile" depends="com.arjuna.mw.wstx.compile"/>
	<target name="jar" depends="com.arjuna.mw.wstx.jar"/>
	<target name="war" depends="com.arjuna.mw.wstx.war"/>
	<target name="clean" depends="com.arjuna.mw.wstx.clean"/>
	<target name="tests-webapps" depends="com.arjuna.mwlabs.wstx.tests.webapps"/>
	<target name="tests-webapps11" depends="com.arjuna.mwlabs.wstx.tests.webapps11"/>
	<!-- production target for 1.1 tests -->
    <target name="tests-11" depends="tests-webapps11"/>
    <target name="tests-both" depends="tests-webapps"/>

	<target name="tests-deploy" depends="com.arjuna.mwlabs.wstx.tests.deploy"/>
	<target name="tests-deploy11" depends="com.arjuna.mwlabs.wstx.tests.deploy11"/>
	<target name="tests-undeploy" depends="com.arjuna.mwlabs.wstx.tests.undeploy"/>
</project>
