[Biojava-l] Problems (slight) with the Biojava code in CVS

Michael L. Heuer heuermh@shore.net
Wed, 9 Feb 2000 12:36:55 -0500 (EST)


All,


Matthew Pocock wrote:

> I think there is no question that we keep the existing woefull
> scripts - they work. We should have similar .bat files for win
> people.

I agree .. Ant hasn't become standard everywhere (well, not as much as
some of us would like), and in its current incarnation is not very well
documented.  The simple scripts have a very low barrier of entry to the
new user.


Terry Triplett wrote:

> The only hesitation I would have is that ant isn't a standard tool on most
> systems (yet), while everyone doing java work has at least the jdk and some
> sort of shell which can run scripts (sh or bat).

Ah, but the poor Mac user loses out once again!  ;)


Matthew Pocock wrote:

> If you find that ant works, then we should include the ant scripts (but
> not the programs) in the build directory, or where ever apropreate.

Typically a repository has a couple of discrete projects, so you end up
with a directory structure like this (java.apache.org is a good example):

/{root}/{project}/build.xml
/{root}/{project}/src
/{root}/{project}/ ...

and then these directories are created dynamically by ant:

/{root}/{project}/dist
/{root}/{project}/build
/{root}/{project}/{name}-{version}.zip

and the zip file (or tarball) is put up on a website for download.


I don't know if it would be worthwhile to split biojava-live into separate
projects at some point or not, and I'm not suggesting that, but it would
make it easier to partition different chunks of code into separate
downloadable pieces.

In the meantime I've created this ant build.xml file that just dists up
the whole tree.


   michael


---
<?xml version="1.0"?>

<!--

  Ant build file for the entire biojava-live tree
	
  see:
  <a href="http://jakarta.apache.org/ant">Ant Project Homepage</a>
  <a href="http://home.wxs.nl/~ajkuiper/ant.html">Ant User Manual</a>
  <a href="http://jakarta.apache.org/builds/tomcat/nightly/ant.zip">Download</a>
	
  targets:

    compile
    package
    javadocs
    dist
    clean

  author:  Michael Heuer
  version: $Id$
	
  portions Copyright (c) 1999 The Apache Software Foundation.
	
-->
	
<project default="package" basedir=".">

  <property name="name" value="biojava-live"/>
  <property name="version" value="1.0"/>
		
  <property name="build.compiler" value="classic"/>
  <!-- property name="build.compiler" value="jikes" -->
	
  <property name="src.dir" value="./src"/>
  <property name="packages" value="org.acedb.*,org.biojava.*"/>
	
  <property name="build.dir" value="./build"/>
  <property name="build.src" value="./build/src"/>
  <property name="build.dest" value="./build/classes"/>
  <property name="build.javadocs" value="./build/docs"/>

  <property name="dist.dir" value="./dist"/>
	
  <!-- Prepares the build directory -->
  <target name="prepare">
    <mkdir dir="${build.dir}"/>
  </target>

  <!-- Prepares the source code -->
  <target name="prepare-src" depends="prepare">
		
    <!-- create directories -->
    <mkdir dir="${build.src}"/>
    <mkdir dir="${build.dest}"/>

    <!-- copy src files -->
    <copydir src="${src.dir}" dest="${build.src}" ignore="CVS, cvs"/>
  </target>
	
  <!-- Compiles the source directory -->
  <target name="compile" depends="prepare-src">
    <javac srcdir="${build.src}" destdir="${build.dest}" classpath="${classpath}"/>
  </target>
	
  <!-- Creates the class package -->
  <target name="package" depends="compile">
    <jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}" items="org"/>
  </target>
	
  <!-- Creates the API documentation -->
  <target name="javadocs" depends="prepare-src">
    <mkdir dir="${build.javadocs}"/>
    <javadoc2 packagenames="${packages}"
        sourcepath="${build.src}"
        destdir="${build.javadocs}"
        author="true"
        version="true"
        use="true"
        windowtitle="${name} API"
        doctitle="${name}"
    />
  </target>
	
  <!-- Creates the distribution -->
  <target name="dist" depends="package,javadocs">
    <mkdir dir="${dist.dir}"/>
    <mkdir dir="${dist.dir}/bin"/>
    <mkdir dir="${dist.dir}/docs"/>

    <copyfile src="${build.dir}/${name}.jar" dest="${dist.dir}/bin/${name}.jar"/>
    <copydir src="${build.javadocs}" dest="${dist.dir}/docs"/>
	
    <zip zipfile="${name}-${version}.zip" basedir="${dist.dir}" items="."/>
  </target>
		
  <!-- Cleans everything -->
  <target name="clean">
    <deltree dir="${build.dir}"/>
    <deltree dir="${dist.dir}"/>
  </target>
	
</project>