<?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.
-->
<project name="JAX-RS Spring Security demo" default="build" basedir=".">
    <property name="codegen.notrequired" value="true"/>

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

    <property name="spring.dist" location="${spring.home}/dist/modules"/> 
    <property name="aspectj.lib" location="${aspectj.home}/lib"/>
    <property name="spring.security.version" value="2.0.4"/>
    <property name="spring.security.dist" location="${spring.security.home}/dist"/>

    <path id="spring.extra.classpath">
        <pathelement location="${spring.dist}/spring-aop.jar"/> 
    </path>

    <path id="spring.security.classpath">
        <pathelement location="${spring.security.dist}/spring-security-core-${spring.security.version}.jar"/>
        <pathelement location="${spring.security.dist}/spring-security-core-tiger-${spring.security.version}.jar"/>
    </path>

    <path id="aspectj.classpath">
        <pathelement location="${aspectj.lib}/aspectjrt.jar"/>
        <pathelement location="${aspectj.lib}/aspectjweaver.jar"/>
    </path>
        
    <target name="client" description="run demo client" depends="build">
        <cxfrun classname="demo.jaxrs.client.Client"/>
    </target> 
        
    <target name="server" description="run demo server" depends="build">
         <java classname="demo.jaxrs.servlet.Server" fork="yes">
                <classpath>
                    <path refid="cxf.classpath"/>
                    <path refid="spring.extra.classpath"/>
                    <path refid="spring.security.classpath"/>
                    <path refid="aspectj.classpath"/>
                    <path refid="jdk.tools.classpath"/>
                </classpath>
                <jvmarg value="-Dcxf.home=${cxf.home}"/> 
         </java> 
    </target>

    <target name="compile" depends="maybe.generate.code">
        <mkdir dir="${build.classes.dir}"/>
        <mkdir dir="${build.src.dir}"/>

        <javac destdir="${build.classes.dir}" debug="true">
            <src path="${build.src.dir}"/>
            <src path="${basedir}/src"/>
            <classpath>
                <path refid="cxf.classpath"/>
                <path refid="spring.security.classpath"/>
            </classpath>
        </javac>

        <copy todir="${build.classes.dir}">
            <fileset dir="${basedir}/src" includes="**/*.xml" />
        </copy>
    </target> 

</project>
