source: trunk/build.xml @ 3860

Revision 3860, 40.7 KB checked in by curtis, 12 years ago (diff)

Move list of libraries into external configuration file.

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