source: trunk/build.xml @ 3802

Revision 3802, 40.5 KB checked in by melissa, 12 years ago (diff)

Propagate lurawave.license property when running the test suite.

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-notes">
571    <copy todir="${classes.dir}" preservelastmodified="true">
572      <fileset dir="${src.dir}" includes="${notes.resources}"/>
573    </copy>
574  </target>
575
576  <target name="copy-resources-editor">
577    <copy todir="${classes.dir}" preservelastmodified="true">
578      <fileset dir="${src.dir}" includes="${editor.resources}"/>
579    </copy>
580  </target>
581
582  <target name="copy-resources-checks">
583    <copy todir="${classes.dir}" preservelastmodified="true">
584      <fileset dir="${src.dir}" includes="${checks.resources}"/>
585    </copy>
586  </target>
587
588  <target name="copy-source" depends="init, copy-resources-formats,
589    copy-resources-visbio, copy-resources-notes, copy-resources-editor,
590    copy-resources-checks">
591    <!-- copy binary files without filtering -->
592    <copy todir="${dest.dir}" preservelastmodified="true">
593      <fileset dir="${src.dir}" includes="loci/**"
594        excludes="**/*.java **/*.config **/*.txt ${ignore.source}"/>
595    </copy>
596    <!-- copy source files with filtering -->
597    <filter token="date" value="${DATE}"/>
598    <filter token="year" value="${YEAR}"/>
599    <filter token="visbio.version" value="${visbio.version}"/>
600    <copy todir="${dest.dir}" filtering="true" preservelastmodified="true">
601      <fileset dir="${src.dir}" includes="loci/**"
602        excludes="${ignore.source}"/>
603    </copy>
604  </target>
605
606  <target name="copy-jars">
607    <!-- copy needed external JARs into build jars folder -->
608    <copy todir="${jar.dir}" preservelastmodified="true">
609      <fileset dir="jar"/>
610    </copy>
611  </target>
612
613  <!-- Bio-Formats -->
614
615  <target name="style-formats" depends="copy-source, jar-checks"
616    description="check source code style for Bio-Formats">
617    <checkstyle config="checkstyle.xml" failOnViolation="false">
618      <fileset dir="${dest.dir}" includes="${formats.source}"/>
619    </checkstyle>
620  </target>
621
622  <target name="compile-formats" depends="copy-source"
623    description="compile classes for Bio-Formats">
624    <mkdir dir="${classes.dir}"/>
625    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
626      includes="${formats.source}" excludes="${formats.exclude}"
627      classpath="${ext.jars}"
628      debug="true" deprecation="true" source="1.4" target="1.4"/>
629  </target>
630
631  <target name="jar-formats" depends="compile-formats, copy-jars"
632    description="generate JAR file for Bio-Formats">
633    <mkdir dir="${jar.dir}"/>
634    <jar jarfile="${jar.dir}/${formats.jar}" basedir="${classes.dir}"
635      includes="${formats.files}">
636      <manifest>
637        <attribute name="Main-Class" value="${formats.main}"/>
638        <attribute name="Class-Path" value="${formats.classpath}"/>
639      </manifest>
640    </jar>
641  </target>
642
643  <!-- VisBio -->
644
645  <target name="style-visbio" depends="copy-source, jar-checks"
646    description="check source code style for VisBio">
647    <checkstyle config="checkstyle.xml" failOnViolation="false">
648      <fileset dir="${dest.dir}" includes="${visbio.source}"/>
649    </checkstyle>
650  </target>
651
652  <target name="compile-visbio" depends="copy-source"
653    description="compile classes for VisBio">
654    <mkdir dir="${classes.dir}"/>
655    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
656      includes="${visbio.source}" classpath="${ext.jars}"
657      debug="true" deprecation="true" source="1.4" target="1.4"/>
658  </target>
659
660  <target name="jar-visbio" depends="compile-visbio, copy-jars, jar-formats"
661    description="generate JAR file for VisBio">
662    <jar jarfile="${jar.dir}/${visbio.jar}" basedir="${classes.dir}"
663      includes="${visbio.files}">
664      <manifest>
665        <attribute name="Main-Class" value="${visbio.main}"/>
666        <attribute name="Class-Path" value="${visbio.classpath}"/>
667      </manifest>
668    </jar>
669  </target>
670
671  <target name="source-visbio" depends="copy-source"
672    description="generate source bundle for VisBio">
673    <zip zipfile="${build.dir}/visbio_src.zip" basedir="${dest.dir}"
674      includes="loci/visbio/**"/>
675  </target>
676
677  <target name="docs-visbio" depends="copy-source"
678    description="generate javadocs for VisBio">
679    <javadoc sourcepath="${dest.dir}" destdir="${visbio.docs-dir}/docs/api"
680      classpath="${ext.jars}" author="true" version="true" use="true"
681      nodeprecated="true" windowtitle="LOCI Software API">
682      <packageset dir="${dest.dir}" includes="loci/visbio/**"/>
683      <doctitle><![CDATA[<h1>VisBio</h1>]]></doctitle>
684      <bottom><![CDATA[${copyright.begin} ${YEAR} ${copyright.end}]]></bottom>
685      <link href="http://java.sun.com/j2se/1.4.2/docs/api/"/>
686      <link href="http://www.ssec.wisc.edu/~dglo/docs/"/>
687      <link href="http://rsbweb.nih.gov/ij/developer/api/"/>
688      <link href="http://www.jdocs.com/formlayout/1.0.4/api/"/>
689      <link href="http://www.jdocs.com/looks/1.2.2/api/"/>
690    </javadoc>
691    <zip zipfile="${build.dir}/visbio_docs.zip" basedir="${visbio.docs-dir}"/>
692  </target>
693
694  <target name="dist-visbio"
695    depends="dist-visbio-win32, dist-visbio-win32-nojre, dist-visbio-macosx,
696      dist-visbio-linux, dist-visbio-nojre"
697    description="create distribution bundles for VisBio"/>
698
699  <target name="dist-visbio-win32" depends="jar-visbio, jar-formats"
700    description="create distribution bundle for VisBio: Windows w/ JRE">
701    <copy todir="${visbio.win32-dir}/VisBio" preservelastmodified="true">
702      <fileset dir="dist/visbio/win32"/>
703      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/>
704      <fileset dir="${jar.dir}" includes="${visbio.jar} ${visbio.classpath}"/>
705    </copy>
706    <fixcrlf srcdir="${visbio.win32-dir}/VisBio" eol="dos"
707      includes="${visbio.text-files}"/>
708    <untar src="dist/jre-win32.tar.gz" dest="${visbio.win32-dir}/VisBio"
709      overwrite="false" compression="gzip"/>
710    <zip destfile="${dist.dir}/visbio${visbio.version}_win32.zip"
711      basedir="${visbio.win32-dir}"/>
712  </target>
713
714  <target name="dist-visbio-win32-nojre" depends="jar-visbio, jar-formats"
715    description="create distribution bundle for VisBio: Windows no JRE">
716    <copy todir="${visbio.win32-nojre-dir}/VisBio"
717      preservelastmodified="true">
718      <fileset dir="dist/visbio/win32" excludes="launcher.cfg"/>
719      <fileset dir="dist/visbio/win32-nojre"/>
720      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/>
721      <fileset dir="${jar.dir}" includes="${visbio.jar} ${visbio.classpath}"/>
722    </copy>
723    <fixcrlf srcdir="${visbio.win32-nojre-dir}/VisBio" eol="dos"
724      includes="${visbio.text-files}"/>
725    <zip destfile="${dist.dir}/visbio${visbio.version}_win32_nojre.zip"
726      basedir="${visbio.win32-nojre-dir}"/>
727  </target>
728
729  <!-- HACK - limit OS to *nix due to file permission issues -->
730  <target name="dist-visbio-macosx" if="isUnix"
731    depends="jar-visbio, jar-formats"
732    description="create distribution bundle for VisBio: Mac OS X">
733    <copy todir="${visbio.macosx-dir}/VisBio"
734      preservelastmodified="true">
735      <fileset dir="dist/visbio/macosx"/>
736      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/>
737    </copy>
738    <fixcrlf srcdir="${visbio.macosx-dir}/VisBio" eol="mac"
739      includes="${visbio.text-files}"/>
740    <!-- HACK - copy does not preserve permissions; chmod them back -->
741    <chmod perm="+x">
742      <fileset dir="${visbio.macosx-dir}/VisBio"
743        includes="${visbio.macosx-exec}"/>
744    </chmod>
745    <copy
746      todir="${visbio.macosx-dir}/VisBio/VisBio.app/Contents/Resources/Java">
747      <fileset dir="${jar.dir}" includes="${visbio.jar} ${visbio.classpath}"/>
748    </copy>
749<!--
750    <tar destfile="${dist.dir}/visbio${visbio.version}_macosx.tar.gz"
751      basedir="${visbio.macosx-dir}" compression="gzip"/>
752-->
753    <!-- HACK - tar does not preserve permissions; use exec instead -->
754    <echo>Building tar: visbio${visbio.version}_macosx.tar.gz</echo>
755    <exec executable="tar">
756      <arg value="czf"/>
757      <arg value="${dist.dir}/visbio${visbio.version}_macosx.tar.gz"/>
758      <arg value="-C"/>
759      <arg value="${visbio.macosx-dir}"/>
760      <arg value="VisBio"/>
761    </exec>
762  </target>
763
764  <!-- HACK - limit OS to *nix due to file permission issues -->
765  <target name="dist-visbio-linux" if="isUnix"
766    depends="jar-visbio, jar-formats"
767    description="create distribution bundle for VisBio: Linux w/ JRE">
768    <copy todir="${visbio.linux-dir}/visbio${visbio.version}"
769      preservelastmodified="true">
770      <fileset dir="dist/visbio/linux"/>
771      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/>
772      <fileset dir="${jar.dir}" includes="${visbio.jar} ${visbio.classpath}"/>
773    </copy>
774    <fixcrlf srcdir="${visbio.linux-dir}/visbio${visbio.version}" eol="unix"
775      includes="${visbio.text-files}"/>
776    <!-- HACK - copy does not preserve permissions; chmod them back -->
777    <chmod perm="+x">
778      <fileset dir="${visbio.linux-dir}/visbio${visbio.version}"
779        includes="${visbio.linux-exec}"/>
780    </chmod>
781<!--
782    <untar src="dist/jre-linux.tar.gz"
783      dest="${visbio.linux-dir}/visbio${visbio.version}"
784      overwrite="false" compression="gzip"/>
785-->
786    <!-- HACK - untar does not restore permissions; use exec instead -->
787    <echo>Expanding: jre-linux.tar.gz</echo>
788    <exec executable="tar">
789      <arg value="xzf"/>
790      <arg value="dist/jre-linux.tar.gz"/>
791      <arg value="-C"/>
792      <arg value="${visbio.linux-dir}/visbio${visbio.version}"/>
793    </exec>
794<!--
795    <tar destfile="${dist.dir}/visbio${visbio.version}_linux.tar.gz"
796      basedir="${visbio.linux-dir}" compression="gzip"/>
797-->
798    <!-- HACK - tar does not preserve permissions; use exec instead -->
799    <echo>Building tar: visbio${visbio.version}_linux.tar.gz</echo>
800    <exec executable="tar">
801      <arg value="czf"/>
802      <arg value="${dist.dir}/visbio${visbio.version}_linux.tar.gz"/>
803      <arg value="-C"/>
804      <arg value="${visbio.linux-dir}"/>
805      <arg value="visbio${visbio.version}"/>
806    </exec>
807  </target>
808
809  <!-- HACK - limit OS to *nix due to file permission issues -->
810  <target name="dist-visbio-nojre" if="isUnix"
811    depends="jar-visbio, jar-formats"
812    description="create distribution bundle for VisBio: cross-platform">
813    <copy todir="${visbio.nojre-dir}/visbio${visbio.version}"
814      preservelastmodified="true">
815      <fileset dir="dist/visbio/linux"/>
816      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/>
817      <fileset dir="${jar.dir}" includes="${visbio.jar} ${visbio.classpath}"/>
818    </copy>
819    <fixcrlf srcdir="${visbio.nojre-dir}/visbio${visbio.version}" eol="unix"
820      includes="${visbio.text-files}"/>
821    <!-- HACK - copy does not preserve permissions; chmod them back -->
822    <chmod perm="+x">
823      <fileset dir="${visbio.nojre-dir}/visbio${visbio.version}"
824        includes="${visbio.linux-exec}"/>
825    </chmod>
826<!--
827    <tar destfile="${dist.dir}/visbio${visbio.version}.tar.gz"
828      basedir="${visbio.nojre-dir}" compression="gzip"/>
829-->
830    <!-- HACK - tar does not preserve permissions; use exec instead -->
831    <echo>Building tar: visbio${visbio.version}.tar.gz</echo>
832    <exec executable="tar">
833      <arg value="czf"/>
834      <arg value="${dist.dir}/visbio${visbio.version}.tar.gz"/>
835      <arg value="-C"/>
836      <arg value="${visbio.nojre-dir}"/>
837      <arg value="visbio${visbio.version}"/>
838    </exec>
839  </target>
840
841  <!-- LOCI Plugins for ImageJ -->
842
843  <target name="style-plugins" depends="copy-source, jar-checks"
844    description="check source code style for LOCI Plugins for ImageJ">
845    <checkstyle config="checkstyle.xml" failOnViolation="false">
846      <fileset dir="${dest.dir}" includes="${plugins.source}"/>
847    </checkstyle>
848  </target>
849
850  <target name="compile-plugins" depends="copy-source"
851    description="compile classes for LOCI Plugins for ImageJ">
852    <mkdir dir="${classes.dir}"/>
853    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
854      includes="${plugins.source}" classpath="${ext.jars}"
855      debug="true" deprecation="true" source="1.4" target="1.4"/>
856  </target>
857
858  <target name="jar-plugins" depends="compile-plugins, copy-jars, jar-formats"
859    description="generate JAR file for LOCI Plugins for ImageJ">
860    <jar jarfile="${jar.dir}/${plugins.jar}" basedir="${src.dir}/loci/plugins"
861      includes="plugins.config IJ_Props.txt">
862      <manifest>
863        <attribute name="Main-Class" value="${plugins.main}"/>
864      </manifest>
865    </jar>
866    <jar jarfile="${jar.dir}/${plugins.jar}" basedir="${classes.dir}"
867      includes="${plugins.files}"
868      excludes="loci/plugins/plugins.config loci/plugins/IJ_Props.txt"
869      update="true">
870    </jar>
871  </target>
872
873  <!-- OME Notes -->
874
875  <target name="style-notes" depends="copy-source, jar-checks"
876    description="check source code style for OME Notes">
877    <checkstyle config="checkstyle.xml" failOnViolation="false">
878      <fileset dir="${dest.dir}" includes="${notes.source}"/>
879    </checkstyle>
880  </target>
881
882  <target name="compile-notes" depends="copy-source"
883    description="compile classes for OME Notes">
884    <mkdir dir="${classes.dir}"/>
885    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
886      includes="${notes.source}" classpath="${ext.jars}"
887      debug="true" deprecation="true" source="1.4" target="1.4"/>
888  </target>
889
890  <target name="jar-notes"
891    depends="compile-notes, copy-jars, jar-formats"
892    description="generate JAR file for OME Notes">
893    <jar jarfile="${jar.dir}/${notes.jar}" basedir="${classes.dir}"
894      includes="${notes.files}">
895      <manifest>
896        <attribute name="Main-Class" value="${notes.main}"/>
897        <attribute name="Class-Path" value="${notes.classpath}"/>
898      </manifest>
899    </jar>
900  </target>
901
902  <!-- JVMLink -->
903
904  <target name="style-jvmlink" depends="copy-source, jar-checks"
905    description="check source code style for JVMLink">
906    <checkstyle config="checkstyle.xml" failOnViolation="false">
907      <fileset dir="${dest.dir}" includes="${jvmlink.source}"/>
908    </checkstyle>
909  </target>
910
911  <target name="compile-jvmlink" depends="copy-source"
912    description="compile classes for JVMLink">
913    <mkdir dir="${classes.dir}"/>
914    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
915      includes="${jvmlink.source}" classpath="${ext.jars}"
916      debug="true" deprecation="true" source="1.4" target="1.4"/>
917  </target>
918
919  <target name="jar-jvmlink"
920    depends="compile-formats, compile-jvmlink, copy-jars"
921    description="generate JAR file for JVMLink">
922    <jar jarfile="${jar.dir}/${jvmlink.jar}" basedir="${classes.dir}"
923      includes="${jvmlink.files}">
924      <manifest>
925        <attribute name="Main-Class" value="${jvmlink.main}"/>
926        <!--<attribute name="Class-Path" value="${jvmlink.classpath}"/>-->
927      </manifest>
928    </jar>
929  </target>
930
931  <!-- Slim Plotter -->
932
933  <target name="style-slim" depends="copy-source, jar-checks"
934    description="check source code style for Slim Plotter">
935    <checkstyle config="checkstyle.xml" failOnViolation="false">
936      <fileset dir="${dest.dir}" includes="${slim.source}"/>
937    </checkstyle>
938  </target>
939
940  <target name="compile-slim" depends="copy-source"
941    description="compile classes for Slim Plotter">
942    <mkdir dir="${classes.dir}"/>
943    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
944      includes="${slim.source}" classpath="${ext.jars}"
945      debug="true" deprecation="true" source="1.4" target="1.4"/>
946  </target>
947
948  <target name="jar-slim" depends="compile-slim, copy-jars"
949    description="generate JAR file for Slim Plotter">
950    <jar jarfile="${jar.dir}/${slim.jar}" basedir="${classes.dir}"
951      includes="${slim.files}">
952      <manifest>
953        <attribute name="Main-Class" value="${slim.main}"/>
954        <attribute name="Class-Path" value="${slim.classpath}"/>
955      </manifest>
956    </jar>
957  </target>
958
959  <target name="dist-slim" if="isUnix"
960    depends="copy-jars, jar-formats, jar-slim"
961    description="create distribution bundle for Slim Plotter">
962    <copy todir="${slim.dist-dir}" preservelastmodified="true">
963      <fileset dir="dist/slim"/>
964      <fileset dir="${jar.dir}" includes="${slim.jar} ${slim.classpath}"/>
965    </copy>
966    <!-- HACK - copy does not preserve permissions; chmod them back -->
967    <chmod perm="+x">
968      <fileset dir="${slim.dist-dir}" includes="${slim.exec}"/>
969    </chmod>
970<!--
971    <zip destfile="${dist.dir}/slim.zip" basedir="${dist.dir}/slim"/>
972-->
973    <!-- HACK - zip does not preserve permissions; use exec instead -->
974    <exec executable="zip" dir="${dist.dir}/slim">
975      <arg value="-r9"/>
976      <arg value="../slim.zip"/>
977      <arg value="SlimPlotter"/>
978    </exec>
979  </target>
980
981  <!-- OME Metadata Editor -->
982
983  <target name="style-editor" depends="copy-source, jar-checks"
984    description="check source code style for OME Metadata Editor">
985    <checkstyle config="checkstyle.xml" failOnViolation="false">
986      <fileset dir="${dest.dir}" includes="${editor.source}"/>
987    </checkstyle>
988  </target>
989
990  <target name="compile-editor" depends="copy-source"
991    description="compile classes for OME Metadata Editor">
992    <mkdir dir="${classes.dir}"/>
993    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
994      includes="${editor.source}" classpath="${ext.jars}"
995      debug="true" deprecation="true" source="1.4" target="1.4"/>
996  </target>
997
998  <target name="jar-editor"
999    depends="compile-editor, copy-jars, jar-formats"
1000    description="generate JAR file for OME Metadata Editor">
1001    <jar jarfile="${jar.dir}/${editor.jar}" basedir="${classes.dir}"
1002      includes="${editor.files}">
1003      <manifest>
1004        <attribute name="Main-Class" value="${editor.main}"/>
1005        <attribute name="Class-Path" value="${editor.classpath}"/>
1006      </manifest>
1007    </jar>
1008  </target>
1009
1010  <!-- Automated tests -->
1011
1012  <target name="style-tests" depends="copy-source, jar-checks"
1013    description="check source code style for testing framework">
1014    <checkstyle config="checkstyle.xml" failOnViolation="false">
1015      <fileset dir="${dest.dir}" includes="${tests.source}"/>
1016    </checkstyle>
1017  </target>
1018
1019  <target name="compile-tests" depends="copy-source"
1020    description="compile classes for testing framework">
1021    <mkdir dir="${classes.dir}"/>
1022    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
1023      includes="${tests.source}" classpath="${ext.jars}"
1024      debug="true" deprecation="true" source="1.4" target="1.4"/>
1025  </target>
1026
1027  <!-- LOCI Checkstyle checks -->
1028
1029  <target name="style-checks" depends="copy-source, jar-checks"
1030    description="check source code style for LOCI Checkstyle checks">
1031    <checkstyle config="checkstyle.xml" failOnViolation="false">
1032      <fileset dir="${dest.dir}" includes="${checks.source}"/>
1033    </checkstyle>
1034  </target>
1035
1036  <target name="compile-checks" depends="copy-source"
1037    description="compile classes for LOCI Checkstyle checks">
1038    <mkdir dir="${classes.dir}"/>
1039    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
1040      includes="${checks.source}" classpath="${ext.jars}"
1041      debug="true" deprecation="true" source="1.4" target="1.4"/>
1042  </target>
1043
1044  <target name="jar-checks" depends="compile-checks, copy-jars"
1045    description="generate JAR file for LOCI Checkstyle checks">
1046    <jar jarfile="${jar.dir}/${checks.jar}" basedir="${classes.dir}"
1047      includes="${checks.files}">
1048      <manifest>
1049        <attribute name="Main-Class" value="${checks.main}"/>
1050        <attribute name="Class-Path" value="${checks.classpath}"/>
1051      </manifest>
1052    </jar>
1053  </target>
1054
1055  <!-- ImageJ -->
1056
1057  <target name="ij-jws" depends="tools"
1058    description="create JAR file encompassing ImageJ plus LOCI plugins">
1059    <for list="${ij-jws.libraries}" param="jar" delimiter=" " trim="true">
1060      <sequential>
1061        <unjar src="${jar.dir}/@{jar}" dest="${ij-jws.dir}">
1062          <patternset>
1063            <exclude name="META-INF/**"/>
1064          </patternset>
1065        </unjar>
1066      </sequential>
1067    </for>
1068    <jar jarfile="${jar.dir}/${ij-jws.jar}" basedir="${ij-jws.dir}">
1069      <manifest>
1070        <attribute name="Main-Class" value="${ij-jws.main}"/>
1071      </manifest>
1072    </jar>
1073    <delete dir="${ij-jws.dir}"/>
1074  </target>
1075
1076</project>
Note: See TracBrowser for help on using the repository browser.