<!--
  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="jbi-demo-service-engine" default="build">

  <property name="build.dir" location="./build"/>
  <property name="build.classes.dir" location="${build.dir}/classes"/>
  <property name="build.lib.dir" location="${build.dir}/lib"/>
  <property name="src.dir" location="./src"/>

  <property environment="env"/> 
  <target name="build" depends="build-service-engine"/>
  <condition property="integration.jar.dir" value="${env.CXF_HOME}/modules/integration" else="${env.CXF_HOME}/lib">
      <available file="${env.CXF_HOME}/modules/integration" type="dir"/>
  </condition>
  <echo message="the integration jar is in ${integration.jar.dir}"/>
  <target name="build-service-engine">
    <mkdir dir="${build.lib.dir}"/>

    <jar destfile="${build.lib.dir}/cxf-service-engine.jar" duplicate="preserve">
      <fileset dir="${env.CXF_HOME}/lib">
        <include name="cxf-manifest.jar"/>
        <include name="cxf*.jar"/>
        <include name="FastInfoset-*.jar"/>
        <include name="jaxb*.jar"/>
        <include name="neethi-*.jar"/>
        <include name="geronimo-jaxws_2.1_spec-1.0.jar"/>
        <include name="geronimo-annotation_1.0_spec-*.jar"/>
        <include name="geronimo-ws-metadata_2.0_spec-*.jar"/>
        <include name="org.apache.servicemix.specs.jbi-api-*.jar"/>
        <include name="xml-resolver-*.jar"/>
        <include name="saaj*.jar"/>
        <include name="XmlSchema-*.jar"/>
        <include name="wstx-asl-*.jar"/>
      </fileset>
      <fileset dir="${integration.jar.dir}">
        <include name="cxf*.jar"/>
      </fileset>
      <metainf dir="./etc">
	<include name="jbi.xml"/>
	<include name="cxf-config.xml"/>
      </metainf>
    </jar>
  </target>

  <target name="clean">
    <delete dir="${build.dir}"/>
  </target>

</project>


