[MOBY-guts] biomoby commit
Paul Gordon
gordonp at dev.open-bio.org
Mon Dec 11 18:36:07 UTC 2006
gordonp
Mon Dec 11 13:36:07 EST 2006
Update of /home/repository/moby/moby-live/Java/xmls/servlet
In directory dev.open-bio.org:/tmp/cvs-serv32687
Modified Files:
build.xml mobyService.properties
Log Message:
Simplified Ant spec. even further
moby-live/Java/xmls/servlet build.xml,1.2,1.3 mobyService.properties,1.3,1.4
===================================================================
RCS file: /home/repository/moby/moby-live/Java/xmls/servlet/build.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Java/xmls/servlet/build.xml 2006/12/06 17:55:29 1.2
+++ /home/repository/moby/moby-live/Java/xmls/servlet/build.xml 2006/12/11 18:36:07 1.3
@@ -1,6 +1,7 @@
<?xml version="1.0"?>
<project default="compile" basedir=".">
+ <property name="project.dir" value="${basedir}"/>
<property name="property.file" value="mobyService.properties"/>
<description>
This is an Ant build file for creating and registering a Moby Service.
@@ -17,13 +18,60 @@
</description>
<property name="description" value="[ MobyService ]"/>
-
- <property file="${property.file}"/>
-
- <property name="build.dir" value="${project.dir}/build"/>
- <property name="build.classes.dir" value="${build.dir}/classes"/>
+
+ <property name="build.dir" value="${project.dir}${file.separator}build"/>
+ <property name="build.classes.dir" value="${build.dir}${file.separator}classes"/>
+
+
+ <condition property="windows">
+ <os family="windows" />
+ </condition>
+ <condition property="unix">
+ <os family="unix" />
+ </condition>
+ <condition property="solaris">
+ <os name="SunOS"/>
+ </condition>
+ <condition property="linux">
+ <os name="Linux"/>
+ </condition>
+ <condition property="mac">
+ <os name="Mac OS X"/>
+ </condition>
+
+
+ <condition property="build.property.file"
+ value="windowsOS.properties">
+ <isset property="windows"/>
+ </condition>
+ <condition property="build.property.file"
+ value="sunOS.properties">
+ <isset property="solaris"/>
+ </condition>
+
+ <condition property="file.separator.to.use"
+ value="${file.separator}${file.separator}">
+ <isset property="windows"/>
+ </condition>
+ <condition property="file.separator.to.use"
+ value="${file.separator}">
+ <isset property="solaris"/>
+ </condition>
+
+
+
+ <delete file="${build.dir}${file.separator}${build.property.file}" failonerror="false"/>
+ <copy file="${property.file}" tofile="${build.dir}${file.separator}${build.property.file}" failonerror="false"/>
+
+ <replace file="${build.dir}${file.separator}${build.property.file}" token="//" value="@@@" summary="yes"/>
+ <replace file="${build.dir}${file.separator}${build.property.file}" token="\" value="${file.separator.to.use}" summary="yes"/>
+ <replace file="${build.dir}${file.separator}${build.property.file}" token="@@@" value="//" summary="yes"/>
+
+ <!-- <property file="${build.dir}${file.separator}${property.file}"/>-->
+ <property file="${build.dir}${file.separator}${build.property.file}"/>
- <property name="moby.servlet.war.file" value="${lib.dir}/MobyServlet.war"/>
+
+ <property name="moby.servlet.war.file" value="${lib.dir}${file.separator}MobyServlet.war"/>
<!--<property name="remote.dir" value="http://biomoby.org/jmoby-jars/jars-archive"/> -->
<property name="remote.dir" value="http://www.visualgenomics.ca/gordonp"/>
@@ -33,10 +81,10 @@
<!--pathelement path="${java.class.path}"/-->
<fileset dir="${lib.dir}">
- <include name="**/*.war"/>
+ <include name="**${file.separator}*.war"/>
</fileset>
<fileset dir="${lib.dir}">
- <include name="**/*.jar"/>
+ <include name="**${file.separator}*.jar"/>
</fileset>
</path>
@@ -49,7 +97,7 @@
<mapper>
<chainedmapper>
<flattenmapper/>
- <globmapper from="*.jar" to="${lib.dir}/*.jar"/>
+ <globmapper from="*.jar" to="${lib.dir}${file.separator}*.jar"/>
</chainedmapper>
</mapper>
</pathconvert>
@@ -58,41 +106,42 @@
<path path="${my.servlet.war.file}"/>
<chainedmapper>
<flattenmapper/>
- <packagemapper from="*.war" to="*"/>
+ <packagemapper from="*.war" to="*"/>
</chainedmapper>
</pathconvert>
<pathconvert property="moby.servlet.war.file.name" >
- <path path="${moby.servlet.war.file}"/>
- <chainedmapper>
- <flattenmapper/>
- </chainedmapper>
+ <path path="${moby.servlet.war.file}"/>
+ <chainedmapper>
+ <flattenmapper/>
+ </chainedmapper>
</pathconvert>
<pathconvert property="tmp.file.name" >
- <path path="${main.class.file}"/>
- <chainedmapper>
- <flattenmapper/>
- </chainedmapper>
+ <path path="${main.class.file}"/>
+ <chainedmapper>
+ <flattenmapper/>
+ </chainedmapper>
</pathconvert>
<pathconvert property="main.class.package" >
- <path path="${src.dir}/${main.class.file}"/>
- <packagemapper from="${src.dir}/*/${tmp.file.name}" to="*"/>
+ <path path="${project.dir}${file.separator}${src.dir}${file.separator}${main.class.file}"/>
+ <packagemapper from="${project.dir}${file.separator}${src.dir}${file.separator}*${file.separator}${tmp.file.name}" to="*"/>
</pathconvert>
+
<pathconvert property="main.class.dir" >
- <path path="${src.dir}/${main.class.file}"/>
- <globmapper from="${src.dir}/*/${tmp.file.name}" to="*"/>
+ <path path="${project.dir}${file.separator}${src.dir}${file.separator}${main.class.file}"/>
+ <globmapper from="${project.dir}${file.separator}${src.dir}${file.separator}*${file.separator}${tmp.file.name}" to="*"/>
</pathconvert>
<pathconvert property="main.class" >
- <path path="${tmp.file.name}"/>
-<chainedmapper>
- <flattenmapper/>
- <packagemapper from="*.java" to="*"/>
+ <path path="${tmp.file.name}"/>
+ <chainedmapper>
+ <flattenmapper/>
+ <packagemapper from="*.java" to="*"/>
</chainedmapper>
</pathconvert>
@@ -102,16 +151,16 @@
<mkdir dir="${build.classes.dir}"/>
- <copy file="${src.dir}/log4j.properties" todir="${build.classes.dir}" failonerror="false"/>
+ <copy file="${src.dir}${file.separator}log4j.properties" todir="${build.classes.dir}" failonerror="false"/>
- <get src="${remote.dir}/${moby.servlet.war.file.name}" dest="${lib.dir}/${moby.servlet.war.file.name}" usetimestamp="true"/>
+ <get src="${remote.dir}/${moby.servlet.war.file.name}" dest="${lib.dir}${file.separator}${moby.servlet.war.file.name}" usetimestamp="true"/>
</target>
<target name="compile" depends="init" description="(User) Compiles your new Moby service code.">
- <echo message="${description} -- compile --> ${main.class.dir}/${main.class} "/>
+ <echo message="${description} -- compile --> ${main.class.dir}${file.separator}${main.class} "/>
<javac srcdir="${src.dir}" destdir="${build.classes.dir}"
- includes="${main.class.dir}/${main.class}.java"
+ includes="${main.class.dir}${file.separator}${main.class}.java"
debug="on" debuglevel="lines, vars, and source"
deprecation="${deprecation}"
classpathref="classpath">
@@ -132,85 +181,87 @@
<target name="war" depends="compile, updateWebXML" description="(User) Wraps up your new code in a deployable WAR archive.">
<echo message="${description} -- making WAR file --> ${my.servlet.war.file}"/>
- <delete file="${build.dir}/${my.servlet.war.file}"/>
+ <delete file="${build.dir}${file.separator}${my.servlet.war.file}"/>
- <mkdir dir="${build.dir}/WEB-INF"/>
+ <mkdir dir="${build.dir}${file.separator}WEB-INF"/>
- <copy todir="${build.dir}/WEB-INF/lib">
+ <copy todir="${build.dir}${file.separator}WEB-INF${file.separator}lib">
<fileset dir="${lib.dir}">
<exclude name="${moby.servlet.war.file.name}"/>
</fileset>
</copy>
- <copy todir="${build.dir}/WEB-INF/classes">
+ <copy todir="${build.dir}${file.separator}WEB-INF${file.separator}classes">
<fileset dir="${build.classes.dir}"/>
</copy>
- <copy file="${moby.servlet.war.file}" tofile="${build.dir}/${my.servlet.war.file}"/>
+ <copy file="${moby.servlet.war.file}" tofile="${build.dir}${file.separator}${my.servlet.war.file}"/>
- <jar basedir="${build.dir}" destfile="${build.dir}/${my.servlet.war.file}" update="true" manifest="${build.dir}/META-INF/MANIFEST.MF" includes="WEB-INF/**">
+ <jar basedir="${build.dir}" destfile="${build.dir}${file.separator}${my.servlet.war.file}"
+ update="true" manifest="${build.dir}${file.separator}META-INF${file.separator}MANIFEST.MF" includes="WEB-INF${file.separator}**">
</jar>
- <jar basedir="${build.classes.dir}" destfile="${build.dir}/${my.servlet.war.file}" update="true" manifest="${build.dir}/META-INF/MANIFEST.MF" includes="**"/>
+ <jar basedir="${build.classes.dir}" destfile="${build.dir}${file.separator}${my.servlet.war.file}"
+ update="true" manifest="${build.dir}${file.separator}META-INF${file.separator}MANIFEST.MF" includes="**"/>
- <echo message="Your WAR archive (${build.dir}/${my.servlet.war.file}) is now ready for deployment (e.g. onto an Apache Tomcat server)."/>
+ <echo message="Your WAR archive (${build.dir}${file.separator}${my.servlet.war.file}) is now ready for deployment (e.g. onto an Apache Tomcat server)."/>
</target>
<target name="testService" description="(User) Test the service (requires that the WAR file be deployed already)." >
- <echo message="${description} -- testing service (did you remember to deploy the WAR?) --> ${servlet.host.url}:${servlet.port}/${my.servlet.war.file.name}"/>
-<java jar="${build.dir}/${my.servlet.war.file}"
+ <echo message="${description} -- testing service (did you remember to deploy the WAR?) --> ${servlet.host.url}/${my.servlet.war.file.name}"/>
+<java jar="${build.dir}${file.separator}${my.servlet.war.file}"
fork="true"
classpathref="classpath" >
- <arg value="${servlet.host.url}:${servlet.port}/${my.servlet.war.file.name}"/>
+ <arg value="${servlet.host.url}/${my.servlet.war.file.name}"/>
<arg value="${input.data.file}"/>
</java>
</target>
<target name="registerService" description="(User) Register the service at MOBY Central (requires that the WAR file be deployed already)." >
- <echo message="${description} -- registering Service --> ${servlet.host.url}:${servlet.port}/${my.servlet.war.file.name} --X ${my.servlet.war.file.name}"/>
-<java jar="${build.dir}/${my.servlet.war.file}"
+ <echo message="${description} -- registering Service --> ${servlet.host.url}/${my.servlet.war.file.name} --X ${my.servlet.war.file.name}"/>
+<java jar="${build.dir}${file.separator}${my.servlet.war.file}"
fork="true"
classpathref="classpath" >
- <arg value="${servlet.host.url}:${servlet.port}/${my.servlet.war.file.name}"/>
+ <arg value="${servlet.host.url}/${my.servlet.war.file.name}"/>
<arg value="${input.data.file}"/>
<arg value="register"/>
</java>
</target>
<target name="registerServicePermanent" description="(User) Register the service at MOBY Central, with RDF signature (cannot be unregistered except by undeployment of servlet for several days)." >
- <echo message="${description} -- registering Service --> ${servlet.host.url}:${servlet.port}/${my.servlet.war.file.name} --X ${my.servlet.war.file.name}"/>
-<java jar="${build.dir}/${my.servlet.war.file}"
+ <echo message="${description} -- registering Service --> ${servlet.host.url}/${my.servlet.war.file.name} --X ${my.servlet.war.file.name}"/>
+<java jar="${build.dir}${file.separator}${my.servlet.war.file}"
fork="true"
classpathref="classpath" >
- <arg value="${servlet.host.url}:${servlet.port}/${my.servlet.war.file.name}"/>
+ <arg value="${servlet.host.url}/${my.servlet.war.file.name}"/>
<arg value="${input.data.file}"/>
<arg value="register_permanent"/>
</java>
</target>
<target name="unregisterService" description="(User) Unregister the service at MOBY Central.">
- <echo message="${description} -- unregistering Service --> ${servlet.host.url}:${servlet.port}/${my.servlet.war.file.name}"/>
-<java jar="${build.dir}/${my.servlet.war.file}"
+ <echo message="${description} -- unregistering Service --> ${servlet.host.url}/${my.servlet.war.file.name}"/>
+<java jar="${build.dir}${file.separator}${my.servlet.war.file}"
fork="true"
classpathref="classpath" >
- <arg value="${servlet.host.url}:${servlet.port}/${my.servlet.war.file.name}"/>
+ <arg value="${servlet.host.url}/${my.servlet.war.file.name}"/>
<arg value="${input.data.file}"/>
<arg value="unregister"/>
</java>
</target>
<target name="updateWebXML" description="(Internal) updates the WAR's web.xml file to reflect the new main servlet class" >
- <echo message="${description} -- updating ${build.dir}/WEB-INF/web.xml."/>
- <unjar src="${lib.dir}/${moby.servlet.war.file.name}" dest="${build.dir}">
+ <echo message="${description} -- updating ${build.dir}${file.separator}WEB-INF${file.separator}web.xml."/>
+ <unjar src="${lib.dir}${file.separator}${moby.servlet.war.file.name}" dest="${build.dir}">
<patternset>
- <include name="**/web.xml"/>
- <include name="META-INF/MANIFEST.MF"/>
+ <include name="**${file.separator}web.xml"/>
+ <include name="META-INF${file.separator}MANIFEST.MF"/>
</patternset>
</unjar>
- <replace file="${build.dir}/WEB-INF/web.xml" token="org.biomoby.service.MobyServlet" value="${main.class.package}.${main.class}"/>
- <replace file="${build.dir}/WEB-INF/web.xml" token="MobyServlet" value="${my.servlet.war.file.name}"/>
+ <replace file="${build.dir}${file.separator}WEB-INF${file.separator}web.xml" token="org.biomoby.service.MobyServlet" value="${main.class.package}.${main.class}"/>
+ <replace file="${build.dir}${file.separator}WEB-INF${file.separator}web.xml" token="MobyServlet" value="${my.servlet.war.file.name}"/>
</target>
@@ -226,11 +277,12 @@
<echo message=" -- lib.dir --> ${lib.dir}"/>
<echo message=" -- build.dir --> ${build.dir}"/>
<echo message=" -- build.classes.dir --> ${build.classes.dir}"/>
- <echo message=" -- user.home --> ${user.home}"/>
+ <echo message=" -- user.home --> ${user.home}"/>
+ <echo message=" -- os.name --> ${os.name}"/>
+ <echo message=" -- build.property.file --> ${build.property.file}"/>
<echo message=" -- main.class --> ${main.class}"/>
<echo message=" -- main.class.package --> ${main.class.package}"/>
<echo message=" -- main.class.dir --> ${main.class.dir}"/>
<echo message=" -- servlet.host.url --> ${servlet.host.url}"/>
- <echo message=" -- servlet.port --> ${servlet.port}"/>
</target>
</project>
===================================================================
RCS file: /home/repository/moby/moby-live/Java/xmls/servlet/mobyService.properties,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- /home/repository/moby/moby-live/Java/xmls/servlet/mobyService.properties 2006/12/06 18:37:51 1.3
+++ /home/repository/moby/moby-live/Java/xmls/servlet/mobyService.properties 2006/12/11 18:36:07 1.4
@@ -1,24 +1,18 @@
-# Where the project directory is located.
-project.dir=/export/home/gordonp/development/service
-
-# Where the Java source directory is located.
-src.dir=${project.dir}/src
+# Where the project directory is located, by default it's the same as the Ant working directory: uncomment to change
+# project.dir=/export/home/gordonp/development/service
+# Where the Java source directory is located (relative to project.dir).
+src.dir=src
+# Where any and all 3rd party libraries for your code are stored (relative to project.dir).
+lib.dir=lib
# The package-qualified location of your main class's source code (the one extending MobyServlet).
main.class.file=org/biomoby/service/test/ConvertAAtoFASTA_AA.java
-# Where all 3rd party libraries for your code are stored.
-lib.dir=${project.dir}/lib
-
# Name of the output WAR archive to be generated (will also be the servlet name).
my.servlet.war.file=ConvertAAtoFASTA_AA.war
# The location of a test MOBY XML input data file (used as input to test your service).
input.data.file=${project.dir}/mobyAASeq.xml
-# Java Servlet host URL
-servlet.host.url=http://moby.ucalgary.ca
-
-# Java Servlet port
-servlet.port=8089
-
+# Your Java Servlet host URL (with port)
+servlet.host.url=http://moby.ucalgary.ca:8089
More information about the MOBY-guts
mailing list