<!--

    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="JSTL top level" default="usage">
    
    <!-- IMPORTS -->
    <import file="xml/ts.top.import.xml" optional="true"/>
    <import file="../../../bin/xml/ts.top.import.xml" optional="true"/>

    <!-- PROPERTIES -->
    <property name="lib.jar" value="${ts.home}/lib/jstltck.jar"/>

    <!-- Passed to the run.all target in ts.top.import.xml -->
    <property name="all.test.dir" 
              value="com/sun/ts/tests/jstl, com/sun/ts/tests/common/webclient,
                     com/sun/ts/tests/signaturetest/jstl"/>

    <!-- Used for checkServer target -->
    <property name="impl.vi.host" value="${webServerHost}"/>
    <property name="impl.vi.port" value="${webServerPort}"/>

    <!-- TARGETS -->
    <target name="-package.all" description="Package All Test Archives.">
        <ant dir="${src.dir}/com/sun/ts/tests/jstl" target="package"/>
        <echo message="Packaging the test archives."/>
    	<ant dir="${src.dir}/com/sun/ts/tests/signaturetest/jstl" target="build"/>
    	<ant dir="${src.dir}/com/sun/ts/tests/signaturetest" target="build"/>
    </target>

    <target name="tslib.clean">
        <delete failonerror="false">
            <fileset dir="${class.dir}">
                <include name="${lib.pkg.dir}/deliverable/tck/*.class"/>
                <include name="${lib.pkg.dir}/deliverable/jstl/*"/>
                <include name="${lib.pkg.dir}/implementation/sun/common/SunRIURL.class"/>
            </fileset>
        </delete>
        <delete failonerror="false" file="${lib.jar}"/>
    </target>

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

    <target name="tslib" depends="tslib.compile">
        <tstamp/>
        <jar jarfile="${lib.jar}" basedir="${class.dir}">
            <include name="${lib.pkg.dir}/deliverable/tck/*.class"/>
            <include name="${lib.pkg.dir}/deliverable/jstl/*"/>
            <include name="${lib.pkg.dir}/implementation/sun/common/SunRIURL.class"/>
        </jar>
        <echo message="The TCK specific library jar, 'jstltck.jar', has been built."/>
    </target>

    <target name="init.derby">
        <ant antfile="./initdb.xml" target="init.derby"/>
        <ant target="-package.all"/>
    </target>

    <target name="init.javadb" >
        <antcall target="init.derby"/>
        <ant target="-package.all"/>
    </target>

    <target name="init.db2">
        <ant antfile="./initdb.xml" target="init.db2"/>
        <ant target="-package.all"/>
    </target>

    <target name="init.mssqlserver">
        <ant antfile="./initdb.xml" target="init.mssqlserver"/>
        <ant target="-package.all"/>
    </target>

    <target name="init.mysql">
        <ant antfile="./initdb.xml" target="init.mysql"/>
        <ant target="-package.all"/>
    </target>

    <target name="init.oracle">
        <ant antfile="./initdb.xml" target="init.oracle"/>
        <ant target="-package.all"/>
    </target>

    <target name="init.postgresql" >
        <ant antfile="./initdb.xml" target="init.postgresql"/>
        <ant target="-package.all"/>
    </target>

    <target name="init.pointbase">
        <ant antfile="./initdb.xml" target="init.pointbase"/>
        <ant target="-package.all"/>
    </target>
    
    <target name="init.sybase">
        <ant antfile="./initdb.xml" target="init.sybase"/>
        <ant target="-package.all"/>
    </target>


   <!--
        NOTE:  with Java SE 8 security changes, it will be necessary to 
        set the following JVM properties on the appserver in order to ensure
        all tests pass.  The following JVM properties will need to exist and 
        be set within the appserver if security manager is enabled:
           -Djavax.xml.accessExternalStylesheet=all
           -Djavax.xml.accessExternalSchema=all
           -Djavax.xml.accessExternalDTD=file,http
     -->
    <target name="add.jvm.options" >
<!--
         <antcall target="create-one-jvm-option" >
            <param name="jvm.options" value=" -Djavax.xml.accessExternalStylesheet=all"/>
         </antcall>

         <antcall target="create-one-jvm-option" >
            <param name="jvm.options" value=" -Djavax.xml.accessExternalSchema=all"/>
         </antcall>

         <antcall target="create-one-jvm-option" >
            <param name="jvm.options" value=" -Djavax.xml.accessExternalDTD=file,http"/>
         </antcall>
-->
    </target>



</project>              
