Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

*) adding new ant target to allow generation of client stub classes for yacy soap api

thelida2ac6fa239e
diff --git a/build.xml b/build.xml
index 831064f26..7cb8fcac7 100644
--- a/build.xml
+++ b/build.xml
@@ -298,6 +298,20 @@
<fileset dir="${src}/" includes="de/anomic/soap/build.xml"/>
</subant>
</target>
+
+<target name="distSoapClientStubJar" depends="init" description="Generates a jar file with all client stub classes for the YaCy SOAP API">
+ <subant target="buildClientStubJar">
+ <property name="src" location="${src}"/>
+ <property name="build" location="${build}"/>
+ <property name="libx" location="${libx}"/>
+ <property name="htroot" value="${htroot}"/>
+ <property name="release" location="${release_ext}"/>
+ <property name="releaseDir" value="${releaseDir}"/>
+ <property name="javacSource" value="${javacSource}"/>
+ <property name="javacTarget" value="${javacTarget}"/>
+ <fileset dir="${src}/" includes="de/anomic/soap/build.xml"/>
+ </subant>
+</target>
<target name="compilePortForwarding" depends="compileMain" description="Compiling and zipping additional port forwarder">
<javac srcdir="${src}/de/anomic/server/portForwarding" destdir="${build}" source="${javacSource}" target="${javacTarget}" debug="true" debuglevel="lines,vars,source">
diff --git a/source/de/anomic/soap/build.xml b/source/de/anomic/soap/build.xml
index 108f6d846..aaf68b8a9 100644
--- a/source/de/anomic/soap/build.xml
+++ b/source/de/anomic/soap/build.xml
@@ -6,24 +6,36 @@
<property name="addonShortName" value="Soap"/>
<property name="addonVersion" value="0.1"/>
-
<property name="addonLongName" value="${addonShortName}Addon"/>
- <property name="addonArchive" location="${release}/${addonLongName}_${addonVersion}.tgz"/>
+ <property name="addonArchive" location="${release}/${addonLongName}_${addonVersion}.tgz"/>
+
+ <property name="clientStub" location="${release}/SOAP_CLIENT" />
+ <property name="clientStubSrc" location="${clientStub}/source" />
+ <property name="clientStubBuild" location="${clientStub}/classes" />
- <target name="compile">
- <javac srcdir="${src}/de/anomic/soap/" destdir="${build}" source="${javacSource}" target="${javacTarget}" debug="true" debuglevel="lines,vars,source">
- <classpath>
- <pathelement location="${build}" />
-
+ <!-- defining the classpath that should be used for compiling -->
+ <path id="soap.class.path">
+ <pathelement location="${build}" />
+
<!-- all needed libs -->
- <pathelement location="${libx}/axis.jar" />
- <pathelement location="${libx}/axis-ant.jar" />
- <pathelement location="${libx}/commons-discovery.jar" />
- <pathelement location="${libx}/commons-logging.jar" />
- <pathelement location="${libx}/jaxrpc.jar" />
- <pathelement location="${libx}/saaj.jar" />
- <pathelement location="${libx}/wsdl4j.jar" />
- </classpath>
+ <pathelement location="${libx}/axis.jar" />
+ <pathelement location="${libx}/axis-ant.jar" />
+ <pathelement location="${libx}/commons-discovery.jar" />
+ <pathelement location="${libx}/commons-logging.jar" />
+ <pathelement location="${libx}/jaxrpc.jar" />
+ <pathelement location="${libx}/saaj.jar" />
+ <pathelement location="${libx}/wsdl4j.jar" />
+ </path>
+
+
+ <target name="compile">
+ <javac srcdir="${src}/de/anomic/soap/"
+ destdir="${build}"
+ source="${javacSource}"
+ target="${javacTarget}"
+ debug="true"
+ debuglevel="lines,vars,source"
+ classpathref="soap.class.path">
</javac>
</target>
@@ -58,6 +70,60 @@
<target name="dist" depends="compile,zip" description="Compile and zip the addon"/>
+ <target name="genClientStubFiles">
+ <!-- ensure that the temp directory exists -->
+ <mkdir dir="${clientStubSrc}"/>
+
+ <!-- define the foreach task -->
+ <taskdef name="foreach" classname="org.apache.axis.tools.ant.foreach.ForeachTask" classpathref="soap.class.path"/>
+
+ <!-- loop through the wsdl files -->
+ <foreach target="genClientStubFileFromWSDL">
+ <param name="wsdlFileName">
+ <fileset dir="${src}/de/anomic/soap/services/" includes="*.wsdl"/>
+ </param>
+ </foreach>
+ </target>
+
+ <!-- generates client stub classes for a soap service -->
+ <target name="genClientStubFileFromWSDL" description="Generate YaCy SOAP client stub java files from wsdl">
+ <!-- define the wasdl2java task -->
+ <taskdef name="axis-wsdl2java" classname="org.apache.axis.tools.ant.wsdl.Wsdl2javaAntTask" classpathref="soap.class.path"/>
+
+ <axis-wsdl2java
+ output="${clientStubSrc}"
+ url="file:///${wsdlFileName}" >
+ <mapping
+ namespace="http://axis.apache.org/ns/interop"
+ package="interop" />
+ </axis-wsdl2java>
+ </target>
+
+ <target name="compileClientStubClasses" depends="genClientStubFiles" description="Compile YaCy SOAP client stube classes">
+ <mkdir dir="${clientStubBuild}"/>
+ <javac srcdir="${clientStubSrc}"
+ destdir="${clientStubBuild}"
+ source="${javacSource}"
+ target="${javacTarget}"
+ debug="true"
+ debuglevel="lines,vars,source"
+ classpathref="soap.class.path">
+ </javac>
+ </target>
+ <target name="buildClientStubJar" depends="compileClientStubClasses">
+ <!-- delete old jar file -->
+ <delete file="${}/yacySoapClient.jar" />
+
+ <!-- copy all source and class files into the jar -->
+ <jar destfile="${clientStub}/yacySoapClient.jar" basedir="${clientStub}/">
+ <fileset dir="${clientStubSrc}"/>
+ <fileset dir="${clientStubBuild}"/>
+ </jar>
+
+ <!-- remove old temp directories -->
+ <delete dir="${clientStubSrc}"/>
+ <delete dir="${clientStubBuild}"/>
+ </target>
</project>