blob: ff92576dddbd547a6bc9b49cc55d04965d6d3518 [file] [log] [blame]
<?xml version="1.0" ?>
<!--
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
-->
<!-- ================================================================== -->
<!-- Web-JSF Test build file -->
<!-- ================================================================== -->
<!DOCTYPE project [
<!ENTITY commonSetup SYSTEM "file:./../../config/properties.xml">
<!ENTITY commonBuild SYSTEM "file:./../../config/common.xml">
]>
<project name="JSFTest" default="all" basedir=".">
&commonSetup;
&commonBuild;
<property name="src.dir" value="src" />
<property environment="env" />
<property name="jars.dir" value="../../lib" />
<property name="classpath" value="" />
<property name="build.base.dir" value="${env.APS_HOME}/build/module"/>
<property name="classes.dir" value="classes" />
<property name="assemble.dir" value="${build.base.dir}/archive"/>
<property name="assemble.jar" value="${assemble.dir}/jar"/>
<property name="assemble.war" value="${assemble.dir}/war"/>
<property name="appname" value="jsfcomponents"/>
<property name="jar" value="${appname}.jar"/>
<property name="war" value="${appname}-web.war"/>
<property name="contextroot" value="${appname}"/>
<property name="test.class" value="JSFTest" />
<property name="app.pkg" value="components"/>
<property name="demo.pkg" value="demo"/>
<!-- ============================================================== -->
<!-- overall target -->
<!-- ============================================================== -->
<target name="all" depends="clean,build,deploy,run,undeploy"/>
<target name="run-test" depends="clean,build,deploy,run,undeploy"/>
<!-- =============================================================== -->
<!-- Define the classpath used for compilation and test. -->
<!-- =============================================================== -->
<path id="base.classpath">
<fileset dir="${jars.dir}">
<include name="*.jar"/>
</fileset>
<pathelement location="${env.S1AS_HOME}/lib/jakartaee.jar" />
<pathelement location="${env.S1AS_HOME}/lib/appserv-jstl.jar" />
<pathelement location="${classpath}" />
</path>
<!-- ============================================================== -->
<!-- Compile the source code -->
<!-- ============================================================== -->
<target name="compile" depends="init-common">
<mkdir dir="${build.classes.dir}" />
<javac srcdir="${src.dir}" destdir="${build.classes.dir}"
debug="on" deprecation="off" optimize="off">
<classpath>
<path refid="base.classpath" />
</classpath>
</javac>
</target>
<!-- ============================================================== -->
<!-- Create jar file -->
<!-- ============================================================== -->
<target name="create-jar-local" depends="clean-jars-common,compile">
<mkdir dir="${assemble.jar}"/>
<!-- copy over the application configuration resource -->
<mkdir dir="${assemble.jar}/META-INF"/>
<copy todir="${assemble.jar}/META-INF"
file="${src.dir}/components/conf/faces-config.xml"/>
<copy todir="${assemble.jar}/META-INF"
file="${src.dir}/components/taglib/components.tld"/>
<copy todir="${assemble.jar}">
<fileset dir="${build.classes.dir}/" includes="**/*.class"
excludes="${demo.pkg}/**/*.class,JSFTest.class"/>
</copy>
<jar jarfile="${assemble.jar}/${jar}"
basedir="${assemble.jar}"/>
</target>
<!-- ============================================================== -->
<!-- Create war file -->
<!-- ============================================================== -->
<target name="mkdir_webinf">
<mkdir dir="${assemble.war}/WEB-INF"/>
</target>
<target name="clean-war-local" depends="init-common">
<delete dir="${assemble.war}" quiet="true" />
</target>
<target name="create-war-local"
depends="clean-war-local,mkdir_webinf,create-jar-local"
description="create war file." >
<!-- Copy over the properties -->
<copy todir="${assemble.war}/WEB-INF/classes/">
<fileset dir="${src.dir}" >
<include name="**/*.properties" />
</fileset>
</copy>
<!-- Copy the demo classes only. Components are jarred -->
<copy todir="${assemble.war}/WEB-INF/classes/">
<fileset dir="${build.classes.dir}/"
includes="${demo.pkg}/**/*.class"/>
</copy>
<!-- Copy the java source to the webapp for viewing by the user -->
<copy todir="${assemble.war}/src/java/components">
<fileset dir="${src.dir}/components" />
</copy>
<copy todir="${assemble.war}/src/java/demo">
<fileset dir="${src.dir}/demo" />
</copy>
<!-- Copy descriptor -->
<copy todir="${assemble.war}/WEB-INF">
<fileset dir="descriptor"/>
</copy>
<!-- Copy docroot -->
<copy todir="${assemble.war}">
<fileset dir="docroot"/>
</copy>
<!-- Copy the jsfcomponents.jar file to the assemble area -->
<copy todir="${assemble.war}/WEB-INF/lib"
file="${assemble.jar}/${jar}"/>
<!-- Create war file -->
<jar jarfile="${assemble.dir}/${war}"
basedir="${assemble.war}" />
</target>
<!-- ============================================================== -->
<!-- build -->
<!-- ============================================================== -->
<target name="build" depends="create-war-local">
</target>
<!-- ============================================================== -->
<!-- setup/unsetup (dummy) -->
<!-- ============================================================== -->
<target name="setup">
</target>
<target name="unsetup">
</target>
<!-- ============================================================== -->
<!-- deploy/undeploy -->
<!-- ============================================================== -->
<target name="deploy" depends="init-common">
<antcall target="deploy-war-common"/>
</target>
<target name="undeploy" depends="init-common">
<antcall target="undeploy-war-common"/>
</target>
<!-- ============================================================== -->
<!-- Run the test -->
<!-- ============================================================== -->
<target name="run" depends="compile,init-common">
<java classname="${test.class}" fork="yes" >
<arg value="${http.host}"/>
<arg value="${http.port}"/>
<arg value="${contextroot}"/>
<classpath>
<path refid="base.classpath" />
<pathelement location="${build.classes.dir}" />
<pathelement location="${classpath}" />
<pathelement location="${env.APS_HOME}/lib/reporter.jar" />
</classpath>
</java>
</target>
<!-- ============================================================== -->
<!-- Clean up -->
<!-- ============================================================== -->
<target name="clean">
<antcall target="clean-common"/>
<delete file="RepRunConf.txt" failonerror="false" />
</target>
</project>