<!--

    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="JSF 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/jsftck.jar" />

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

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

	<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/jsf/*" />
				<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/jsf/*,
                            ${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/jsf/*" />
			<include name="${lib.pkg.dir}/implementation/sun/common/SunRIURL.class" />
		</jar>
		<echo message="The TCK specific library jar, 'jsftck.jar', has been built." />
	</target>
</project>
