[MOBY-guts] biomoby commit

senger@ebi.ac.uk senger at pub.open-bio.org
Sat Nov 8 00:27:24 UTC 2003


senger
Fri Nov  7 19:27:24 EST 2003
Update of /home/repository/moby/moby-live/Java
In directory pub.open-bio.org:/tmp/cvs-serv17161

Modified Files:
	.cvsignore.template README build-dev.bat build-dev.sh 
	build.bat build.sh build.xml 
Added Files:
	build.properties.template run-any-client run-any-client.bat 
	run-graphs-client.bat 
Log Message:
added graphs for exploring biomoby registry

moby-live/Java build.properties.template,NONE,1.1 run-any-client,NONE,1.1 run-any-client.bat,NONE,1.1 run-graphs-client.bat,NONE,1.1 .cvsignore.template,1.1,1.2 README,1.6,1.7 build-dev.bat,1.2,1.3 build-dev.sh,1.2,1.3 build.bat,1.2,1.3 build.sh,1.2,1.3 build.xml,1.3,1.4
===================================================================
RCS file: /home/repository/moby/moby-live/Java/.cvsignore.template,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Java/.cvsignore.template	2003/09/24 12:33:47	1.1
+++ /home/repository/moby/moby-live/Java/.cvsignore.template	2003/11/08 00:27:23	1.2
@@ -1,5 +1,3 @@
 .cvsignore
-setenv.sh
-setenv.bat
 build
-doc-dev
+build.properties

===================================================================
RCS file: /home/repository/moby/moby-live/Java/README,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- /home/repository/moby/moby-live/Java/README	2003/09/25 12:22:06	1.6
+++ /home/repository/moby/moby-live/Java/README	2003/11/08 00:27:23	1.7
@@ -2,6 +2,9 @@
 accessing Moby registry, and, hopefully in the future, more
 implementation of pure Java in BioMoby project.
 
+It also contains classes (both servlets and standalone)
+exploring BioMoby registry graphically.
+
 Find more in docs/index.html.
 
 If you do not want to build it you can use the binary distribution
@@ -51,17 +54,16 @@
       If not set the script tries to find it anyway (but not for the
       Windows platform - I do not know how to do it there :-)).
 
-   USE_JIKES
-      Saying what Java compiler to use:
-      USE_JIKES=1  => jikes is used (it is up to you to
-                      make sure that an executable 'jikes'
-                      is on your PATH)
-      Default: USE_JIKES is unset (therefore, no jikes used).
+It also uses file 'build.properties' (if such file exists either in
+this directory or in your home directory) - where you can specify
+your-site-specific properties (mostly it is, however, used only if you
+deploying servlets into your Tomcat servlet container - see details in
+the 'build.properties.template').
 
 Last note for developers:
    If you want to commit your changes back consider to copy file(s)
 '.cvsignore.template' into '.cvsignore. This will save you from
-warning message about local files which you do not want to commit
+warning messages about local files which you do not want to commit
 (e.g. generated 'build' directory).
 
 

===================================================================
RCS file: /home/repository/moby/moby-live/Java/build-dev.bat,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Java/build-dev.bat	2003/09/25 09:43:42	1.2
+++ /home/repository/moby/moby-live/Java/build-dev.bat	2003/11/08 00:27:23	1.3
@@ -4,7 +4,7 @@
 REM See comments in build-dev.sh.
 REM ALSO: I do not understand Windows and do not develop on this platform.
 REM       Therefore, any improvements of this script are welcome.
-REM       Please do not hesitate a contact Martin Senger <senger at ebi.ac.uk>
+REM       Please do not hesitate and contact Martin Senger <senger at ebi.ac.uk>.
 
 REM Set-up JAVA_HOME
 REM ----------------
@@ -24,15 +24,6 @@
 set ANT_HOME=.\lib\ant_home
 :antdone
 
-REM What compiler to use
-REM --------------------
-if "%USE_JIKES%"=="" goto classic
-set COMPILER=-Dbuild.compiler=jikes
-goto compilerdone
-:classic
-set COMPILER=
-:compilerdone
-
 REM Put Ant libraries in CLASSPATH
 REM ------------------------------
 set CP=
@@ -42,7 +33,7 @@
 REM Call Ant to do the building
 REM ---------------------------
 set JAVA=%JAVA_HOME%\bin\java
-%JAVA% -classpath %CP% %COMPILER% -Dant.home=%ANT_HOME% org.apache.tools.ant.Main %1 %2 %3 %4 %5 %6 %7 %8 %9 -buildfile build.xml
+%JAVA% -classpath %CP% -Dant.home=%ANT_HOME% org.apache.tools.ant.Main %1 %2 %3 %4 %5 %6 %7 %8 %9 -buildfile build.xml
 
 :end
 

===================================================================
RCS file: /home/repository/moby/moby-live/Java/build-dev.sh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Java/build-dev.sh	2003/09/25 02:51:00	1.2
+++ /home/repository/moby/moby-live/Java/build-dev.sh	2003/11/08 00:27:23	1.3
@@ -20,11 +20,6 @@
 #              Default (used if variable is not set): ./lib/ant_home
 #     JAVA_HOME ... pointing to a directory with your Java JDK.
 #              If not set the script tries to find it anyway.
-#     USE_JIKES ... saying what Java compiler to use:
-#              USE_JIKES=1  => jikes is used (it is up to you to
-#                              make sure that an executable 'jikes'
-#                              is on your PATH)
-#              Default: USE_JIKES is unset (therefore, no jikes used).
 
 # --- setup JAVA_HOME
 if [ -z "$JAVA_HOME" ] ; then
@@ -52,19 +47,10 @@
 fi
 #echo "Using Ant libraries from: $ANT_HOME/lib."
 
-# --- what compiler to use
-if [ -z "$USE_JIKES" ] ; then
-    unset COMPILER
-    echo "Using default JDK compiler."
-else
-    COMPILER=-Dbuild.compiler=jikes
-    echo "Using jikes compiler."
-fi
-
 # --- put Ant libraries in CLASSPATH
 CLASSPATH=`echo $ANT_HOME/lib/*.jar | tr ' ' ':'`
 CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/tools.jar
 
 # --- call Ant to do the building
 JAVA=$JAVA_HOME/bin/java
-$JAVA -classpath $CLASSPATH $COMPILER -Dant.home=$ANT_HOME org.apache.tools.ant.Main "$@" -buildfile build.xml
+$JAVA -classpath $CLASSPATH -Dant.home=$ANT_HOME org.apache.tools.ant.Main "$@" -buildfile build.xml

===================================================================
RCS file: /home/repository/moby/moby-live/Java/build.bat,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Java/build.bat	2003/09/25 09:43:42	1.2
+++ /home/repository/moby/moby-live/Java/build.bat	2003/11/08 00:27:23	1.3
@@ -4,7 +4,7 @@
 REM See comments in build.sh.
 REM ALSO: I do not understand Windows and do not develop on this platform.
 REM       Therefore, any improvements of this script are welcome.
-REM       Please do not hesitate a contact Martin Senger <senger at ebi.ac.uk>
+REM       Please do not hesitate and contact Martin Senger <senger at ebi.ac.uk>.
 
 REM Set-up JAVA_HOME
 REM ----------------
@@ -25,15 +25,6 @@
 set ANT_HOME=.\lib\ant_home
 :antdone
 
-REM What compiler to use
-REM --------------------
-if "%USE_JIKES%"=="" goto classic
-set COMPILER=-Dbuild.compiler=jikes
-goto compilerdone
-:classic
-set COMPILER=
-:compilerdone
-
 REM Put Ant libraries in CLASSPATH
 REM ------------------------------
 set CP=
@@ -44,6 +35,6 @@
 REM ---------------------------
 set JAVA=%JAVA_HOME%\bin\java
 %JAVA% -classpath %CP% -Dant.home=%ANT_HOME% org.apache.tools.ant.Main -buildfile build.xml gather
-%JAVA% -classpath %CP% %COMPILER% -Dant.home=%ANT_HOME% org.apache.tools.ant.Main %1 %2 %3 %4 %5 %6 %7 %8 %9 -buildfile build.xml
+%JAVA% -classpath %CP% -Dant.home=%ANT_HOME% org.apache.tools.ant.Main %1 %2 %3 %4 %5 %6 %7 %8 %9 -buildfile build.xml
 
 :end

===================================================================
RCS file: /home/repository/moby/moby-live/Java/build.sh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Java/build.sh	2003/09/25 02:51:00	1.2
+++ /home/repository/moby/moby-live/Java/build.sh	2003/11/08 00:27:23	1.3
@@ -16,11 +16,6 @@
 #              Default (used if variable is not set): ./lib/ant_home
 #     JAVA_HOME ... pointing to a directory with your Java JDK.
 #              If not set the script tries to find it anyway.
-#     USE_JIKES ... saying what Java compiler to use:
-#              USE_JIKES=1  => jikes is used (it is up to you to
-#                              make sure that an executable 'jikes'
-#                              is on your PATH)
-#              Default: USE_JIKES is unset (therefore, no jikes used).
 
 # --- setup JAVA_HOME
 if [ -z "$JAVA_HOME" ] ; then
@@ -48,15 +43,6 @@
 fi
 #echo "Using Ant libraries from: $ANT_HOME/lib."
 
-# --- what compiler to use
-if [ -z "$USE_JIKES" ] ; then
-    unset COMPILER
-    echo "Using default JDK compiler."
-else
-    COMPILER=-Dbuild.compiler=jikes
-    echo "Using jikes compiler."
-fi
-
 # --- put Ant libraries in CLASSPATH
 CLASSPATH=`echo $ANT_HOME/lib/*.jar | tr ' ' ':'`
 CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/tools.jar
@@ -64,4 +50,4 @@
 # --- call Ant to do the building
 JAVA=$JAVA_HOME/bin/java
 $JAVA -classpath $CLASSPATH -Dant.home=$ANT_HOME org.apache.tools.ant.Main -buildfile build.xml gather
-$JAVA -classpath $CLASSPATH $COMPILER -Dant.home=$ANT_HOME org.apache.tools.ant.Main "$@" -buildfile build.xml
+$JAVA -classpath $CLASSPATH -Dant.home=$ANT_HOME org.apache.tools.ant.Main "$@" -buildfile build.xml

===================================================================
RCS file: /home/repository/moby/moby-live/Java/build.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- /home/repository/moby/moby-live/Java/build.xml	2003/09/25 02:48:14	1.3
+++ /home/repository/moby/moby-live/Java/build.xml	2003/11/08 00:27:23	1.4
@@ -7,10 +7,21 @@
    <!--                            Properties                              -->
    <!-- ================================================================== -->
 
-   <!-- The directories containing sources -->
-   <property name="src.root"    value="src"/>
-   <property name="src.main"    value="${src.root}/main"/>
-   <property name="src.clients" value="${src.root}/Clients"/>
+   <!-- General properties -->
+   <property environment="env"/>
+   <property name="project.home" location="."/>
+   <!-- Give user a chance to override without editing this file
+        (and without typing -D each time it compiles it) -->
+   <property file="${project.home}/build.properties"/>
+   <property file="${user.home}/build.properties"/>
+
+   <!-- The directories containing sources and supporting files -->
+   <property name="src.root"     value="src"/>
+   <property name="src.main"     value="${src.root}/main"/>
+   <property name="src.clients"  value="${src.root}/Clients"/>
+   <property name="src.services" value="${src.root}/Services"/>
+   <property name="src.webapps"  value="${src.root}/webapps"/>
+   <property name="src.support"  value="${src.root}/support"/>
 
    <!-- Properties for the documentation and distribution -->
    <property name="docs.dir"            value="docs"/>
@@ -25,16 +36,19 @@
    <property name="lib.dir" value="lib"/>
 
    <!-- Temporary build directories -->
-   <property name="build.dir"     value="build"/>
-   <property name="build.classes" value="${build.dir}/classes"/>
-   <property name="build.lib"     value="${build.dir}/lib"/>
-   <property name="build.clients" value="${build.dir}/Clients"/>
-   <property name="build.dist"    value="${build.dir}/dist"/>
+   <property name="build.dir"      value="build"/>
+   <property name="build.classes"  value="${build.dir}/classes"/>
+   <property name="build.lib"      value="${build.dir}/lib"/>
+   <property name="build.clients"  value="${build.dir}/Clients"/>
+   <property name="build.services" value="${build.dir}/Services"/>
+   <property name="build.dist"     value="${build.dir}/dist"/>
+   <property name="build.webapps"  value="${build.dir}/webapps/jmoby"/>
 
    <!-- Classpath -->
    <path id="build.classpath">
       <pathelement location="${build.classes}"/>
       <pathelement location="${build.clients}"/>
+      <pathelement location="${build.services}"/>
       <fileset dir="${lib.dir}">
          <include name="*.jar"/>
       </fileset>
@@ -63,6 +77,8 @@
    <property name="saaj"              value="saaj.jar"/>
    <property name="servlet"           value="servlet.jar"/>
    <property name="activation"        value="activation.jar"/>
+   <property name="adenine"           value="adenine.jar"/>
+   <property name="jena"              value="jena.jar"/>
     
    <!-- ================================================================== -->
    <!--                            Targets/Tasks                           -->
@@ -96,6 +112,9 @@
       <get src="${remote.dir}/${saaj}"              dest="${lib.dir}/${saaj}" usetimestamp="true"/>
       <get src="${remote.dir}/${servlet}"           dest="${lib.dir}/${servlet}" usetimestamp="true"/>
       <get src="${remote.dir}/${activation}"        dest="${lib.dir}/${activation}" usetimestamp="true"/>
+
+      <get src="${remote.dir}/${adenine}"           dest="${lib.dir}/${adenine}" usetimestamp="true"/>
+      <get src="${remote.dir}/${jena}"              dest="${lib.dir}/${jena}" usetimestamp="true"/>
    </target>
 
 
@@ -115,6 +134,7 @@
       <mkdir dir="${build.lib}"/>
       <mkdir dir="${build.clients}"/>
       <mkdir dir="${build.clients}/help"/>
+      <mkdir dir="${build.services}"/>
 
       <!-- Conditions -->
       <condition property="libs.present">
@@ -134,15 +154,56 @@
             <available file="${lib.dir}/${saaj}"/>
             <available file="${lib.dir}/${servlet}"/>
             <available file="${lib.dir}/${activation}"/>
+            <available file="${lib.dir}/${adenine}"/>
+            <available file="${lib.dir}/${jena}"/>
          </and>
       </condition>
+
+      <condition property="web.xml.present">
+         <available file="${src.webapps}/web.xml"/>
+      </condition>
+
+      <!-- the following properties are set either from the file
+           'build.properties', or from the environment variables, or
+           they get some default value if not set from any of these
+           sources; in any case they represent site-specific values
+      -->
+      <condition property="real.catalina.home" value="${env.CATALINA_HOME}">
+         <isset property="env.CATALINA_HOME"/>
+      </condition>
+      <condition property="real.catalina.home" value="${catalina.home}">
+         <isset property="catalina.home"/>
+      </condition>
+
+      <condition property="provider.name" value="">
+         <not><isset property="provider.name"/></not>
+      </condition>
+      <condition property="provider.email" value="">
+         <not><isset property="provider.email"/></not>
+      </condition>
+      <condition property="refresh.interval" value="">
+         <not><isset property="refresh.interval"/></not>
+      </condition>
+      <condition property="cache.dir" value="">
+         <not><isset property="cache.dir"/></not>
+      </condition>
+      <condition property="cache.url" value="">
+         <not><isset property="cache.url"/></not>
+      </condition>
+      <condition property="default.endpoint" value="">
+         <not><isset property="default.endpoint"/></not>
+      </condition>
+      <condition property="default.namespace" value="">
+         <not><isset property="default.namespace"/></not>
+      </condition>
+
    </target>
 
    <!-- ================================================================== -->
    <!-- Compiles everything                                                -->
    <!-- ================================================================== -->
    <target name="compile" depends="init"
-           description="Compiles all source code.">
+           description="Compile all source code (default).">
       <fail unless="libs.present">
       Missing one or more third-party libraries.
       Try to run build.sh or build.bat to fetch them from the net.
@@ -157,6 +218,11 @@
              excludes="${project.excludes}">
          <classpath refid="build.classpath"/>
       </javac>
+      <javac srcdir="${src.services}"
+             destdir="${build.services}"
+             excludes="${project.excludes}">
+         <classpath refid="build.classpath"/>
+      </javac>
       <copy todir="${build.clients}/help">
          <fileset dir="${src.clients}/help"/>
       </copy>
@@ -165,7 +231,7 @@
    <!-- =================================================================== -->
    <!-- Creates the API documentation                                       -->
    <!-- =================================================================== -->
-   <target name="docs" depends="init" description="Generates API documentation.">
+   <target name="docs" depends="init" description="Generate API documentation.">
       <javadoc packagenames="${documented.packages}" 
                sourcepath="${src.main}"
                sourcefiles="${documented.files}"
@@ -201,6 +267,7 @@
       <delete>
          <fileset dir="${lib.dir}">
             <include name="*.jar"/>
+            <exclude name="ant_home/*.jar"/>
          </fileset>
       </delete>
    </target>
@@ -210,10 +277,11 @@
    <!-- Builds a jar file with jMoby classes                               -->
    <!-- ================================================================== -->
    <target name="jar" depends="compile"
-      description="Creates a jar file with jMoby classes.">
+      description="Create a jar file with jMoby classes.">
       <jar destfile="${build.lib}/jmoby.jar"> 
          <fileset dir="${build.classes}"/>
          <fileset dir="${build.clients}"/>
+         <fileset dir="${build.services}"/>
          <manifest>
             <attribute name="Built-By" value="${user.name}"/>
          </manifest>
@@ -223,8 +291,8 @@
    <!-- ================================================================== -->
    <!-- Builds files for binary distribution                               -->
    <!-- ================================================================== -->
-   <target name="dist" depends="compile,jar"
-      description="Creates binary distribution files.">
+   <target name="bindist" depends="compile,jar"
+      description="Create binary distribution.">
 
       <!-- Name of the final binary distribution (without extension) -->
       <property name="destfile" value="${dist.dir}/jMoby-${TODAY_SHORT}"/>
@@ -237,10 +305,10 @@
          <fileset dir="${build.lib}" includes="*.jar"/>
       </copy>
       <copy todir="${build.dist}/docs">
-         <fileset dir="${docs.dir}" excludes="dist/**,.keep_me"/>
+         <fileset dir="${docs.dir}" excludes="dist/**,graphs/**,.keep_me"/>
       </copy>
       <copy todir="${build.dist}">
-         <fileset dir="${src.root}/support" excludes="_README.FIRST_"/>
+         <fileset dir="${src.support}" excludes="_README.FIRST_"/>
          <fileset file="${basedir}/cp.bat"/>
       </copy>
       <chmod dir="${build.dist}" perm="ugo+rx" includes="run-*" excludes="*.bat"/>
@@ -262,12 +330,86 @@
 
    </target>
 
+   <property name="deploy.war.file" value="${build.webapps}/jmoby.war"/>
 
    <!-- ================================================================== -->
-   <!-- all: builds everything (except for gathering external libraries)   -->
+   <!-- Move distribution of packed servlets (.war file)                 -->
    <!-- ================================================================== -->
-   <target name="all" depends="clean,compile,docs,jar,dist"
-           description="Cleans, compiles, generates docs, then builds distribution."/>
+   <target name="wardist" depends="war"
+      description="Move a 'war' file (with servlets) to the distribution directory.">
+      <copy file="${deploy.war.file}"
+            tofile="${dist.dir}/jmoby-${TODAY_SHORT}.war"
+            overwrite="yes"/>
+   </target>
+
+
+   <!-- ================================================================== -->
+   <!-- Deploys servlets and web services to local Tomcat                  -->
+   <!-- ================================================================== -->
+   <target name="deploy" depends="deploy-servlets,deploy-ws"
+      description="Deploy both jMoby servlets and Web Services to local Tomcat.">
+   </target>
+
+   <target name="tomcat-init" depends="init">
+      <fail unless="real.catalina.home"> 
+         Tomcat Catalina not found.
+         Please set environment variable CATALINA_HOME to point to it, or
+         create a file 'build.properties' and put there the line:
+            catalina.home = &lt;location of your CATALINA&gt;
+         (do not include '&lt;' and '&gt;' there)
+      </fail>
+   </target>
+
+   <target name="deploy-ws" depends="tomcat-init,compile"
+      description="Deploy jMoby Web Services to local Tomcat.">
+      <echo message="There are no Web Services to be deployed (yet)"/>
+   </target>
+
+   <target name="war" depends="compile"
+      description="Create a war file with jMoby servlets.">
+      <mkdir dir="${build.webapps}"/>
+      <mkdir dir="${build.webapps}/cache"/>
+      <copy file="${src.webapps}/web.xml.template"
+            tofile="${build.webapps}/web.xml"
+            overwrite="yes">
+         <filterset>
+            <filter token="PROVIDER_NAME"     value="${provider.name}"/>
+            <filter token="PROVIDER_EMAIL"    value="${provider.email}"/>
+            <filter token="REFRESH_INTERVAL"  value="${refresh.interval}"/>
+            <filter token="CACHE_DIR"         value="${cache.dir}"/>
+            <filter token="CACHE_URL"         value="${cache.url}"/>
+            <filter token="DEFAULT_ENDPOINT"  value="${default.endpoint}"/>
+            <filter token="DEFAULT_NAMESPACE" value="${default.namespace}"/>
+         </filterset>
+      </copy>
+      <war destfile="${deploy.war.file}"
+           webxml="${build.webapps}/web.xml">
+         <fileset dir="${docs.dir}/graphs"/>
+         <classes dir="${build.classes}"/>
+         <lib dir="${lib.dir}">
+            <include name="*.jar"/>
+            <exclude name="ant_home/*"/>
+            <exclude name="servlet.jar"/>
+         </lib>
+         <zipfileset dir="${build.webapps}/cache" 
+                     prefix="cache"/>
+      </war>
+   </target>
+
+   <target name="deploy-servlets" depends="tomcat-init,war"
+      description="Deploy jMoby servlets to local Tomcat.">
+      <property name="deploy.webapp.dir" location="${real.catalina.home}/webapps"/>
+      <delete dir="${deploy.webapp.dir}/jmoby"/>
+      <copy file="${deploy.war.file}" todir="${deploy.webapp.dir}"/>
+      <echo message="jMoby [re-]deployed, you may need to restart Tomcat"/>
+   </target>
+
+   <!-- ================================================================== -->
+   <!-- all: builds everything (except for gathering external libraries    -->
+   <!--                         and for deploying to local Tomcat)         -->
+   <!-- ================================================================== -->
+   <target name="all" depends="clean,compile,docs,jar,bindist,war,wardist"
+           description="Clean, compile, generate docs, then build all distributions."/>
 
    <!-- ================================================================== -->
    <!-- Just for testing...                                                -->
@@ -278,3 +420,4 @@
    </target>
 
 </project>
+




More information about the MOBY-guts mailing list