vitro/services/build.xml

107 lines
4.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<project name="vitroWebServices" basedir="../">
<property file="./config/globalbuild.properties"/>
<property name="axis.port" value="8080"/>
<property name="axis.server" value="localhost"/>
<property name="ws.dir" value="./services/"/>
<property name="ws.lib" value="${ws.dir}/lib"/>
<!-- notice this builds to the ${webapp.build} directory -->
<property name="ws.build" value="${webapp.build}"/>
<property name="compile.debug" value="true"/>
<property name="compile.deprecation" value="true" />
<property name="compile.optimize" value="true" />
<path id="axis.classpath">
<!-- need to include the classes directory so that axis can
find the necessary compiled classes -->
<pathelement path="${ws.build}/WEB-INF/classes"/>
<fileset dir="${ws.lib}">
<include name="**/*.jar" />
</fileset>
</path>
<!-- ==================== Compilation Classpath =========================== -->
<path id="webservices-compile.classpath">
<pathelement location="${core.build.jar}"/>
<fileset dir="${ws.lib}">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${webapp.lib}">
<include name="**/*.jar"/>
</fileset>
</path>
<!-- ================== set up the ant axis tasks ================ -->
<taskdef resource="axis-tasks.properties" classpathref="axis.classpath" />
<!-- ==================== Compile task ==================== -->
<target name="compile"
description="compiles code for webservices into webapp build dir" >
<depend srcdir="${ws.dir}/src" destdir="${ws.build}/WEB-INF/classes" cache=".depcache"/>
<ant antfile="${webapp.dir}/build.xml" target="compile"/>
<echo>Compile webservices</echo>
<javac srcdir="${ws.dir}/src" destdir="${ws.build}/WEB-INF/classes"
debug="${compile.debug}" deprecation="${compile.deprecation}"
optimize="${compile.optimize}" source="1.5">
<classpath refid="webservices-compile.classpath"/>
<!--<compilerarg value="-Xlint:unchecked"/> -->
</javac>
<antcall target="copyFiles"/>
</target>
<!-- ==================== copyFiles task ==================== -->
<target name="copyFiles" description="add files to the webapp build">
<copy todir="${ws.build}/WEB-INF/lib">
<fileset dir="${ws.lib}">
<exclude name="*.LCK"/>
<exclude name=".svn"/>
</fileset>
</copy>
<copy todir="${ws.build}">
<fileset dir="${ws.dir}/additions" >
<exclude name="*.LCK"/>
<exclude name="**/.svn"/>
<exclude name=".svn"/>
<exclude name="log4j.properties"/>
<exclude name="README.txt"/>
</fileset>
</copy>
</target>
<!-- ==================== setupWs task ==================== -->
<target name="setupWs"
description="invoke axis admin to deploy and expose VitroWs">
<!-- Notice that this can be run from the command line too:
$ java org.apache.axis.client.AdminClient \
-lhttp://localhost:8080/vivo/services/AdminService deploy.wsdd -->
<axis-admin
port="${axis.port}"
hostname="${axis.server}"
failonerror="true"
servletpath="${webapp.name}/services/AdminService"
debug="true"
xmlfile="${ws.wsdd.dir}/VitroWs3.wsdd" />
</target>
<!-- ==================== java2wsdl task ==================== -->
<target name="java2wsdl" description="turn java classes into wsdl">
<axis-java2wsdl
classname="edu.cornell.mannlib.vitro.webapp.dao.VitroFacade"
location="http://localhost:8080/"
methods="entityById"
namespace="info:edu.cornell.mannlib.vitro"
output="./xml/wsdl/output.txt" >
<mapping namespace="info:db" package="edu.cornell.mannlib.vitro.db"/>
<mapping namespace="info:dao" package="edu.cornell.mannlib.vitro.db.dao"/>
</axis-java2wsdl>
</target>
</project>