[MOBY-guts] biomoby commit

senger at ebi.ac.uk senger at pub.open-bio.org
Wed Sep 24 23:48:14 EDT 2003


senger
Wed Sep 24 22:48:14 EDT 2003
Update of /home/repository/moby/moby-live/Java
In directory pub.open-bio.org:/tmp/cvs-serv20871

Modified Files:
	build.xml 
Log Message:


moby-live/Java build.xml,1.2,1.3
===================================================================
RCS file: /home/repository/moby/moby-live/Java/build.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Java/build.xml	2003/09/24 14:33:37	1.2
+++ /home/repository/moby/moby-live/Java/build.xml	2003/09/25 02:48:14	1.3
@@ -7,8 +7,17 @@
    <!--                            Properties                              -->
    <!-- ================================================================== -->
 
-   <!-- The directory containing source code -->
-   <property name="src.dir" value="src"/>
+   <!-- 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"/>
+
+   <!-- Properties for the documentation and distribution -->
+   <property name="docs.dir"            value="docs"/>
+   <property name="javadoc.dir"         value="${docs.dir}/API"/>
+   <property name="documented.packages" value="org.biomoby.shared"/>
+   <property name="documented.files"    value="${src.clients}/MobyCmdLineClient.java"/>
+   <property name="dist.dir"            value="${docs.dir}/dist"/>
 
    <!-- The directory containing third-party libraries          -->
    <!-- Note: this directory can be populated from remote sites -->
@@ -20,6 +29,7 @@
    <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"/>
 
    <!-- Classpath -->
    <path id="build.classpath">
@@ -37,45 +47,151 @@
    <!-- Excludes for compilation and API documentation -->
    <property name="project.excludes" value="**/notyet/*"/>
 
+   <!-- Names of the used third-parties libraries -->
+   <property name="alltools"          value="alltools.jar"/>
+   <property name="xercesImpl"        value="xercesImpl.jar"/>
+   <property name="xercesSamples"     value="xercesSamples.jar"/>
+   <property name="xml-apis"          value="xml-apis.jar"/>
+   <property name="xmlParserAPIs"     value="xmlParserAPIs.jar"/>
+   <property name="axis-ant"          value="axis-ant.jar"/>
+   <property name="commons-discovery" value="commons-discovery.jar"/>
+   <property name="commons-logging"   value="commons-logging.jar"/>
+   <property name="jaxrpc"            value="jaxrpc.jar"/>
+   <property name="wsdl4j"            value="wsdl4j.jar"/>
+   <property name="axis"              value="axis.jar"/>
+   <property name="log4j"             value="log4j-1.2.4.jar"/>
+   <property name="saaj"              value="saaj.jar"/>
+   <property name="servlet"           value="servlet.jar"/>
+   <property name="activation"        value="activation.jar"/>
+    
    <!-- ================================================================== -->
    <!--                            Targets/Tasks                           -->
    <!-- ================================================================== -->
 
-   <!-- Fetch things from the internet... just once                       -->
-   <!-- Note: Other tasks do not depend on this task explicitly           -->
-   <!--       because it would be inconvenient when you call them without -->
-   <!--       having an internet connection. Therefore, this task is      -->
-   <!--       usually called in a separate ant invocation before anything -->
-   <!--       else happens.                                               -->
+   <!-- ================================================================== -->
+   <!-- Gather                                                             -->
+   <!--                                                                    -->
+   <!-- Fetch things from the internet... just once                        -->
+   <!-- Note: Other tasks do not depend on this task explicitly            -->
+   <!--       because it would be inconvenient when you call them without  -->
+   <!--       having an internet connection. Therefore, this task is       -->
+   <!--       usually called in a separate ant invocation before anything  -->
+   <!--       else happens.                                                -->
+   <!-- ================================================================== -->
    <target name="gather" description="Fetch all third-party libraries.">
-      <get src="${remote.dir}/alltools.jar"      dest="${lib.dir}/alltools.jar"   usetimestamp="true"/>
+      <get src="${remote.dir}/${alltools}"          dest="${lib.dir}/${alltools}"   usetimestamp="true"/>
 
-      <get src="${remote.dir}/xercesImpl.jar"    dest="${lib.dir}/xercesImpl.jar" usetimestamp="true"/>
-      <get src="${remote.dir}/xercesSamples.jar" dest="${lib.dir}/xercesSamples.jar" usetimestamp="true"/>
-      <get src="${remote.dir}/xml-apis.jar"      dest="${lib.dir}/xml-apis.jar" usetimestamp="true"/>
-      <get src="${remote.dir}/xmlParserAPIs.jar" dest="${lib.dir}/xmlParserAPIs.jar" usetimestamp="true"/>
-
-      <get src="${remote.dir}/axis-ant.jar"          dest="${lib.dir}/axis-ant.jar" usetimestamp="true"/>
-      <get src="${remote.dir}/commons-discovery.jar" dest="${lib.dir}/commons-discovery.jar" usetimestamp="true"/>
-      <get src="${remote.dir}/commons-logging.jar"   dest="${lib.dir}/commons-logging.jar" usetimestamp="true"/>
-      <get src="${remote.dir}/jaxrpc.jar"            dest="${lib.dir}/jaxrpc.jar" usetimestamp="true"/>
-      <get src="${remote.dir}/wsdl4j.jar"            dest="${lib.dir}/wsdl4j.jar" usetimestamp="true"/>
-      <get src="${remote.dir}/axis.jar"              dest="${lib.dir}/axis.jar" usetimestamp="true"/>
-      <get src="${remote.dir}/log4j-1.2.4.jar"       dest="${lib.dir}/log4j-1.2.4.jar" usetimestamp="true"/>
-      <get src="${remote.dir}/saaj.jar"              dest="${lib.dir}/saaj.jar" usetimestamp="true"/>
-      <get src="${remote.dir}/servlet.jar"           dest="${lib.dir}/servlet.jar" usetimestamp="true"/>
-      <get src="${remote.dir}/activation.jar"        dest="${lib.dir}/activation.jar" usetimestamp="true"/>
+      <get src="${remote.dir}/${xercesImpl}"        dest="${lib.dir}/${xercesImpl}" usetimestamp="true"/>
+      <get src="${remote.dir}/${xercesSamples}"     dest="${lib.dir}/${xercesSamples}" usetimestamp="true"/>
+      <get src="${remote.dir}/${xml-apis}"          dest="${lib.dir}/${xml-apis}" usetimestamp="true"/>
+      <get src="${remote.dir}/${xmlParserAPIs}"     dest="${lib.dir}/${xmlParserAPIs}" usetimestamp="true"/>
+
+      <get src="${remote.dir}/${axis-ant}"          dest="${lib.dir}/${axis-ant}" usetimestamp="true"/>
+      <get src="${remote.dir}/${commons-discovery}" dest="${lib.dir}/${commons-discovery}" usetimestamp="true"/>
+      <get src="${remote.dir}/${commons-logging}"   dest="${lib.dir}/${commons-logging}" usetimestamp="true"/>
+      <get src="${remote.dir}/${jaxrpc}"            dest="${lib.dir}/${jaxrpc}" usetimestamp="true"/>
+      <get src="${remote.dir}/${wsdl4j}"            dest="${lib.dir}/${wsdl4j}" usetimestamp="true"/>
+      <get src="${remote.dir}/${axis}"              dest="${lib.dir}/${axis}" usetimestamp="true"/>
+      <get src="${remote.dir}/${log4j}"             dest="${lib.dir}/${log4j}" usetimestamp="true"/>
+      <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"/>
    </target>
 
-   <!-- Create the build directories prior to the compile target -->
-   <target name="prepare">
+
+   <!-- ================================================================== -->
+   <!-- Initialize (whatever needs to be done)                             -->
+   <!-- ================================================================== -->
+   <target name="init">
+      <!-- Set current date/time -->
+      <tstamp>
+         <format property="TODAY_LONG"  pattern="EEE MMM d HH:mm:ss z yyyy"/>
+         <format property="TODAY_SHORT" pattern="yyyy-MM-dd"/>
+      </tstamp>
+
+      <!-- Create the build directories prior to the compile target -->
       <mkdir dir="${build.dir}"/>
       <mkdir dir="${build.classes}"/>
       <mkdir dir="${build.lib}"/>
       <mkdir dir="${build.clients}"/>
       <mkdir dir="${build.clients}/help"/>
+
+      <!-- Conditions -->
+      <condition property="libs.present">
+         <and> 
+            <available file="${lib.dir}/${alltools}"/>
+            <available file="${lib.dir}/${xercesImpl}"/>
+            <available file="${lib.dir}/${xercesSamples}"/>
+            <available file="${lib.dir}/${xml-apis}"/>
+            <available file="${lib.dir}/${xmlParserAPIs}"/>
+            <available file="${lib.dir}/${axis-ant}"/>
+            <available file="${lib.dir}/${commons-discovery}"/>
+            <available file="${lib.dir}/${commons-logging}"/>
+            <available file="${lib.dir}/${jaxrpc}"/>
+            <available file="${lib.dir}/${wsdl4j}"/>
+            <available file="${lib.dir}/${axis}"/>
+            <available file="${lib.dir}/${log4j}"/>
+            <available file="${lib.dir}/${saaj}"/>
+            <available file="${lib.dir}/${servlet}"/>
+            <available file="${lib.dir}/${activation}"/>
+         </and>
+      </condition>
+   </target>
+
+   <!-- ================================================================== -->
+   <!-- Compiles everything                                                -->
+   <!-- ================================================================== -->
+   <target name="compile" depends="init"
+           description="Compiles all source code.">
+      <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.
+      </fail>
+      <javac srcdir="${src.main}"
+             destdir="${build.classes}"
+             excludes="${project.excludes}">
+         <classpath refid="build.classpath"/>
+      </javac>
+      <javac srcdir="${src.clients}"
+             destdir="${build.clients}"
+             excludes="${project.excludes}">
+         <classpath refid="build.classpath"/>
+      </javac>
+      <copy todir="${build.clients}/help">
+         <fileset dir="${src.clients}/help"/>
+      </copy>
    </target>
 
+   <!-- =================================================================== -->
+   <!-- Creates the API documentation                                       -->
+   <!-- =================================================================== -->
+   <target name="docs" depends="init" description="Generates API documentation.">
+      <javadoc packagenames="${documented.packages}" 
+               sourcepath="${src.main}"
+               sourcefiles="${documented.files}"
+               destdir="${javadoc.dir}"
+               classpathref="build.classpath"
+
+               windowtitle="jMoby"
+               doctitle="jMoby: BioMOBY in Java"
+               overview="${docs.dir}/API-overview.html"
+               author="true"
+               version="true"
+               use="true"
+               nodeprecatedlist="true"
+               public="true">
+         <group title="jMoby Shared Resources" 
+                packages="org.biomoby.shared"/>
+         <header><![CDATA[<font size=\"-1\">Generated: ${TODAY_LONG}</font>]]></header>
+         <bottom><![CDATA[<font size=\"-1\">
+                          <a href=\"mailto:markw at illuminae.com,senger at ebi.ac.uk\">Submit a bug or feature</a><BR>
+                          Generated: ${TODAY_LONG}</font>]]></bottom>
+      </javadoc>
+   </target>
+
+   <!-- ================================================================== -->
+   <!-- Clean-up                                                           -->
+   <!-- ================================================================== -->
    <target name="clean" description="Remove all generated files.">
       <delete dir="${build.dir}"/>
    </target>
@@ -89,30 +205,76 @@
       </delete>
    </target>
 
-   <target name="compile" depends="prepare" description="Compiles all source code.">
-      <javac srcdir="${src.dir}/main"
-             destdir="${build.classes}"
-             excludes="${project.excludes}">
-         <classpath refid="build.classpath"/>
-      </javac>
-      <javac srcdir="${src.dir}/Clients"
-             destdir="${build.clients}"
-             excludes="${project.excludes}">
-         <classpath refid="build.classpath"/>
-      </javac>
-      <copy todir="${build.clients}/help">
-         <fileset dir="${src.dir}/Clients/help"/>
-      </copy>
+
+   <!-- ================================================================== -->
+   <!-- Builds a jar file with jMoby classes                               -->
+   <!-- ================================================================== -->
+   <target name="jar" depends="compile"
+      description="Creates a jar file with jMoby classes.">
+      <jar destfile="${build.lib}/jmoby.jar"> 
+         <fileset dir="${build.classes}"/>
+         <fileset dir="${build.clients}"/>
+         <manifest>
+            <attribute name="Built-By" value="${user.name}"/>
+         </manifest>
+      </jar>
    </target>
 
+   <!-- ================================================================== -->
+   <!-- Builds files for binary distribution                               -->
+   <!-- ================================================================== -->
+   <target name="dist" depends="compile,jar"
+      description="Creates binary distribution files.">
+
+      <!-- Name of the final binary distribution (without extension) -->
+      <property name="destfile" value="${dist.dir}/jMoby-${TODAY_SHORT}"/>
+
+      <!-- Create a binary distribution by copying all wanted files to one place -->
+      <delete dir="${build.dist}"/>
+      <mkdir dir="${build.dist}"/>
+      <copy todir="${build.dist}/lib">
+         <fileset dir="${lib.dir}" excludes="ant_home/**" includes="*.jar"/>
+         <fileset dir="${build.lib}" includes="*.jar"/>
+      </copy>
+      <copy todir="${build.dist}/docs">
+         <fileset dir="${docs.dir}" excludes="dist/**,.keep_me"/>
+      </copy>
+      <copy todir="${build.dist}">
+         <fileset dir="${src.root}/support" excludes="_README.FIRST_"/>
+         <fileset file="${basedir}/cp.bat"/>
+      </copy>
+      <chmod dir="${build.dist}" perm="ugo+rx" includes="run-*" excludes="*.bat"/>
+
+      <!-- Make both tarball and zip final files -->
 <!--
-   <target name="jar" depends="compile" description="Generates pi.jar in the 'dist' directory.">
-      <jar jarfile="${build.lib}/pi.jar" basedir="${build.classes}"/>
+      <tar destfile="${destfile}.tar" compression="gzip">
+         <tarfileset dir="${build.dist}/" mode="755">
+            <include name="${build.dist}/run-*"/>
+         </tarfileset>
+         <tarfileset dir="${build.dist}/">
+            <include name="${build.dist}/**"/>
+            <exclude name="${build.dist}/run-*"/>
+         </tarfileset>
+      </tar>
+-->
+      <tar destfile="${destfile}.tar.gz" basedir="${build.dist}" compression="gzip"/>
+      <zip destfile="${destfile}.zip" basedir="${build.dist}"/>
+
    </target>
 
-   <target name="all" depends="clean,jar" description="Cleans, compiles, then builds the JAR file."/>
--->
 
-   <target name="all" depends="clean" description="Cleans, compiles, then builds the JAR file."/>
+   <!-- ================================================================== -->
+   <!-- all: builds everything (except for gathering external libraries)   -->
+   <!-- ================================================================== -->
+   <target name="all" depends="clean,compile,docs,jar,dist"
+           description="Cleans, compiles, generates docs, then builds distribution."/>
+
+   <!-- ================================================================== -->
+   <!-- Just for testing...                                                -->
+   <!-- ================================================================== -->
+   <target name="testing" depends="init">
+      <echo message="${TODAY_LONG}"/>
+      <echo message="${TODAY_SHORT}"/>
+   </target>
 
 </project>



More information about the MOBY-guts mailing list