source: tags/loci-tools-2008-Feb-12/build.xml @ 3669

Revision 3669, 37.6 KB checked in by curtis, 12 years ago (diff)

2008 Feb 12 release of LOCI Tools

Line 
1<!--
2build.xml
3
4Master ant build file for all Java software projects at LOCI.
5Download Apache Ant from http://ant.apache.org/.
6Type "ant -p" for a list of targets.
7
8===============================================================================
9This build file handles the following projects:
10
11Bio-Formats
12    JAR file:      bio-formats.jar
13    Folders:       loci/formats
14                   loci/formats/* (except auto)
15    Main class:    loci.formats.ImageViewer
16    Dependencies:  bufr-1.1.00.jar (reflected)
17                   clibwrapper_jiio.jar (reflected)
18                   grib-5.1.03.jar (reflected)
19                   jai_imageio.jar (reflected)
20                   mdbtools-java.jar (reflected)
21                   netcdf-4.0.jar (reflected)
22                   ome-java.jar (reflected, except in loci/formats/ome)
23                   omero-client.jar (reflected)
24                   omero-common.jar (reflected)
25                   poi-loci.jar (reflected)
26                   slf4j-jdk14.jar (reflected)
27    Targets:       style-formats
28                   compile-formats
29                   jar-formats
30    License:       LGPL
31
32VisBio
33    JAR file:      visbio.jar
34    Folders:       loci/visbio
35                   loci/visbio/*
36    Main class:    loci.visbio.VisBio
37    Dependencies:  bio-formats.jar
38                   bufr-1.1.00.jar (bio-formats.jar)
39                   clibwrapper_jiio.jar (bio-formats.jar)
40                   commons-httpclient-2.0-rc2.jar (ome-java.jar)
41                   commons-logging.jar (ome-java.jar)
42                   forms-1.0.4.jar
43                   grib-5.1.03.jar (bio-formats.jar)
44                   ij.jar
45                   jai_imageio.jar (bio-formats.jar)
46                   looks-1.2.2.jar
47                   mdbtools-java.jar (bio-formats.jar)
48                   netcdf-4.0.jar (bio-formats.jar)
49                   ome-java.jar
50                   omero-client.jar (bio-formats.jar)
51                   omero-common.jar (bio-formats.jar)
52                   poi-loci.jar (bio-formats.jar)
53                   slf4j-jdk14.jar (bio-formats.jar)
54                   visad-lite.jar
55                   xmlrpc-1.2-b1.jar (ome-java.jar)
56    Targets:       style-visbio
57                   compile-visbio
58                   jar-visbio
59                   source-visbio
60                   docs-visbio
61                   dist-visbio
62    License:       GPL
63
64LOCI Plugins for ImageJ
65    JAR file:      loci_plugins.jar
66    Folders:       loci/plugins
67                   loci/ome/upload
68                   loci/ome/util
69    Main class:    loci.plugins.About
70    IJ plugins:    loci.plugins.Colorizer
71                   loci.plugins.LociExporter
72                   loci.plugins.LociFunctions
73                   loci.plugins.LociImporter
74                   loci.plugins.LociUploader
75                   loci.plugins.Slicer
76    Dependencies:  bio-formats.jar
77                   bufr-1.1.00.jar (bio-formats.jar)
78                   clibwrapper_jiio.jar (bio-formats.jar)
79                   commons-httpclient-2.0-rc2.jar (ome-java.jar)
80                   commons-logging.jar (ome-java.jar)
81                   grib-5.1.03.jar (bio-formats.jar)
82                   jai_imageio.jar (bio-formats.jar)
83                   mdbtools-java.jar (bio-formats.jar)
84                   netcdf-4.0.jar (bio-formats.jar)
85                   ome-java.jar (bio-formats.jar)
86                   omero-client.jar (bio-formats.jar)
87                   omero-common.jar (bio-formats.jar)
88                   poi-loci.jar (bio-formats.jar)
89                   slf4j-jdk14.jar (bio-formats.jar)
90                   xmlrpc-1.2-b1.jar (ome-java.jar)
91    Targets:       style-plugins
92                   compile-plugins
93                   jar-plugins
94    License:       LGPL
95
96OME Notes
97    JAR file:      ome-notes.jar
98    Folder:        loci/ome/notes
99    Main class:    loci.ome.notes.Notes
100    Dependencies:  bio-formats.jar
101                   bufr-1.1.00.jar (bio-formats.jar)
102                   clibwrapper_jiio.jar (bio-formats.jar)
103                   commons-httpclient-2.0-rc2.jar (ome-java.jar)
104                   commons-logging.jar (ome-java.jar)
105                   forms-1.0.4.jar
106                   grib-5.1.03.jar (bio-formats.jar)
107                   jai_imageio.jar (bio-formats.jar)
108                   mdbtools-java.jar (bio-formats.jar)
109                   netcdf-4.0.jar (bio-formats.jar)
110                   ome-java.jar
111                   omero-client.jar (bio-formats.jar)
112                   omero-common.jar (bio-formats.jar)
113                   poi-loci.jar (bio-formats.jar)
114                   slf4j-jdk14.jar (bio-formats.jar)
115                   xmlrpc-1.2-b1.jar (ome-java.jar)
116    Targets:       style-notes
117                   compile-notes
118                   jar-notes
119    License:       LGPL
120
121Slim Plotter
122    JAR file:      SlimPlotter.jar
123    Folders:       loci/apps/slim
124                   some loci/visbio
125    Main class:    loci.apps.slim.SlimPlotter
126    Dependencies:  bio-formats.jar
127                   lma.jar
128                   visad-lite.jar
129    Targets:       style-slim
130                   compile-slim
131                   jar-slim
132                   dist-slim
133    License:       Public domain
134
135OME Metadata Editor
136    JAR file:      ome-editor.jar
137    Folders:       loci/ome/editor
138                   loci/ome/viewer
139    Main class:    loci.ome.editor.MetadataEditor
140    Dependencies:  bio-formats.jar
141                   bufr-1.1.00.jar (bio-formats.jar)
142                   clibwrapper_jiio.jar (bio-formats.jar)
143                   commons-httpclient-2.0-rc2.jar (ome-java.jar)
144                   commons-logging.jar (ome-java.jar)
145                   forms-1.0.4.jar
146                   grib-5.1.03.jar (bio-formats.jar)
147                   jai_imageio.jar (bio-formats.jar)
148                   mdbtools-java.jar (bio-formats.jar)
149                   netcdf-4.0.jar (bio-formats.jar)
150                   ome-java.jar
151                   poi-loci.jar (bio-formats.jar)
152                   slf4j-jdk14.jar (bio-formats.jar)
153                   xmlrpc-1.2-b1.jar (ome-java.jar)
154    Targets:       style-editor
155                   compile-editor
156                   jar-editor
157    License:       LGPL
158
159LOCI Checkstyle checks
160    JAR file:      loci-checks.jar
161    Folders:       loci/checks
162    Main class:    loci.checks.About
163    Dependencies:  checkstyle-all-4.2.jar
164    Targets:       style-checks
165                   compile-checks
166                   jar-checks
167    License:       Public domain
168
169===============================================================================
170The following external dependencies (in the jar folder) may be required:
171
172Apple eAWT stubs
173    JAR file:  AppleJavaExtensions.jar
174    URL:       http://developer.apple.com/samplecode/AppleJavaExtensions/
175    Notes:     required to compile VisBio on non-Mac OS X machines
176
177Ant-Contrib
178    JAR file:  ant-contrib-1.0b1.jar
179    URL:       http://ant-contrib.sourceforge.net/
180    Notes:     used by tools target to iterate over JAR files ("for" task)
181    License:   Apache
182
183Checkstyle
184    JAR file:  checkstyle-all-4.2.jar
185    URL:       http://checkstyle.sourceforge.net/
186    Notes:     used by style targets to check source code style conventions
187    License:   LGPL
188
189Apache Jakarta Commons HttpClient
190    JAR file:  commons-httpclient-2.0-rc2.jar
191    URL:       http://jakarta.apache.org/commons/httpclient/
192    Notes:     required for OME Java to communicate with OME servers
193    License:   Apache
194
195Apache Jakarta Commons Logging
196    JAR file:  commons-logging.jar
197    URL:       http://jakarta.apache.org/commons/logging/
198    Notes:     used by OME Java
199    License:   Apache
200
201JGoodies Forms
202    JAR file:  forms-1.0.4.jar
203    URL:       http://www.jgoodies.com/freeware/forms/index.html
204    Notes:     used for layout by VisBio, 4D Data Browser and OME Notes
205    License:   BSD
206
207ImageJ
208    JAR file:  ij.jar
209    URL:       http://rsb.info.nih.gov/ij/
210    Notes:     used by LOCI plugins for ImageJ;
211               bundled with VisBio to achieve ImageJ interconnectivity
212    License:   Public domain
213
214Java Advanced Imaging Image I/O Tools
215    JAR files: jai_imageio.jar, clibwrapper_jiio.jar
216    URL:       https://jai-imageio.dev.java.net/
217    Notes:     used by Bio-Formats via reflection for JPEG2000 support
218               (ND2, JP2) and lossless JPEG decompression (DICOM)
219    License:   BSD
220
221JUnit
222    JAR file:  junit.jar
223    URL:       http://www.junit.org/
224    Notes:     unit testing framework used for a few VisBio unit tests
225    License:   Common Public License
226
227JGoodies Looks
228    JAR file:  looks-1.2.2.jar
229    URL:       http://www.jgoodies.com/freeware/looks/index.html
230    Notes:     used for a nicer Look & Feel by VisBio and OME Metadata Editor
231    License:   BSD
232
233MDB Tools (Java port)
234    JAR file:  mdbtools-java.jar
235    URLs:      http://mdbtools.sourceforge.net/
236               http://sourceforge.net/forum/message.php?msg_id=2550619
237    Notes:     used by Bio-Formats for Zeiss LSM metadata in MDB database files
238    License:   LGPL
239
240L-M Fit
241    JAR file:  lma.jar
242    URL:       http://users.utu.fi/jaolho/
243    Notes:     Levenberg-Marquardt algorithm for exponential curve fitting,
244               used by Slim Plotter
245    License:   LGPL
246
247NetCDF
248    JAR files: netcdf-4.0.jar, bufr-1.1.00.jar, grib-5.1.03.jar, slf4j-jdk14.jar
249    URL:       http://www.unidata.ucar.edu/software/netcdf-java/
250    Notes:     used by Bio-Formats via reflection for HDF support (Imaris 5.5)
251    License:   LGPL
252
253OME Java
254    JAR file:  ome-java.jar
255    URL:       http://openmicroscopy.org/api/java/
256    Notes:     used by VisBio and the OME upload and download plugins for
257               ImageJ to connect to OME;
258               used by Bio-Formats and OME Notes to work with OME-XML
259    License:   LGPL
260
261OMERO Common
262    JAR file:  omero-common.jar
263    URL:       http://trac.openmicroscopy.org.uk/omero/wiki/MilestoneDownloads
264    Notes:     used by VisBio and Bio-Formats to connect to OMERO
265    Licence:   LGPL
266
267OMERO Client
268    JAR file:  omero-client.jar
269    URL:       http://trac.openmicroscopy.org.uk/omero/wiki/MilestoneDownloads
270    Notes:     used by VisBio and Bio-Formats to connect to OMERO
271    Licence:   LGPL
272
273Apache Jakarta POI
274    JAR file:  poi-loci.jar
275    URL:       http://jakarta.apache.org/poi/
276    Notes:     based on poi-2.5.1-final-20040804.jar, with bugfixes for OLE v2
277               and memory efficiency improvements;
278               used by Bio-Formats via reflection for OLE support
279               (CXD, IPW, OIB, ZVI);
280               used by VisBio overlays logic for XLS export feature
281    License:   Apache
282
283Skin Look and Feel
284    JAR file:  skinlf.jar
285    URL:       http://skinlf.l2fprod.com/
286    Notes:     not used (may be used in the future for flexible skinning)
287    License:   Custom (BSD-like)
288
289TestNG
290    JAR file:  testng-5.6-jdk14.jar
291    URL:       http://testng.org/
292    Notes:     testing framework used for LOCI software automated test suite
293    License:   Apache
294
295VisAD
296    JAR file:  visad-lite.jar
297    URL:       http://www.ssec.wisc.edu/~billh/visad.html
298    Notes:     stripped down VisAD library used by VisBio and Slim Plotter
299               for interactive visualization
300    License:   LGPL
301
302Apache XML-RPC
303    JAR file:  xmlrpc-1.2-b1.jar
304    URL:       http://ws.apache.org/xmlrpc/
305    Notes:     required for OME Java to communicate with OME servers
306    License:   Apache
307-->
308
309<project name="LOCI Software" default="jars" basedir=".">
310  <description>
311    Master build file for all Java software projects at LOCI
312  </description>
313
314  <property file="build.properties"/>
315  <property file="${user.home}/.ant-global.properties"/>
316
317  <condition property="isUnix"><os family="unix"/></condition>
318
319  <!-- Non-core ant tasks -->
320
321  <path id="cp-testng">
322    <pathelement location="jar/testng-5.6-jdk14.jar"/>
323    <pathelement location="${classes.dir}"/>
324  </path>
325
326  <taskdef name="testng" classpathref="cp-testng"
327    classname="org.testng.TestNGAntTask"/>
328
329  <!-- NB - We do not reference build/jar/loci-checks.jar directly, as doing so
330    causes loci-checks.jar to be locked by some file systems (Windows in
331    particular), which causes the clean and clean-jars targets to fail. -->
332  <taskdef resource="checkstyletask.properties"
333    classpath="jar/checkstyle-all-4.2.jar:jar/loci-checks.jar"/>
334
335  <taskdef resource="net/sf/antcontrib/antcontrib.properties"
336    classpath="jar/ant-contrib-1.0b1.jar"/>
337  <!-- HACK - some environments do not install the antcontrib tasks properly
338    from antcontrib.properties above; also load them from antlib.xml -->
339  <taskdef resource="net/sf/antcontrib/antlib.xml"
340    classpath="jar/ant-contrib-1.0b1.jar"/>
341
342  <!-- Global build targets -->
343
344  <target name="init">
345    <tstamp>
346      <format property="DATE" pattern="d MMMMM yyyy"/>
347      <format property="YEAR" pattern="yyyy"/>
348    </tstamp>
349  </target>
350
351  <target name="style"
352    depends="style-formats, style-visbio, style-plugins, style-notes,
353      style-editor, style-slim, style-checks"
354    description="check source code style for LOCI software packages"/>
355
356<!--
357  <target name="compile" depends="copy-source"
358    description="compile classes for LOCI software packages">
359    <mkdir dir="${classes.dir}"/>
360    <javac srcdir="${dest.dir}" destdir="${classes.dir}" debug="true"
361      classpath="${ext.jars}" deprecation="true" source="1.4" target="1.4"/>
362  </target>
363-->
364  <target name="compile"
365    depends="compile-formats, compile-visbio, compile-plugins, compile-notes,
366      compile-editor, compile-slim, compile-tests, compile-checks"
367    description="compile classes for LOCI software packages"/>
368
369  <target name="jars"
370    depends="jar-formats, jar-visbio, jar-plugins, jar-notes,
371      jar-editor, jar-slim, jar-checks"
372    description="generate JAR files for LOCI software packages"/>
373
374  <target name="tools" depends="jars"
375    description="create JAR file encompassing several LOCI tools">
376    <for list="${tools.libraries}" param="jar" delimiter=" " trim="true">
377      <sequential>
378        <available file="${jar.dir}/@{jar}" property="@{jar}.present"/>
379        <if>
380          <equals arg1="${@{jar}.present}" arg2="true" />
381          <then>
382            <unjar src="${jar.dir}/@{jar}" dest="${tools.dir}">
383              <patternset>
384                <exclude name="META-INF/**"/>
385              </patternset>
386            </unjar>
387          </then>
388        </if>
389      </sequential>
390    </for>
391    <jar jarfile="${jar.dir}/${tools.jar}" basedir="${tools.dir}">
392      <manifest>
393        <attribute name="Main-Class" value="${tools.main}"/>
394      </manifest>
395    </jar>
396    <delete dir="${tools.dir}"/>
397  </target>
398
399  <target name="docs" depends="copy-source"
400    description="generate javadocs for LOCI software packages">
401    <javadoc sourcepath="${dest.dir}" destdir="${docs.dir}/api"
402      classpath="${ext.jars}" author="true" version="true" use="true"
403      nodeprecated="true" windowtitle="LOCI Software API">
404      <packageset dir="${dest.dir}"/>
405      <doctitle><![CDATA[<h1>LOCI Software</h1>]]></doctitle>
406      <bottom><![CDATA[${copyright.begin} ${YEAR} ${copyright.end}]]></bottom>
407      <link href="http://java.sun.com/j2se/1.4.2/docs/api/"/>
408      <link href="http://www.ssec.wisc.edu/~dglo/docs/"/>
409      <link href="http://rsbweb.nih.gov/ij/developer/api/"/>
410      <link href="http://www.jdocs.com/formlayout/1.0.4/api/"/>
411      <link href="http://www.jdocs.com/looks/1.2.2/api/"/>
412    </javadoc>
413  </target>
414
415  <target name="clean" description="remove all build files">
416    <delete dir="${build.dir}"/>
417  </target>
418
419  <target name="clean-classes" description="remove classes from build folder">
420    <delete dir="${classes.dir}"/>
421  </target>
422
423  <target name="clean-dist"
424    description="remove distribution bundles from build folder">
425    <delete dir="${dist.dir}"/>
426  </target>
427
428  <target name="clean-docs" description="remove javadocs from build folder">
429    <delete dir="${docs.dir}"/>
430  </target>
431
432  <target name="clean-jars" description="remove JAR files from build folder">
433    <delete dir="${jar.dir}"/>
434  </target>
435
436  <target name="clean-src" description="remove source files from build folder">
437    <delete dir="${dest.dir}"/>
438  </target>
439
440  <target name="dev-compile" description="compile classes in-place (no copy)">
441    <javac srcdir="." destdir="." debug="true" classpath="${ext.jars}"
442      deprecation="true" source="1.4" target="1.4">
443      <include name="loci/**"/>
444    </javac>
445  </target>
446
447  <target name="dev-clean" description="remove classes in-place (no copy)">
448    <delete>
449      <fileset dir="." includes="loci/**/*.class"/>
450    </delete>
451  </target>
452
453  <target name="test-all" depends="copy-source, compile-tests"
454    description="run all automated tests">
455    <testng classpathref="cp-testng" sourceDir="${dest.dir}"
456      annotations="Javadoc" groups="all" testname="All tests"
457      suitename="LOCI software test suite">
458      <classfileset dir="${classes.dir}" includes="${testng.classes}"/>
459      <sysproperty key="testng.directory" value="${testng.directory}"/>
460      <sysproperty key="testng.multiplier" value="${testng.multiplier}"/>
461      <jvmarg value="-mx${testng.memory}"/>
462    </testng>
463  </target>
464
465  <target name="test-config" depends="copy-source, compile-tests"
466    description="generate config files for automated test suite">
467    <testng classpathref="cp-testng" sourceDir="${dest.dir}"
468      annotations="Javadoc" groups="config" testname="Config generation"
469      suitename="LOCI software test suite">
470      <classfileset dir="${classes.dir}" includes="${testng.classes}"/>
471      <sysproperty key="testng.directory" value="${testng.directory}"/>
472      <sysproperty key="testng.multiplier" value="${testng.multiplier}"/>
473      <jvmarg value="-mx${testng.memory}"/>
474    </testng>
475  </target>
476
477  <target name="test-fast" depends="copy-source, compile-tests"
478    description="run automated tests in group 'fast'">
479    <testng classpathref="cp-testng" sourceDir="${dest.dir}"
480      annotations="Javadoc" groups="fast" testname="Fast tests"
481      suitename="LOCI software test suite">
482      <classfileset dir="${classes.dir}" includes="${testng.classes}"/>
483      <sysproperty key="testng.directory" value="${testng.directory}"/>
484      <sysproperty key="testng.multiplier" value="${testng.multiplier}"/>
485      <jvmarg value="-Xmx${testng.memory}"/>
486    </testng>
487  </target>
488
489  <target name="test-pixels" depends="copy-source, compile-tests"
490    description="run automated tests in group 'pixels'">
491    <testng classpathref="cp-testng" sourceDir="${dest.dir}"
492      annotations="Javadoc" groups="pixels" testname="Pixels tests"
493      suitename="LOCI software test suite">
494      <classfileset dir="${classes.dir}" includes="${testng.classes}"/>
495      <sysproperty key="testng.directory" value="${testng.directory}"/>
496      <sysproperty key="testng.multiplier" value="${testng.multiplier}"/>
497      <jvmarg value="-Xmx${testng.memory}"/>
498    </testng>
499  </target>
500
501  <target name="test-xml" depends="copy-source, compile-tests"
502    description="run automated tests in group 'xml'">
503    <testng classpathref="cp-testng" sourceDir="${dest.dir}"
504      annotations="Javadoc" groups="xml" testname="XML tests"
505      suitename="LOCI software test suite">
506      <classfileset dir="${classes.dir}" includes="${testng.classes}"/>
507      <sysproperty key="testng.directory" value="${testng.directory}"/>
508      <sysproperty key="testng.multiplier" value="${testng.multiplier}"/>
509      <jvmarg value="-Xmx${testng.memory}"/>
510    </testng>
511  </target>
512
513  <!-- Internal build targets -->
514
515  <target name="copy-source" depends="init">
516    <!-- copy binary files without filtering -->
517    <copy todir="${dest.dir}" preservelastmodified="true">
518      <fileset dir="${src.dir}" includes="loci/**"
519        excludes="**/*.java **/*.config **/*.txt ${ignore.source}"/>
520    </copy>
521    <!-- copy source files with filtering -->
522    <filter token="date" value="${DATE}"/>
523    <filter token="year" value="${YEAR}"/>
524    <filter token="visbio.version" value="${visbio.version}"/>
525    <copy todir="${dest.dir}" filtering="true" preservelastmodified="true">
526      <fileset dir="${src.dir}" includes="loci/**"
527        excludes="${ignore.source}"/>
528    </copy>
529  </target>
530
531  <target name="copy-jars">
532    <!-- copy needed external JARs into build jars folder -->
533    <copy todir="${jar.dir}" preservelastmodified="true">
534      <fileset dir="jar"/>
535    </copy>
536  </target>
537
538  <!-- Bio-Formats -->
539
540  <target name="style-formats" depends="copy-source, jar-checks"
541    description="check source code style for Bio-Formats">
542    <checkstyle config="checkstyle.xml" failOnViolation="false">
543      <fileset dir="${dest.dir}" includes="${formats.source}"/>
544    </checkstyle>
545  </target>
546
547  <target name="compile-formats" depends="copy-source"
548    description="compile classes for Bio-Formats">
549    <mkdir dir="${classes.dir}"/>
550    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
551      includes="${formats.source}" excludes="${formats.exclude}"
552      classpath="${ext.jars}"
553      debug="true" deprecation="true" source="1.4" target="1.4"/>
554  </target>
555
556  <target name="jar-formats" depends="compile-formats, copy-jars"
557    description="generate JAR file for Bio-Formats">
558    <copy todir="${classes.dir}" preservelastmodified="true">
559      <fileset dir="${src.dir}" includes="${formats.resources}"/>
560    </copy>
561    <mkdir dir="${jar.dir}"/>
562    <jar jarfile="${jar.dir}/${formats.jar}" basedir="${classes.dir}"
563      includes="${formats.files}">
564      <manifest>
565        <attribute name="Main-Class" value="${formats.main}"/>
566        <attribute name="Class-Path" value="${formats.classpath}"/>
567      </manifest>
568    </jar>
569  </target>
570
571  <!-- VisBio -->
572
573  <target name="style-visbio" depends="copy-source, jar-checks"
574    description="check source code style for VisBio">
575    <checkstyle config="checkstyle.xml" failOnViolation="false">
576      <fileset dir="${dest.dir}" includes="${visbio.source}"/>
577    </checkstyle>
578  </target>
579
580  <target name="compile-visbio" depends="copy-source"
581    description="compile classes for VisBio">
582    <mkdir dir="${classes.dir}"/>
583    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
584      includes="${visbio.source}" classpath="${ext.jars}"
585      debug="true" deprecation="true" source="1.4" target="1.4"/>
586  </target>
587
588  <target name="jar-visbio" depends="compile-visbio, copy-jars, jar-formats"
589    description="generate JAR file for VisBio">
590    <copy todir="${classes.dir}" preservelastmodified="true">
591      <fileset dir="${src.dir}" includes="${visbio.resources}"/>
592    </copy>
593    <jar jarfile="${jar.dir}/${visbio.jar}" basedir="${classes.dir}"
594      includes="${visbio.files}">
595      <manifest>
596        <attribute name="Main-Class" value="${visbio.main}"/>
597        <attribute name="Class-Path" value="${visbio.classpath}"/>
598      </manifest>
599    </jar>
600  </target>
601
602  <target name="source-visbio" depends="copy-source"
603    description="generate source bundle for VisBio">
604    <zip zipfile="${build.dir}/visbio_src.zip" basedir="${dest.dir}"
605      includes="loci/visbio/**"/>
606  </target>
607
608  <target name="docs-visbio" depends="copy-source"
609    description="generate javadocs for VisBio">
610    <javadoc sourcepath="${dest.dir}" destdir="${visbio.docs-dir}/docs/api"
611      classpath="${ext.jars}" author="true" version="true" use="true"
612      nodeprecated="true" windowtitle="LOCI Software API">
613      <packageset dir="${dest.dir}" includes="loci/visbio/**"/>
614      <doctitle><![CDATA[<h1>VisBio</h1>]]></doctitle>
615      <bottom><![CDATA[${copyright.begin} ${YEAR} ${copyright.end}]]></bottom>
616      <link href="http://java.sun.com/j2se/1.4.2/docs/api/"/>
617      <link href="http://www.ssec.wisc.edu/~dglo/docs/"/>
618      <link href="http://rsbweb.nih.gov/ij/developer/api/"/>
619      <link href="http://www.jdocs.com/formlayout/1.0.4/api/"/>
620      <link href="http://www.jdocs.com/looks/1.2.2/api/"/>
621    </javadoc>
622    <zip zipfile="${build.dir}/visbio_docs.zip" basedir="${visbio.docs-dir}"/>
623  </target>
624
625  <target name="dist-visbio"
626    depends="dist-visbio-win32, dist-visbio-win32-nojre, dist-visbio-macosx,
627      dist-visbio-linux, dist-visbio-nojre"
628    description="create distribution bundles for VisBio"/>
629
630  <target name="dist-visbio-win32" depends="jar-visbio, jar-formats"
631    description="create distribution bundle for VisBio: Windows w/ JRE">
632    <copy todir="${visbio.win32-dir}/VisBio" preservelastmodified="true">
633      <fileset dir="dist/visbio/win32"/>
634      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/>
635      <fileset dir="${jar.dir}" includes="${visbio.jar} ${visbio.classpath}"/>
636    </copy>
637    <fixcrlf srcdir="${visbio.win32-dir}/VisBio" eol="dos"
638      includes="${visbio.text-files}"/>
639    <untar src="dist/jre-win32.tar.gz" dest="${visbio.win32-dir}/VisBio"
640      overwrite="false" compression="gzip"/>
641    <zip destfile="${dist.dir}/visbio${visbio.version}_win32.zip"
642      basedir="${visbio.win32-dir}"/>
643  </target>
644
645  <target name="dist-visbio-win32-nojre" depends="jar-visbio, jar-formats"
646    description="create distribution bundle for VisBio: Windows no JRE">
647    <copy todir="${visbio.win32-nojre-dir}/VisBio"
648      preservelastmodified="true">
649      <fileset dir="dist/visbio/win32" excludes="launcher.cfg"/>
650      <fileset dir="dist/visbio/win32-nojre"/>
651      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/>
652      <fileset dir="${jar.dir}" includes="${visbio.jar} ${visbio.classpath}"/>
653    </copy>
654    <fixcrlf srcdir="${visbio.win32-nojre-dir}/VisBio" eol="dos"
655      includes="${visbio.text-files}"/>
656    <zip destfile="${dist.dir}/visbio${visbio.version}_win32_nojre.zip"
657      basedir="${visbio.win32-nojre-dir}"/>
658  </target>
659
660  <!-- HACK - limit OS to *nix due to file permission issues -->
661  <target name="dist-visbio-macosx" if="isUnix"
662    depends="jar-visbio, jar-formats"
663    description="create distribution bundle for VisBio: Mac OS X">
664    <copy todir="${visbio.macosx-dir}/VisBio"
665      preservelastmodified="true">
666      <fileset dir="dist/visbio/macosx"/>
667      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/>
668    </copy>
669    <fixcrlf srcdir="${visbio.macosx-dir}/VisBio" eol="mac"
670      includes="${visbio.text-files}"/>
671    <!-- HACK - copy does not preserve permissions; chmod them back -->
672    <chmod perm="+x">
673      <fileset dir="${visbio.macosx-dir}/VisBio"
674        includes="${visbio.macosx-exec}"/>
675    </chmod>
676    <copy
677      todir="${visbio.macosx-dir}/VisBio/VisBio.app/Contents/Resources/Java">
678      <fileset dir="${jar.dir}" includes="${visbio.jar} ${visbio.classpath}"/>
679    </copy>
680<!--
681    <tar destfile="${dist.dir}/visbio${visbio.version}_macosx.tar.gz"
682      basedir="${visbio.macosx-dir}" compression="gzip"/>
683-->
684    <!-- HACK - tar does not preserve permissions; use exec instead -->
685    <echo>Building tar: visbio${visbio.version}_macosx.tar.gz</echo>
686    <exec executable="tar">
687      <arg value="czf"/>
688      <arg value="${dist.dir}/visbio${visbio.version}_macosx.tar.gz"/>
689      <arg value="-C"/>
690      <arg value="${visbio.macosx-dir}"/>
691      <arg value="VisBio"/>
692    </exec>
693  </target>
694
695  <!-- HACK - limit OS to *nix due to file permission issues -->
696  <target name="dist-visbio-linux" if="isUnix"
697    depends="jar-visbio, jar-formats"
698    description="create distribution bundle for VisBio: Linux w/ JRE">
699    <copy todir="${visbio.linux-dir}/visbio${visbio.version}"
700      preservelastmodified="true">
701      <fileset dir="dist/visbio/linux"/>
702      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/>
703      <fileset dir="${jar.dir}" includes="${visbio.jar} ${visbio.classpath}"/>
704    </copy>
705    <fixcrlf srcdir="${visbio.linux-dir}/visbio${visbio.version}" eol="unix"
706      includes="${visbio.text-files}"/>
707    <!-- HACK - copy does not preserve permissions; chmod them back -->
708    <chmod perm="+x">
709      <fileset dir="${visbio.linux-dir}/visbio${visbio.version}"
710        includes="${visbio.linux-exec}"/>
711    </chmod>
712<!--
713    <untar src="dist/jre-linux.tar.gz"
714      dest="${visbio.linux-dir}/visbio${visbio.version}"
715      overwrite="false" compression="gzip"/>
716-->
717    <!-- HACK - untar does not restore permissions; use exec instead -->
718    <echo>Expanding: jre-linux.tar.gz</echo>
719    <exec executable="tar">
720      <arg value="xzf"/>
721      <arg value="dist/jre-linux.tar.gz"/>
722      <arg value="-C"/>
723      <arg value="${visbio.linux-dir}/visbio${visbio.version}"/>
724    </exec>
725<!--
726    <tar destfile="${dist.dir}/visbio${visbio.version}_linux.tar.gz"
727      basedir="${visbio.linux-dir}" compression="gzip"/>
728-->
729    <!-- HACK - tar does not preserve permissions; use exec instead -->
730    <echo>Building tar: visbio${visbio.version}_linux.tar.gz</echo>
731    <exec executable="tar">
732      <arg value="czf"/>
733      <arg value="${dist.dir}/visbio${visbio.version}_linux.tar.gz"/>
734      <arg value="-C"/>
735      <arg value="${visbio.linux-dir}"/>
736      <arg value="visbio${visbio.version}"/>
737    </exec>
738  </target>
739
740  <!-- HACK - limit OS to *nix due to file permission issues -->
741  <target name="dist-visbio-nojre" if="isUnix"
742    depends="jar-visbio, jar-formats"
743    description="create distribution bundle for VisBio: cross-platform">
744    <copy todir="${visbio.nojre-dir}/visbio${visbio.version}"
745      preservelastmodified="true">
746      <fileset dir="dist/visbio/linux"/>
747      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/>
748      <fileset dir="${jar.dir}" includes="${visbio.jar} ${visbio.classpath}"/>
749    </copy>
750    <fixcrlf srcdir="${visbio.nojre-dir}/visbio${visbio.version}" eol="unix"
751      includes="${visbio.text-files}"/>
752    <!-- HACK - copy does not preserve permissions; chmod them back -->
753    <chmod perm="+x">
754      <fileset dir="${visbio.nojre-dir}/visbio${visbio.version}"
755        includes="${visbio.linux-exec}"/>
756    </chmod>
757<!--
758    <tar destfile="${dist.dir}/visbio${visbio.version}.tar.gz"
759      basedir="${visbio.nojre-dir}" compression="gzip"/>
760-->
761    <!-- HACK - tar does not preserve permissions; use exec instead -->
762    <echo>Building tar: visbio${visbio.version}.tar.gz</echo>
763    <exec executable="tar">
764      <arg value="czf"/>
765      <arg value="${dist.dir}/visbio${visbio.version}.tar.gz"/>
766      <arg value="-C"/>
767      <arg value="${visbio.nojre-dir}"/>
768      <arg value="visbio${visbio.version}"/>
769    </exec>
770  </target>
771
772  <!-- LOCI Plugins for ImageJ -->
773
774  <target name="style-plugins" depends="copy-source, jar-checks"
775    description="check source code style for LOCI Plugins for ImageJ">
776    <checkstyle config="checkstyle.xml" failOnViolation="false">
777      <fileset dir="${dest.dir}" includes="${plugins.source}"/>
778    </checkstyle>
779  </target>
780
781  <target name="compile-plugins" depends="copy-source"
782    description="compile classes for LOCI Plugins for ImageJ">
783    <mkdir dir="${classes.dir}"/>
784    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
785      includes="${plugins.source}" classpath="${ext.jars}"
786      debug="true" deprecation="true" source="1.4" target="1.4"/>
787  </target>
788
789  <target name="jar-plugins" depends="compile-plugins, copy-jars, jar-formats"
790    description="generate JAR file for LOCI Plugins for ImageJ">
791    <jar jarfile="${jar.dir}/${plugins.jar}" basedir="${src.dir}/loci/plugins"
792      includes="plugins.config IJ_Props.txt">
793      <manifest>
794        <attribute name="Main-Class" value="${plugins.main}"/>
795      </manifest>
796    </jar>
797    <jar jarfile="${jar.dir}/${plugins.jar}" basedir="${classes.dir}"
798      includes="${plugins.files}"
799      excludes="loci/plugins/plugins.config loci/plugins/IJ_Props.txt"
800      update="true">
801    </jar>
802  </target>
803
804  <!-- OME Notes -->
805
806  <target name="style-notes" depends="copy-source, jar-checks"
807    description="check source code style for OME Notes">
808    <checkstyle config="checkstyle.xml" failOnViolation="false">
809      <fileset dir="${dest.dir}" includes="${notes.source}"/>
810    </checkstyle>
811  </target>
812
813  <target name="compile-notes" depends="copy-source"
814    description="compile classes for OME Notes">
815    <mkdir dir="${classes.dir}"/>
816    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
817      includes="${notes.source}" classpath="${ext.jars}"
818      debug="true" deprecation="true" source="1.4" target="1.4"/>
819  </target>
820
821  <target name="jar-notes"
822    depends="compile-notes, copy-jars, jar-formats"
823    description="generate JAR file for OME Notes">
824    <copy todir="${classes.dir}" preservelastmodified="true">
825      <fileset dir="${src.dir}" includes="${notes.resources}"/>
826    </copy>
827    <jar jarfile="${jar.dir}/${notes.jar}" basedir="${classes.dir}"
828      includes="${notes.files}">
829      <manifest>
830        <attribute name="Main-Class" value="${notes.main}"/>
831        <attribute name="Class-Path" value="${notes.classpath}"/>
832      </manifest>
833    </jar>
834  </target>
835
836  <!-- OME Metadata Editor -->
837
838  <target name="style-editor" depends="copy-source, jar-checks"
839    description="check source code style for OME Metadata Editor">
840    <checkstyle config="checkstyle.xml" failOnViolation="false">
841      <fileset dir="${dest.dir}" includes="${editor.source}"/>
842    </checkstyle>
843  </target>
844
845  <target name="compile-editor" depends="copy-source"
846    description="compile classes for OME Metadata Editor">
847    <mkdir dir="${classes.dir}"/>
848    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
849      includes="${editor.source}" classpath="${ext.jars}"
850      debug="true" deprecation="true" source="1.4" target="1.4"/>
851  </target>
852
853  <target name="jar-editor"
854    depends="compile-editor, copy-jars, jar-formats"
855    description="generate JAR file for OME Metadata Editor">
856    <copy todir="${classes.dir}" preservelastmodified="true">
857      <fileset dir="${src.dir}" includes="${editor.resources}"/>
858    </copy>
859    <jar jarfile="${jar.dir}/${editor.jar}" basedir="${classes.dir}"
860      includes="${editor.files}">
861      <manifest>
862        <attribute name="Main-Class" value="${editor.main}"/>
863        <attribute name="Class-Path" value="${editor.classpath}"/>
864      </manifest>
865    </jar>
866  </target>
867
868  <!-- Slim Plotter -->
869
870  <target name="style-slim" depends="copy-source, jar-checks"
871    description="check source code style for Slim Plotter">
872    <checkstyle config="checkstyle.xml" failOnViolation="false">
873      <fileset dir="${dest.dir}" includes="${slim.source}"/>
874    </checkstyle>
875  </target>
876
877  <target name="compile-slim" depends="copy-source"
878    description="compile classes for Slim Plotter">
879    <mkdir dir="${classes.dir}"/>
880    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
881      includes="${slim.source}" classpath="${ext.jars}"
882      debug="true" deprecation="true" source="1.4" target="1.4"/>
883  </target>
884
885  <target name="jar-slim" depends="compile-slim, copy-jars"
886    description="generate JAR file for Slim Plotter">
887    <jar jarfile="${jar.dir}/${slim.jar}" basedir="${classes.dir}"
888      includes="${slim.files}">
889      <manifest>
890        <attribute name="Main-Class" value="${slim.main}"/>
891        <attribute name="Class-Path" value="${slim.classpath}"/>
892      </manifest>
893    </jar>
894  </target>
895
896  <target name="dist-slim" if="isUnix"
897    depends="copy-jars, jar-formats, jar-slim"
898    description="create distribution bundle for Slim Plotter">
899    <copy todir="${slim.dist-dir}" preservelastmodified="true">
900      <fileset dir="dist/slim"/>
901      <fileset dir="${jar.dir}" includes="${slim.jar} ${slim.classpath}"/>
902    </copy>
903    <!-- HACK - copy does not preserve permissions; chmod them back -->
904    <chmod perm="+x">
905      <fileset dir="${slim.dist-dir}" includes="${slim.exec}"/>
906    </chmod>
907<!--
908    <zip destfile="${dist.dir}/slim.zip" basedir="${dist.dir}/slim"/>
909-->
910    <!-- HACK - zip does not preserve permissions; use exec instead -->
911    <exec executable="zip" dir="${dist.dir}/slim">
912      <arg value="-r9"/>
913      <arg value="../slim.zip"/>
914      <arg value="SlimPlotter"/>
915    </exec>
916  </target>
917
918  <!-- Automated tests -->
919
920  <target name="style-tests" depends="copy-source, jar-checks"
921    description="check source code style for testing framework">
922    <checkstyle config="checkstyle.xml" failOnViolation="false">
923      <fileset dir="${dest.dir}" includes="${tests.source}"/>
924    </checkstyle>
925  </target>
926
927  <target name="compile-tests" depends="copy-source"
928    description="compile classes for testing framework">
929    <mkdir dir="${classes.dir}"/>
930    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
931      includes="${tests.source}" classpath="${ext.jars}"
932      debug="true" deprecation="true" source="1.4" target="1.4"/>
933  </target>
934
935  <!-- LOCI Checkstyle checks -->
936
937  <target name="style-checks" depends="copy-source, jar-checks"
938    description="check source code style for LOCI Checkstyle checks">
939    <checkstyle config="checkstyle.xml" failOnViolation="false">
940      <fileset dir="${dest.dir}" includes="${checks.source}"/>
941    </checkstyle>
942  </target>
943
944  <target name="compile-checks" depends="copy-source"
945    description="compile classes for LOCI Checkstyle checks">
946    <mkdir dir="${classes.dir}"/>
947    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
948      includes="${checks.source}" classpath="${ext.jars}"
949      debug="true" deprecation="true" source="1.4" target="1.4"/>
950  </target>
951
952  <target name="jar-checks" depends="compile-checks, copy-jars"
953    description="generate JAR file for LOCI Checkstyle checks">
954    <copy todir="${classes.dir}" preservelastmodified="true">
955      <fileset dir="${src.dir}" includes="${checks.resources}"/>
956    </copy>
957    <jar jarfile="${jar.dir}/${checks.jar}" basedir="${classes.dir}"
958      includes="${checks.files}">
959      <manifest>
960        <attribute name="Main-Class" value="${checks.main}"/>
961        <attribute name="Class-Path" value="${checks.classpath}"/>
962      </manifest>
963    </jar>
964  </target>
965
966  <!-- ImageJ -->
967
968  <target name="ij-jws" depends="tools"
969    description="create JAR file encompassing ImageJ plus LOCI plugins">
970    <for list="${ij-jws.libraries}" param="jar" delimiter=" " trim="true">
971      <sequential>
972        <unjar src="${jar.dir}/@{jar}" dest="${ij-jws.dir}">
973          <patternset>
974            <exclude name="META-INF/**"/>
975          </patternset>
976        </unjar>
977      </sequential>
978    </for>
979    <jar jarfile="${jar.dir}/${ij-jws.jar}" basedir="${ij-jws.dir}">
980      <manifest>
981        <attribute name="Main-Class" value="${ij-jws.main}"/>
982      </manifest>
983    </jar>
984    <delete dir="${ij-jws.dir}"/>
985  </target>
986
987</project>
Note: See TracBrowser for help on using the repository browser.