Changeset 1289


Ignore:
Timestamp:
08/17/06 14:58:31 (14 years ago)
Author:
curtis
Message:

Migrate VisBio distribution build system into build.xml.

Location:
trunk
Files:
36 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/build.xml

    r1284 r1289  
    44Master ant build file for all Java software projects at LOCI. 
    55Download Apache Ant from http://ant.apache.org/. 
    6 Type "ant -projecthelp" for a list of targets. 
     6Type "ant -p" for a list of targets. 
    77 
    88=============================================================================== 
     
    3232                   xmlrpc-1.2-b1.jar (ome-java.jar) 
    3333    Targets:       jar-visbio 
    34                    visad 
    3534                   dist-visbio 
    3635 
     
    3938    Folders:       loci/plugins 
    4039                   loci/plugins/* 
    41                    loci/ome/viewer/* (temporary) 
     40                   loci/ome/viewer (temporary) 
    4241    Main class:    loci.plugins.About 
    4342    IJ plugins:    loci.plugins.browser.LociDataBrowser 
     
    160159  <property name="dest.dir" value="${build.dir}/src"/> 
    161160  <property name="classes.dir" value="${build.dir}/classes"/> 
    162   <property name="jar.dir"  value="${build.dir}/jar"/> 
     161  <property name="jar.dir" value="${build.dir}/jar"/> 
    163162  <property name="docs.dir" value="${build.dir}/docs"/> 
    164163  <property name="dist.dir" value="${build.dir}/dist"/> 
    165164 
    166   <!-- External JAR dependencies --> 
    167  
    168   <property name="ext.jars" value="jar/AppleJavaExtensions.jar:jar/commons-httpclient-2.0-rc2.jar:jar/commons-logging.jar:jar/forms-1.0.4.jar:jar/ij.jar:jar/looks-1.2.2.jar:jar/ome-java.jar:jar/xmlrpc-1.2-b1.jar"/> 
    169  
    170165  <!-- Global build targets --> 
     166 
     167  <property name="ext.jars" value="jar/AppleJavaExtensions.jar:jar/commons-httpclient-2.0-rc2.jar:jar/commons-logging.jar:jar/forms-1.0.4.jar:jar/ij.jar:jar/looks-1.2.2.jar:jar/ome-java.jar:jar/visad.jar:jar/xmlrpc-1.2-b1.jar"/> 
    171168 
    172169  <target name="init"> 
     
    190187  <target name="docs" depends="init" 
    191188    description="generate Javadocs for LOCI software packages"> 
    192     <mkdir dir="${docs.dir}"/> 
    193189    <javadoc sourcepath="${dest.dir}" destdir="${docs.dir}/api" 
    194190      author="true" version="true" use="true" windowtitle="LOCI Software API"> 
     
    196192      <doctitle><![CDATA[<h1>LOCI Software</h1>]]></doctitle> 
    197193      <bottom><![CDATA[<i>Copyright &#169; ${YEAR} Laboratory for Optical and Computational Instrumentation</i>]]></bottom> 
    198       <tag name="todo" scope="all" description="To do:"/> 
    199194      <link href="http://java.sun.com/j2se/1.4.2/docs/api/"/> 
    200195    </javadoc> 
     
    212207 
    213208  <target name="copy-source" depends="init"> 
    214     <mkdir dir="${dest.dir}"/> 
    215209    <!-- copy binary files without filtering --> 
    216210    <copy todir="${dest.dir}" preservelastmodified="true"> 
     
    226220  <target name="copy-jars"> 
    227221    <!-- copy needed external JARs into build jars folder --> 
    228     <mkdir dir="${jar.dir}"/> 
    229222    <copy todir="${jar.dir}" preservelastmodified="true"> 
    230223      <fileset dir="jar"/> 
     
    239232  <target name="jar-formats" depends="compile" 
    240233    description="generate Bio-Formats JAR file"> 
    241     <mkdir dir="${jar.dir}"/> 
    242234    <copy todir="${classes.dir}" preservelastmodified="true"> 
    243235      <fileset dir="${src.dir}" includes="${formats.resources}"/> 
    244236    </copy> 
     237    <mkdir dir="${jar.dir}"/> 
    245238    <jar jarfile="${jar.dir}/bio-formats.jar" basedir="${classes.dir}" 
    246239      includes="${formats.files}"> 
     
    260253    depends="compile, copy-jars, jar-formats" 
    261254    description="generate VisBio JAR file"> 
    262     <mkdir dir="${jar.dir}"/> 
    263255    <copy todir="${classes.dir}" preservelastmodified="true"> 
    264256      <fileset dir="${src.dir}" includes="${visbio.resources}"/> 
     
    273265  </target> 
    274266 
    275   <target name="dist-visbio" depends="jar-visbio, jar-formats" 
    276     description="generate VisBio's platform-specific distribution bundles"> 
    277     <!-- TODO --> 
     267  <property name="visbio.dist-files" value="bsd-forms.txt bsd-looks.txt gpl-visbio.txt omeul.txt whatsnew.txt *.cpp *.m"/> 
     268 
     269  <target name="dist-visbio" depends="dist-visbio-win32, dist-visbio-win32-nojre, dist-visbio-macosx, dist-visbio-linux, dist-visbio-nojre"/> 
     270 
     271  <property name="visbio.win32-dir" value="${dist.dir}/visbio/win32/VisBio"/> 
     272 
     273  <target name="dist-visbio-win32" depends="jar-visbio, jar-formats"> 
     274    <copy todir="${visbio.win32-dir}" preservelastmodified="true"> 
     275      <fileset dir="dist/visbio/win32"/> 
     276      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/> 
     277      <fileset dir="${jar.dir}" includes="visbio.jar ${visbio.classpath}"/> 
     278    </copy> 
     279    <fixcrlf srcdir="${visbio.win32-dir}" eol="dos" 
     280      includes="*.txt *.cpp *.m plugins/*.txt"/> 
     281    <untar src="dist/jre-win32.tar.gz" dest="${visbio.win32-dir}" 
     282      overwrite="false" compression="gzip"/> 
     283    <zip destfile="${dist.dir}/visbio${visbio.version}_win32.zip" 
     284      basedir="${dist.dir}/visbio/win32"/> 
     285  </target> 
     286 
     287  <property name="visbio.win32-nojre-dir" 
     288    value="${dist.dir}/visbio/win32-nojre/VisBio"/> 
     289 
     290  <target name="dist-visbio-win32-nojre" depends="jar-visbio, jar-formats"> 
     291    <copy todir="${visbio.win32-nojre-dir}" 
     292      preservelastmodified="true"> 
     293      <fileset dir="dist/visbio/win32" excludes="launcher.cfg"/> 
     294      <fileset dir="dist/visbio/win32-nojre"/> 
     295      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/> 
     296      <fileset dir="${jar.dir}" includes="visbio.jar ${visbio.classpath}"/> 
     297    </copy> 
     298    <fixcrlf srcdir="${visbio.win32-nojre-dir}" eol="dos" 
     299      includes="*.txt *.cpp *.m plugins/*.txt"/> 
     300    <zip destfile="${dist.dir}/visbio${visbio.version}_win32_nojre.zip" 
     301      basedir="${dist.dir}/visbio/win32-nojre"/> 
     302  </target> 
     303 
     304  <property name="visbio.macosx-dir" value="${dist.dir}/visbio/macosx/VisBio"/> 
     305 
     306  <target name="dist-visbio-macosx" depends="jar-visbio, jar-formats"> 
     307    <copy todir="${visbio.macosx-dir}" 
     308      preservelastmodified="true"> 
     309      <fileset dir="dist/visbio/macosx"/> 
     310      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/> 
     311    </copy> 
     312    <fixcrlf srcdir="${visbio.macosx-dir}" eol="mac" 
     313      includes="*.txt *.cpp *.m plugins/*.txt"/> 
     314    <!-- HACK - copy does not preserve permissions; chmod them back --> 
     315    <chmod perm="ugo+x"> 
     316      <fileset dir="${visbio.macosx-dir}" 
     317        includes="visbio omeul VisBio.app/Contents/MacOS/JavaApplicationStub"/> 
     318    </chmod> 
     319    <copy todir="${visbio.macosx-dir}/VisBio.app/Contents/Resources/Java"> 
     320      <fileset dir="${jar.dir}" includes="visbio.jar ${visbio.classpath}"/> 
     321    </copy> 
     322    <tar destfile="${dist.dir}/visbio${visbio.version}_macosx.tar.gz" 
     323      basedir="${dist.dir}/visbio/macosx" compression="gzip"/> 
     324  </target> 
     325 
     326  <property name="visbio.linux-dir" 
     327    value="${dist.dir}/visbio/linux/visbio${visbio.version}"/> 
     328 
     329  <target name="dist-visbio-linux" depends="jar-visbio, jar-formats"> 
     330    <copy todir="${visbio.linux-dir}" preservelastmodified="true"> 
     331      <fileset dir="dist/visbio/linux"/> 
     332      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/> 
     333      <fileset dir="${jar.dir}" includes="visbio.jar ${visbio.classpath}"/> 
     334    </copy> 
     335    <fixcrlf srcdir="${visbio.linux-dir}" eol="unix" 
     336      includes="*.txt *.cpp *.m plugins/*.txt"/> 
     337    <!-- HACK - copy does not preserve permissions; chmod them back --> 
     338    <chmod perm="ugo+x"> 
     339      <fileset dir="${visbio.linux-dir}" includes="visbio omeul"/> 
     340    </chmod> 
     341<!-- 
     342    <untar src="dist/jre-linux.tar.gz" dest="${visbio.linux-dir}" 
     343      overwrite="false" compression="gzip"/> 
     344--> 
     345    <!-- HACK - untar does not restore permissions; use exec instead --> 
     346    <exec executable="tar"> 
     347      <arg line="xzf dist/jre-linux.tar.gz -C ${visbio.linux-dir}"/> 
     348    </exec> 
     349    <tar destfile="${dist.dir}/visbio${visbio.version}_linux.tar.gz" 
     350      basedir="${dist.dir}/visbio/linux" compression="gzip"/> 
     351  </target> 
     352 
     353  <property name="visbio.nojre-dir" 
     354    value="${dist.dir}/visbio/nojre/visbio${visbio.version}"/> 
     355 
     356  <target name="dist-visbio-nojre" depends="jar-visbio, jar-formats"> 
     357    <copy todir="${visbio.nojre-dir}" preservelastmodified="true"> 
     358      <fileset dir="dist/visbio/linux"/> 
     359      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/> 
     360      <fileset dir="${jar.dir}" includes="visbio.jar ${visbio.classpath}"/> 
     361    </copy> 
     362    <fixcrlf srcdir="${visbio.nojre-dir}" eol="unix" 
     363      includes="*.txt *.cpp *.m plugins/*.txt"/> 
     364    <!-- HACK - copy does not preserve permissions; chmod them back --> 
     365    <chmod perm="ugo+x"> 
     366      <fileset dir="${visbio.nojre-dir}" includes="visbio omeul"/> 
     367    </chmod> 
     368    <tar destfile="${dist.dir}/visbio${visbio.version}.tar.gz" 
     369      basedir="${dist.dir}/visbio/nojre" compression="gzip"/> 
    278370  </target> 
    279371 
    280372  <!-- LOCI Plugins for ImageJ --> 
     373 
     374  <property name="plugins.files" value="loci/plugins/** loci/ome/viewer/**"/> 
    281375 
    282376  <target name="jar-plugins" 
    283377    depends="compile, copy-jars, jar-formats" 
    284378    description="generate LOCI Plugins for ImageJ JAR file"> 
    285     <mkdir dir="${jar.dir}"/> 
    286     <!-- TODO --> 
     379    <jar jarfile="${jar.dir}/loci_plugins.jar" basedir="${classes.dir}" 
     380      includes="${plugins.files}"> 
     381      <manifest> 
     382        <attribute name="Main-Class" value="loci.plugins.About"/> 
     383      </manifest> 
     384    </jar> 
    287385  </target> 
    288386 
    289387  <!-- OME Metadata Notebook --> 
     388 
     389  <property name="notebook.classpath" value="bio-formats.jar commons-httpclient-2.0-rc2.jar commons-logging.jar forms-1.0.4.jar ome-java.jar xmlrpc-1.2-b1.jar"/> 
     390  <property name="notebook.files" 
     391    value="loci/ome/notebook/** loci/ome/viewer/**"/> 
     392  <property name="notebook.resources" value="loci/ome/notebook/Template.xml loci/ome/notebook/Icons/* loci/ome/notebook/TypeDefs/*"/> 
    290393 
    291394  <target name="jar-notebook" 
    292395    depends="compile, copy-jars, jar-formats" 
    293396    description="generate OME Metadata Notebook JAR file"> 
    294     <mkdir dir="${jar.dir}"/> 
    295     <!-- TODO --> 
     397    <copy todir="${classes.dir}" preservelastmodified="true"> 
     398      <fileset dir="${src.dir}" includes="${notebook.resources}"/> 
     399    </copy> 
     400    <jar jarfile="${jar.dir}/ome-notebook.jar" basedir="${classes.dir}" 
     401      includes="${notebook.files}"> 
     402      <manifest> 
     403        <attribute name="Main-Class" 
     404          value="loci.ome.notebook.MetadataNotebook"/> 
     405        <attribute name="Class-Path" value="${notebook.classpath}"/> 
     406      </manifest> 
     407    </jar> 
    296408  </target> 
    297409 
     
    303415  <target name="jar-leica" depends="compile, copy-jars, jar-formats" 
    304416    description="generate Leica Converter JAR file"> 
    305     <mkdir dir="${jar.dir}"/> 
    306417    <jar jarfile="${jar.dir}/LeicaConverter.jar" basedir="${classes.dir}" 
    307418      includes="${leica.files}"> 
     
    335446  <target name="jar-slim" depends="compile, copy-jars" 
    336447    description="generate Slim Plotter JAR file"> 
    337     <mkdir dir="${jar.dir}"/> 
    338448    <jar jarfile="${jar.dir}/SlimPlotter.jar" basedir="${classes.dir}" 
    339449      includes="${slim.files}"> 
Note: See TracChangeset for help on using the changeset viewer.