blob: e91daa8be4bb73f8ee6f8e0bbc70dc90957d5153 [file] [log] [blame]
<!--
Copyright (c) 2002, 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
-->
<!DOCTYPE project [
<!ENTITY targets SYSTEM "../../common/targets.xml">
]>
<project name="SAAJ Tutorial, Coffee Break" default="build" basedir=".">
<target name="init">
<tstamp/>
</target>
<property file="../../common/build.properties"/>
<property file="build.properties"/>
&targets;
<path id="run.classpath">
<fileset dir="${j2ee.home}/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${j2ee.home}/lib/endorsed">
<include name="*.jar"/>
</fileset>
</path>
<target name="prepare"
description="Creates the build and dist directories" >
<echo message="Creating the required directories...." />
<mkdir dir="${build}/client" />
<mkdir dir="${build}/server" />
<mkdir dir="dist" />
</target>
<target name="compile-server" depends="prepare"
description="Compiles the server-side source code">
<echo message="Compiling the server-side source code...."/>
<javac
srcdir="${src}"
destdir="${build}/server"
includes="**/PriceListServlet.java, **/ConfirmationServlet.java">
<classpath refid="classpath" />
<classpath path="${common}" />
</javac>
</target>
<target name="compile-client"
description="Compiles the client source code" >
<echo message="Compiling the client source code...."/>
<javac
srcdir="${src}"
destdir="${build}/client"
includes="**/OrderRequest.java, **/PriceListRequest.java, **/Test*.java">
<classpath refid="classpath" />
<classpath path="${common}" />
</javac>
<javac
srcdir="../common/src"
destdir="${build}/client"
includes="**/URLHelper.java"
>
<classpath refid="classpath" />
<classpath path="${common}" />
</javac>
<copy file="../common/src/com/sun/cb/CoffeeBreak.properties"
todir="${build}/client/com/sun/cb" />
</target>
<target name="package-client" depends="compile-client"
description="Builds the JAR file that contains the SAAJ client routines">
<echo message="Building the ${client-jar} file...."/>
<delete file="dist/${client-jar}" />
<jar jarfile="dist/${client-jar}" >
<fileset dir="${build}/client" >
<exclude name="**/*Test*" />
</fileset>
</jar>
</target>
<target name="run-test-order">
<antcall target="run-test-client">
<param name="client-class" value="com.sun.cb.TestOrderRequest"/>
</antcall>
</target>
<target name="run-test-price">
<antcall target="run-test-client">
<param name="client-class" value="com.sun.cb.TestPriceListRequest"/>
</antcall>
</target>
<target name="run-test-client"
description="Runs a test client">
<echo message="Running the ${client-class} program:" />
<echo message=" " />
<java
fork="on"
classname="${client-class}">
<classpath refid="run.classpath" />
<classpath path="${build}/client" />
</java>
</target>
<target name="build" depends="compile-server, package-client"
description="Executes the targets needed to build this example.">
</target>
</project>