blob: 143297ac026be01167fa7f07a0671f53e28d15c7 [file] [log] [blame]
<?xml version="1.0"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<!-- ======================================================================
Feb 11, 2005 1:04:21 PM
This build file is intended to compile and run the Axis2 samples
provided here with the service being deployed at Tomcat or by
running a simple Axis2 server.
====================================================================== -->
<project name="samples" basedir="." default="compile">
<property name="src.dir" value="src"/>
<property name="build.dir" value="build"/>
<property name="lib.dir" value="${build.dir}/lib"/>
<property name="classes.dir" value="./classes"/>
<property name="jardrop.dir" value="${build.dir}/services"/>
<property environment="env"/>
<property name="AXIS2_HOME" value="../.."/>
<property name="axis.serverJarDrop.dir" value="${AXIS2_HOME}/WEB-INF/services"/>
<property name="conf.dir" value="conf"/>
<path id="classpath.library">
<fileset dir="${AXIS2_HOME}/WEB-INF/lib">
<include name="**/*.jar"/>
</fileset>
</path>
<path id="classpath.client">
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</path>
<path id="classpath.runtimelibraries">
<path refid="classpath.library"/>
<path refid="classpath.client"/>
</path>
<target name="clean" description="Delete all generated files">
<delete dir="${classes.dir}" failonerror="false"/>
<delete dir="${build.dir}" failonerror="false"/>
</target>
<target name="validateAxisHome">
<available file="${AXIS2_HOME}}" type="dir" property="axis2.deployed"/>
</target>
<target name="validateSevices.dir">
<available file="${AXIS2_HOME}/WEB-INF/services" type="dir" property="axis2.services"/>
</target>
<target name="validateDeploymentSettings" depends="validateAxisHome" unless="validateSevices.dir">
<mkdir dir="${AXIS2_HOME}/WEB-INF/services"/>
</target>
<target name="createDir">
<mkdir dir="${build.dir}"/>
<mkdir dir="${lib.dir}"/>
<mkdir dir="${classes.dir}"/>
<mkdir dir="${jardrop.dir}"/>
</target>
<target name="compile" depends="clean,createDir">
<javac srcdir="${src.dir}" destdir="${classes.dir}">
<classpath refid="classpath.library"/>
</javac>
<jar destfile="${lib.dir}/${ant.project.name}-all.jar">
<fileset dir="${classes.dir}"/>
</jar>
<copy file="${conf.dir}/services.xml" todir="${build.dir}/META-INF" overwrite="true"/>
<jar destfile="${jardrop.dir}/sample1.jar">
<fileset dir="${classes.dir}">
<include name="**/EchoXML.class"/>
</fileset>
<fileset dir="${build.dir}">
<include name="META-INF/services.xml"/>
</fileset>
</jar>
<copy file="${conf.dir}/service4withhandler.xml" tofile="${build.dir}/META-INF/services.xml" overwrite="true"/>
<jar destfile="${jardrop.dir}/sample1WithHandler.jar">
<fileset dir="${classes.dir}">
<include name="**/EchoXML.class"/>
<include name="**/LoggingHandler.class"/>
</fileset>
<fileset dir="${build.dir}">
<include name="META-INF/services.xml"/>
</fileset>
</jar>
<delete dir="${classes.dir}" failonerror="false"/>
</target>
<target name="deploy" depends="compile,validateDeploymentSettings">
<copy file="${jardrop.dir}/sample1.jar" todir="${axis.serverJarDrop.dir}" overwrite="true"/>
<copy file="${jardrop.dir}/sample1WithHandler.jar" todir="${axis.serverJarDrop.dir}" overwrite="true"/>
</target>
<target name="echo" depends="compile">
<java classname="userguide.sample1.SynchronousClient">
<classpath refid="classpath.runtimelibraries"/>
<arg value="8080"/>
<arg value="/axis2/services/sample1"/>
</java>
</target>
<target name="echoWithHandler" depends="compile">
<java classname="userguide.sample1.SynchronousClient">
<classpath refid="classpath.runtimelibraries"/>
<arg value="8080"/>
<arg value="/axis2/services/sample1WithHandler"/>
</java>
</target>
<target name="echoAsync" depends="compile">
<java classname="userguide.sample1.AsynchronousClient">
<classpath refid="classpath.runtimelibraries"/>
<arg value="8080"/>
<arg value="/axis2/services/sample1"/>
</java>
</target>
</project>