<!--

    Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.

    This program and the accompanying materials are made available under the
    terms of the Eclipse Public License v. 2.0, which is available at
    http://www.eclipse.org/legal/epl-2.0.

    This Source Code may also be made available under the following Secondary
    Licenses when the conditions for such availability set forth in the
    Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
    version 2 with the GNU Classpath Exception, which is available at
    https://www.gnu.org/software/classpath/license.html.

    SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0

-->

<project name="TS top level" default="usage">

    <property name="all.test.dir" value="com/sun/ts/tests/saaj,
                                         com/sun/ts/tests/signaturetest,
                                         com/sun/ts/tests/signaturetest/saaj"/>

    <!-- IMPORTS -->
    <import file="xml/ts.top.import.xml" optional="true"/>
    <import file="../../../bin/xml/ts.top.import.xml" optional="true"/>
    
    <!-- these targets are needed for configuring the VI and RI implementations for saaj tests -->

    <!-- config.vi/clean.vi -->

    <target name="config.vi" description="Configure vendor implementation under test">
	<ant antfile="${bin.dir}/xml/impl/${impl.vi}/config.vi.xml" target="config.vi" />
    </target>

    <target name="clean.vi" description="Unconfigure vendor implementation under test">
	<ant antfile="${bin.dir}/xml/impl/${impl.vi}/config.vi.xml" target="clean.vi" />
    </target>

    <!-- config.ri/clean.ri -->

    <target name="config.ri" description="Configure reference implementation under test">
	<ant antfile="${bin.dir}/xml/impl/${impl.ri}/config.ri.xml" target="config.ri" />
    </target>

    <target name="clean.ri" description="Unconfigure reference implementation under test">
	<ant antfile="${bin.dir}/xml/impl/${impl.ri}/config.ri.xml" target="clean.ri" />
    </target>

    <!-- start/stop server for vi -->

    <target name="start.server.vi" description="Start vendor implementation under test">
	<ant antfile="${bin.dir}/xml/impl/${impl.vi}/config.vi.xml" target="start-server" />
    </target>

    <target name="stop.server.vi" description="Stop vendor implementation under test">
	<ant antfile="${bin.dir}/xml/impl/${impl.vi}/config.vi.xml" target="stop-server" />
    </target>

    <!-- start/stop server for ri -->

    <target name="start.server.ri" description="Start reference implementation under test">
	<ant antfile="${bin.dir}/xml/impl/${impl.ri}/config.ri.xml" target="start-server" />
    </target>

    <target name="stop.server.ri" description="Stop reference implementation under test">
	<ant antfile="${bin.dir}/xml/impl/${impl.ri}/config.ri.xml" target="stop-server" />
    </target>

    <target name="publishendpoints">
        <ant antfile="publishendpoints.xml" dir="${bin.dir}/xml/deploy" target="publish" />
    </target>

    <!-- **************************************************************** -->
    <!-- Tasks for managing ts specific jar  -->
    <!-- ts specific jar (in this case saajtck.jar) will be created in
          ts.home/lib. -->

  <target name="tslib.clean" depends="translatepath">
        <delete failonerror="false">
       <fileset dir="${class.dir}">
                <include name="${lib.pkg.dir}/deliverable/tck/**" />
                <include name="${lib.pkg.dir}/deliverable/saaj/**" />
                <include name="${lib.pkg.dir}/implementation/sun/common/**" />
      </fileset>
      </delete>
      <delete failonerror="false" file="${ts.home}/lib/${tslib.name}"/>
   </target>

    <target name="tslib.compile" depends="tslib.clean">
        <ts.javac includes="${lib.pkg.dir}/deliverable/tck/**
			    ${lib.pkg.dir}/deliverable/saaj/**
                            ${lib.pkg.dir}/implementation/sun/common/SunRIURL.java">
            <classpath>
                <pathelement path="${ts.harness.classpath}" />
            </classpath>
        </ts.javac>
    </target>


  <target name="tslib" depends="tslib.compile">
    <tstamp/>
     <ts.lib.jar>
            <include name="${lib.pkg.dir}/deliverable/tck/**" />
            <include name="${lib.pkg.dir}/deliverable/saaj/**" />
            <include name="${lib.pkg.dir}/implementation/sun/common/SunRIURL.class" />
        </ts.lib.jar>
  </target>

</project>
