<?xml version="1.0"?>
<!DOCTYPE project [
<!--
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
The contents of this file are subject to the terms of either the GNU
General Public License Version 2 only ("GPL") or the Common Development
and Distribution License("CDDL") (collectively, the "License"). You
may not use this file except in compliance with the License. You can
obtain a copy of the License at
https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
or packager/legal/LICENSE.txt. See the License for the specific
language governing permissions and limitations under the License.
When distributing the software, include this License Header Notice in each
file and include the License file at packager/legal/LICENSE.txt.
GPL Classpath Exception:
Oracle designates this particular file as subject to the "Classpath"
exception as provided by Oracle in the GPL Version 2 section of the License
file that accompanied this code.
Modifications:
If applicable, add the following below the License Header, with the fields
enclosed by brackets [] replaced by your own identifying information:
"Portions Copyright [year] [name of copyright owner]"
Contributor(s):
If you wish your version of this file to be governed by only the CDDL or
only the GPL Version 2, indicate your decision by adding "[Contributor]
elects to include this software in this distribution under the [CDDL or GPL
Version 2] license." If you don't indicate a single choice of license, a
recipient has the option to distribute your version of this file under
either the CDDL, the GPL Version 2 or to extend the choice of license to
its licensees as provided above. However, if you add GPL Version 2 code
and therefore, elected the GPL Version 2 license, then the option applies
only if the new code is made subject to such option by the copyright
holder.
-->
<!ENTITY commonBuild SYSTEM "/config/common.xml">
<!ENTITY jaxwsTools SYSTEM "/config/jaxwstools.xml">
<!ENTITY jbiproperties SYSTEM "/config/common.properties">
<!ENTITY testproperties SYSTEM "/build.properties">
]>
<project name="web-client" default="all" basedir=".">
&commonBuild;
&testproperties;
&jaxwsTools;
&jbiproperties;
<target name="all" depends="clean, setup, runtest, undeploy"/>
<target name="clean">
<antcall target="clean-common"/>
<delete file="${jbi-component-su-dir}/assembly/${appname}.war"/>
<delete file="${basedir}/RepRunConf.txt"/>
<delete dir="${basedir}/common:endpoint"/>
</target>
<target name="setup" depends="assemble-web, deploy-jbi-component,assemble-client,deploy-client"/>
<target name="compile">
<antcall target="compile-common">
<param name="src" value="common:endpoint"/>
</antcall>
</target>
<target name="assemble-web" depends="compile">
<echo message="classes dir = ${build.classes.dir}"/>
<echo message="assemble.dir = ${assemble.dir}/${appname}.war"/>
<antcall target="pkg-war">
<param name="war.classes" value="${build.classes.dir}"/>
<param name="war.file" value="${assemble.dir}/${appname}.war"/>
</antcall>
<!-- Add META-INF/jbi.xml to .war file -->
<mkdir dir="${build.classes.dir}/tmp/META-INF"/>
<echo message="created dir = ${build.classes.dir}/tmp/META-INF"/>
<copy file="${jbi-component-su-dir}/su/META-INF/jbi.xml" tofile="${build.classes.dir}/tmp/META-INF/jbi.xml"/>
<jar jarfile="${assemble.dir}/${appname}.war" update="true">
<fileset dir="${build.classes.dir}/tmp">
<include name="META-INF/jbi.xml"/>
</fileset>
</jar>
<!-- Add the WSDL -->
<mkdir dir="${build.classes.dir}/tmp/WEB-INF/wsdl"/>
<copy file="${basedir}/wsdl/CalculatorService_schema1.xsd" todir="${build.classes.dir}/tmp/WEB-INF/wsdl"/>
<copy file="${basedir}/wsdl/CalculatorService.wsdl" todir="${build.classes.dir}/tmp/WEB-INF/wsdl"/>
<jar jarfile="${assemble.dir}/${appname}.war" update="true">
<fileset dir="${build.classes.dir}/tmp">
<include name="WEB-INF/wsdl/CalculatorService_schema1.xsd"/>
<include name="WEB-INF/wsdl/CalculatorService.wsdl"/>
</fileset>
</jar>
<!-- Copy the JavaEE app to the service assembly -->
<copy file="${assemble.dir}/${appname}.war" todir="${jbi-component-su-dir}/assembly"/>
</target>
<target name="deploy-jbi-component">
<antcall target="deploy-jbi-component-su">
<param name="jbi-su-dir" value="${jbi-component-su-dir}"/>
<param name="jbi-su-assembly" value="${jbi-component-su-assembly}"/>
</antcall>
</target>
<target name="assemble-client" >
<mkdir dir="${build.classes.dir}/webclient/WEB-INF/classes"/>
<mkdir dir="${assemble.dir}"/>
<echo message="wsimport -keep -d ${build.classes.dir}/webclient/WEB-INF/classes http://localhost:8080/rpc-literal-bundled-wsdl/webservice/CalculatorService?WSDL" />
<antcall target="wsimport">
<param name="wsimport.args"
value="-keep -d ${build.classes.dir}/webclient/WEB-INF/classes http://localhost:8080/rpc-literal-bundled-wsdl/webservice/CalculatorService?WSDL"/>
</antcall>
<javac srcdir="." destdir="${build.classes.dir}/webclient/WEB-INF/classes"
classpath="${env.S1AS_HOME}/modules/javax.servlet.jar"
includes="common/**,webclient/**"/>
<copy file="/client-web.xml" tofile="${build.classes.dir}/webclient/WEB-INF/web.xml"/>
<copy file="/client-sun-web.xml" tofile="${build.classes.dir}/webclient/WEB-INF/sun-web.xml"/>
<copy file="/client-jbi.xml" tofile="${build.classes.dir}/webclient/META-INF/jbi.xml"/>
<jar destfile="${assemble.dir}/wsclient.war" basedir="${build.classes.dir}/webclient" includes="**"/>
</target>
<target name="deploy-client">
<mkdir dir="/temp"/>
<copy file="${assemble.dir}/wsclient.war" todir="/temp"/>
<antcall target="deploy-jbi-component-su">
<param name="jbi-su-dir" value="${jbi-client-su-dir}"/>
<param name="jbi-su-assembly" value="${jbi-client-su-assembly}"/>
</antcall>
</target>
<target name="undeploy" >
<antcall target="undeploy-jbi-component"/>
<antcall target="undeploy-jbi-client"/>
</target>
<target name="undeploy-jbi-component">
<antcall target="undeploy-jbi-component-su">
<param name="jbi-su-assembly" value="${jbi-component-su-assembly}"/>
</antcall>
</target>
<target name="undeploy-jbi-client">
<antcall target="undeploy-jbi-component-su">
<param name="jbi-su-assembly" value="${jbi-client-su-assembly}"/>
</antcall>
</target>
<target name="runtest" >
<mkdir dir="${build.classes.dir}/client"/>
<javac srcdir="." destdir="${build.classes.dir}/client"
classpath="${env.APS_HOME}/jbi/lib/reporter.jar"
includes="common/**,client/**"/>
<unjar src="${env.APS_HOME}/jbi/lib/reporter.jar" dest="${build.classes.dir}/client"/>
<java classname="client.TestClient">
<classpath>
<pathelement path="${build.classes.dir}/client"/>
</classpath>
<arg value="http://${http.host}:${http.port}/wsclient/webclient/RequestProcessor"/>
</java>
</target>
</project>