<?xml version="1.0" encoding="UTF-8"?>

<!--
 * 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.
 *
-->

<!-- java-client-ant.xml: contains targets for projects that produce 
     java client module. This file is not meant to be included 
     in a project directly.
     This file should only be included if this project is defining 
     is.java-client.module property.
     @Author Sreenivas Munnangi  -->

<project name="java-client-ant" default="dummy-default">

  <property name="app.module" value="${build.dir}/${module.name}-java-client.jar"/>
  <property name="java-client.build.dir" value="${build.dir}/java-client"/>

  <target name="-pre-clean">
  </target>

  <target name="package" depends="-post-compile"
    description="packages the archive">
    <mkdir dir="${java-client.build.dir}"/>

    <!-- copy in the compiled classes -->
    <copy todir="${java-client.build.dir}">
      <fileset dir="${build.classes.dir}"/>
    </copy>

    <delete file="${app.module}"/>
    <jar jarfile="${app.module}" basedir="${java-client.build.dir}"/>
    <delete dir="${java-client.build.dir}"/>
  </target>

  <target name="runjavaclient"
    description="run stand-alone java client">
    <java  fork="on"
        failonerror="true"
        classname="${runjavaclient.class.name}">
        <classpath refid="classpath"/>
    </java>
  </target>


  <target name="dummy-default"/>

</project>
