Changeset 1690


Ignore:
Timestamp:
10/27/06 12:39:04 (13 years ago)
Author:
curtis
Message:

Add "tools" task for building a JAR file containing many LOCI tools
plus external dependencies in one standalone library.

Location:
trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/build.properties

    r1656 r1690  
    1414docs.dir    = ${build.dir}/docs 
    1515dist.dir    = ${build.dir}/dist 
     16tools.dir   = ${build.dir}/tools 
    1617 
    1718ext.jars = jar/AppleJavaExtensions.jar:\ 
     
    3334copyright = <i>Copyright &#169; ${YEAR} \ 
    3435            Laboratory for Optical and Computational Instrumentation</i> 
     36 
     37### Tools ### 
     38 
     39tools.jar         = loci_tools.jar 
     40tools.main        = loci.ome.notebook.MetadataNotebook 
     41tools.libraries   = bio-formats.jar \ 
     42                    commons-httpclient-2.0-rc2.jar \ 
     43                    commons-logging.jar \ 
     44                    forms-1.0.4.jar \ 
     45                    loci_plugins.jar \ 
     46                    ome-java.jar \ 
     47                    ome-notebook.jar \ 
     48                    poi-loci.jar \ 
     49                    xmlrpc-1.2-b1.jar 
    3550 
    3651### Bio-Formats ### 
     
    8297visbio.linux-dir       = ${dist.dir}/visbio/linux/visbio${visbio.version} 
    8398visbio.nojre-dir       = ${dist.dir}/visbio/nojre/visbio${visbio.version} 
     99 
     100visbio.text-files = *.txt \ 
     101                    *.cpp \ 
     102                    *.m \ 
     103                    plugins/*.txt 
     104 
     105visbio.macosx-exec = visbio \ 
     106                     omeul \ 
     107                     VisBio.app/Contents/MacOS/JavaApplicationStub 
     108visbio.linux-exec  = visbio \ 
     109                     omeul 
    84110 
    85111### LOCI Plugins for ImageJ ### 
     
    148174slim.dist-dir = ${dist.dir}/slim/SlimPlotter 
    149175 
     176slim.exec = slim 
     177 
    150178### LOCI Checkstyle checks ### 
    151179 
  • trunk/build.xml

    r1656 r1690  
    136136    Notes:     Required to compile VisBio on non-Mac OS X machines 
    137137 
     138Ant-Contrib 
     139    JAR file:  ant-contrib-1.0b1.jar 
     140    URL:       http://ant-contrib.sourceforge.net/ 
     141    Notes:     Used by tools target to iterate over JAR files ("for" task) 
     142    License:   Apache 
     143  
    138144Checkstyle 
    139145    JAR file:  checkstyle-all-4.2.jar 
    140146    URL:       http://checkstyle.sourceforge.net/ 
    141     Notes:     Used for style targets to check source code style conventions 
     147    Notes:     Used by style targets to check source code style conventions 
    142148    License:   LGPL 
    143149 
     
    175181    JAR file:  lma.jar 
    176182    URL:       http://users.utu.fi/jaolho/ 
    177     Notes:     Levenberg-Marquardt algorithm for exponential curve fitting 
    178                with Slim Plotter 
     183    Notes:     Levenberg-Marquardt algorithm for exponential curve fitting, 
     184               used by Slim Plotter 
    179185    License:   LGPL 
    180186 
     
    222228  <condition property="isUnix"><os family="unix"/></condition> 
    223229 
     230  <!-- Non-core ant tasks --> 
     231 
    224232  <taskdef resource="checkstyletask.properties" 
    225233    classpath="jar/checkstyle-all-4.2.jar:build/jar/loci-checks.jar"/> 
     234  <taskdef resource="net/sf/antcontrib/antcontrib.properties" 
     235    classpath="jar/ant-contrib-1.0b1.jar"/> 
    226236 
    227237  <!-- Global build targets --> 
     
    235245 
    236246  <target name="style" 
    237     depends="style-formats, style-visbio, style-plugins, style-notebook, style-leica, style-stitcher, style-slim, style-checks" 
     247    depends="style-formats, style-visbio, style-plugins, style-notebook, 
     248      style-leica, style-stitcher, style-slim, style-checks" 
    238249    description="check source code style for LOCI software packages"/> 
    239250 
     
    247258--> 
    248259  <target name="compile" 
    249     depends="compile-formats, compile-visbio, compile-plugins, compile-notebook, compile-leica, compile-stitcher, compile-slim" 
     260    depends="compile-formats, compile-visbio, compile-plugins, 
     261      compile-notebook, compile-leica, compile-stitcher, compile-slim" 
    250262    description="compile classes for LOCI software packages"/> 
    251263 
    252264  <target name="jars" 
    253     depends="jar-formats, jar-visbio, jar-plugins, jar-notebook, jar-leica, jar-stitcher, jar-slim, jar-checks" 
     265    depends="jar-formats, jar-visbio, jar-plugins, jar-notebook, jar-leica, 
     266      jar-stitcher, jar-slim, jar-checks" 
    254267    description="generate JAR files for LOCI software packages"/> 
     268 
     269  <target name="tools" depends="jars" 
     270    description="create JAR file encompassing several LOCI tools"> 
     271    <for list="${tools.libraries}" param="jar" delimiter=" " trim="true"> 
     272      <sequential> 
     273        <unjar src="${jar.dir}/@{jar}" dest="${tools.dir}"> 
     274          <patternset> 
     275            <exclude name="META-INF/**"/> 
     276          </patternset> 
     277        </unjar> 
     278      </sequential> 
     279    </for> 
     280    <jar jarfile="${jar.dir}/${tools.jar}" basedir="${tools.dir}"> 
     281      <manifest> 
     282        <attribute name="Main-Class" value="${tools.main}"/> 
     283      </manifest> 
     284    </jar> 
     285    <delete dir="${tools.dir}"/> 
     286  </target> 
    255287 
    256288  <target name="docs" depends="copy-source" 
     
    379411 
    380412  <target name="dist-visbio" 
    381     depends="dist-visbio-win32, dist-visbio-win32-nojre, dist-visbio-macosx, dist-visbio-linux, dist-visbio-nojre" 
     413    depends="dist-visbio-win32, dist-visbio-win32-nojre, dist-visbio-macosx, 
     414      dist-visbio-linux, dist-visbio-nojre" 
    382415    description="create distribution bundles for VisBio"/> 
    383416 
     
    385418    description="create distribution bundle for VisBio: Windows w/ JRE"> 
    386419    <copy todir="${visbio.win32-dir}" preservelastmodified="true"> 
    387       <fileset dir="dist/visbio/win32"/> 
     420      <fileset dir="${dist.dir}/visbio/win32"/> 
    388421      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/> 
    389422      <fileset dir="${jar.dir}" includes="visbio.jar ${visbio.classpath}"/> 
    390423    </copy> 
    391424    <fixcrlf srcdir="${visbio.win32-dir}" eol="dos" 
    392       includes="*.txt *.cpp *.m plugins/*.txt"/> 
    393     <untar src="dist/jre-win32.tar.gz" dest="${visbio.win32-dir}" 
     425      includes="${visbio.text-files}"/> 
     426    <untar src="${dist.dir}/jre-win32.tar.gz" dest="${visbio.win32-dir}" 
    394427      overwrite="false" compression="gzip"/> 
    395428    <zip destfile="${dist.dir}/visbio${visbio.version}_win32.zip" 
     
    401434    <copy todir="${visbio.win32-nojre-dir}" 
    402435      preservelastmodified="true"> 
    403       <fileset dir="dist/visbio/win32" excludes="launcher.cfg"/> 
    404       <fileset dir="dist/visbio/win32-nojre"/> 
     436      <fileset dir="${dist.dir}/visbio/win32" excludes="launcher.cfg"/> 
     437      <fileset dir="${dist.dir}/visbio/win32-nojre"/> 
    405438      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/> 
    406439      <fileset dir="${jar.dir}" includes="visbio.jar ${visbio.classpath}"/> 
    407440    </copy> 
    408441    <fixcrlf srcdir="${visbio.win32-nojre-dir}" eol="dos" 
    409       includes="*.txt *.cpp *.m plugins/*.txt"/> 
     442      includes="${visbio.text-files}"/> 
    410443    <zip destfile="${dist.dir}/visbio${visbio.version}_win32_nojre.zip" 
    411444      basedir="${dist.dir}/visbio/win32-nojre"/> 
     
    418451    <copy todir="${visbio.macosx-dir}" 
    419452      preservelastmodified="true"> 
    420       <fileset dir="dist/visbio/macosx"/> 
     453      <fileset dir="${dist.dir}/visbio/macosx"/> 
    421454      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/> 
    422455    </copy> 
    423456    <fixcrlf srcdir="${visbio.macosx-dir}" eol="mac" 
    424       includes="*.txt *.cpp *.m plugins/*.txt"/> 
     457      includes="${visbio.text-files}"/> 
    425458    <!-- HACK - copy does not preserve permissions; chmod them back --> 
    426459    <chmod perm="+x"> 
    427       <fileset dir="${visbio.macosx-dir}" 
    428         includes="visbio omeul VisBio.app/Contents/MacOS/JavaApplicationStub"/> 
     460      <fileset dir="${visbio.macosx-dir}" includes="${visbio.macosx-exec}"/> 
    429461    </chmod> 
    430462    <copy todir="${visbio.macosx-dir}/VisBio.app/Contents/Resources/Java"> 
     
    449481    description="create distribution bundle for VisBio: Linux w/ JRE"> 
    450482    <copy todir="${visbio.linux-dir}" preservelastmodified="true"> 
    451       <fileset dir="dist/visbio/linux"/> 
     483      <fileset dir="${dist.dir}/visbio/linux"/> 
    452484      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/> 
    453485      <fileset dir="${jar.dir}" includes="visbio.jar ${visbio.classpath}"/> 
    454486    </copy> 
    455487    <fixcrlf srcdir="${visbio.linux-dir}" eol="unix" 
    456       includes="*.txt *.cpp *.m plugins/*.txt"/> 
     488      includes="${visbio.text-files}"/> 
    457489    <!-- HACK - copy does not preserve permissions; chmod them back --> 
    458490    <chmod perm="+x"> 
    459       <fileset dir="${visbio.linux-dir}" includes="visbio omeul"/> 
     491      <fileset dir="${visbio.linux-dir}" includes="${visbio.linux-exec}"/> 
    460492    </chmod> 
    461493<!-- 
    462     <untar src="dist/jre-linux.tar.gz" dest="${visbio.linux-dir}" 
     494    <untar src="${dist.dir}/jre-linux.tar.gz" dest="${visbio.linux-dir}" 
    463495      overwrite="false" compression="gzip"/> 
    464496--> 
     
    466498    <exec executable="tar"> 
    467499      <arg value="xzf"/> 
    468       <arg value="dist/jre-linux.tar.gz"/> 
     500      <arg value="${dist.dir}/jre-linux.tar.gz"/> 
    469501      <arg value="-C"/> 
    470502      <arg value="${visbio.linux-dir}"/> 
     
    488520    description="create distribution bundle for VisBio: cross-platform"> 
    489521    <copy todir="${visbio.nojre-dir}" preservelastmodified="true"> 
    490       <fileset dir="dist/visbio/linux"/> 
     522      <fileset dir="${dist.dir}/visbio/linux"/> 
    491523      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/> 
    492524      <fileset dir="${jar.dir}" includes="visbio.jar ${visbio.classpath}"/> 
    493525    </copy> 
    494526    <fixcrlf srcdir="${visbio.nojre-dir}" eol="unix" 
    495       includes="*.txt *.cpp *.m plugins/*.txt"/> 
     527      includes="${visbio.text-files}"/> 
    496528    <!-- HACK - copy does not preserve permissions; chmod them back --> 
    497529    <chmod perm="+x"> 
    498       <fileset dir="${visbio.nojre-dir}" includes="visbio omeul"/> 
     530      <fileset dir="${visbio.nojre-dir}" includes="${visbio.linux-exec}"/> 
    499531    </chmod> 
    500532<!-- 
     
    662694    description="create distribution bundle for Slim Plotter"> 
    663695    <copy todir="${slim.dist-dir}" preservelastmodified="true"> 
    664       <fileset dir="dist/slim"/> 
     696      <fileset dir="${dist.dir}/slim"/> 
    665697      <fileset dir="${jar.dir}" includes="SlimPlotter.jar ${slim.classpath}"/> 
    666698    </copy> 
    667699    <!-- HACK - copy does not preserve permissions; chmod them back --> 
    668700    <chmod perm="+x"> 
    669       <fileset dir="${slim.dist-dir}" includes="slim"/> 
     701      <fileset dir="${slim.dist-dir}" includes="${slim.exec}"/> 
    670702    </chmod> 
    671703<!-- 
Note: See TracChangeset for help on using the changeset viewer.