<?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.
-->
<project name="SOAP/JMS Specification Greeter" default="build" basedir=".">
    <property environment="env"/>
    <condition property="activemq.home" value="${env.ACTIVEMQ_HOME}">
        <isset property="env.ACTIVEMQ_HOME"/>
    </condition>
    <fail message="this sample need to use activemq, please setup  ACTIVEMQ_HOME in your environment"
        unless="activemq.home"/>
    <condition property="activemq.version" value="${env.ACTIVEMQ_VERSION}">
	<isset property="env.ACTIVEMQ_VERSION"/>
    </condition>
    <fail message="this sample need to use activemq, please setup ACTIVEMQ_VERSION in your envrionment"
        unless="activemq.version"/>

    <property name="thirdparty.classpath" location="${activemq.home}/activemq-all-${activemq.version}.jar"/>

    <import file="../common_build.xml"/>

    <property name="wsdl.dir" location="${basedir}/wsdl"/>
    <property name="wsdl.file" value="jms_greeter.wsdl"/>
    
    <target name="jmsbroker.start" description="run jms broker" depends="build">
       <cxfrun classname="demo.jms_greeter.broker.EmbeddedBroker" /> 
    </target>

    <target name="client" description="run demo client" depends="build">
        <property name="param1" value=""/>
        <property name="param2" value=""/>
        <property name="param3" value=""/>
        <cxfrun classname="demo.jms_greeter.client.Client" param1="${basedir}/wsdl/jms_greeter.wsdl" param2="${op}" param3="${param1}" param4="${param2}" param5="${param3}"/>
    </target>
    
    
    <target name="server" description="run demo server" depends="build">
        <cxfrun classname="demo.jms_greeter.server.Server" param1="${basedir}/wsdl/jms_greeter.wsdl"/>
    </target>

    <target name="generate.code" unless="codegen.notrequired">
        <echo level="info"  message="Generating code using wsdl2java..."/>
        <wsdl2java file="${wsdl.file}"/>
        <touch file="${codegen.timestamp.file}"/>
    </target>        
</project>
