source: trunk/build.xml @ 4082

Revision 4082, 41.2 KB checked in by curtis, 12 years ago (diff)

Minor tweak.

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:       GPL
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/slim
142                   some loci/visbio
143    Main class:    loci.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:       GPL
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  <!--
375  <taskdef resource="proguard/ant/task.properties"
376    classpath="jar/proguard.jar"/>
377  -->
378
379  <!-- Global build targets -->
380
381  <target name="init">
382    <tstamp>
383      <format property="DATE" pattern="d MMMMM yyyy"/>
384      <format property="YEAR" pattern="yyyy"/>
385    </tstamp>
386  </target>
387
388  <target name="style"
389    depends="style-formats, style-visbio, style-plugins, style-notes,
390      style-editor, style-slim, style-checks"
391    description="check source code style for LOCI software packages"/>
392
393<!--
394  <target name="compile" depends="copy-source"
395    description="compile classes for LOCI software packages">
396    <mkdir dir="${classes.dir}"/>
397    <javac srcdir="${dest.dir}" destdir="${classes.dir}" debug="true"
398      classpath="${ext.jars}" deprecation="true" source="1.4" target="1.4"/>
399  </target>
400-->
401  <target name="compile"
402    depends="compile-formats, compile-visbio, compile-plugins, compile-notes,
403      compile-jvmlink, compile-slim, compile-editor, compile-tests,
404      compile-checks"
405    description="compile classes for LOCI software packages"/>
406
407  <target name="jars"
408    depends="jar-formats, jar-visbio, jar-plugins, jar-notes,
409      jar-jvmlink, jar-slim, jar-editor, jar-checks"
410    description="generate JAR files for LOCI software packages"/>
411
412  <target name="tools" depends="jars"
413    description="create JAR file encompassing several LOCI tools">
414    <for list="${tools.libraries}" param="jar" delimiter=" " trim="true">
415      <sequential>
416        <available file="${jar.dir}/@{jar}" property="@{jar}.present"/>
417        <if>
418          <equals arg1="${@{jar}.present}" arg2="true" />
419          <then>
420            <unjar src="${jar.dir}/@{jar}" dest="${tools.dir}">
421              <patternset>
422                <exclude name="META-INF/**"/>
423              </patternset>
424            </unjar>
425          </then>
426        </if>
427      </sequential>
428    </for>
429    <jar jarfile="${jar.dir}/${tools.jar}" basedir="${tools.dir}">
430      <manifest>
431        <attribute name="Main-Class" value="${tools.main}"/>
432      </manifest>
433    </jar>
434    <delete dir="${tools.dir}"/>
435  </target>
436
437  <target name="docs" depends="copy-source"
438    description="generate javadocs for LOCI software packages">
439    <javadoc sourcepath="${dest.dir}" destdir="${docs.dir}/api"
440      classpath="${ext.jars}" author="true" version="true" use="true"
441      nodeprecated="true" windowtitle="LOCI Software API">
442      <packageset dir="${dest.dir}"/>
443      <doctitle><![CDATA[<h1>LOCI Software</h1>]]></doctitle>
444      <bottom><![CDATA[${copyright.begin} ${YEAR} ${copyright.end}]]></bottom>
445      <link href="http://java.sun.com/j2se/1.4.2/docs/api/"/>
446      <link href="http://www.ssec.wisc.edu/~dglo/docs/"/>
447      <link href="http://rsbweb.nih.gov/ij/developer/api/"/>
448      <link href="http://www.jdocs.com/formlayout/1.0.4/api/"/>
449      <link href="http://www.jdocs.com/looks/1.2.2/api/"/>
450    </javadoc>
451  </target>
452
453  <target name="clean" description="remove all build files">
454    <delete dir="${build.dir}"/>
455  </target>
456
457  <target name="clean-classes" description="remove classes from build folder">
458    <delete dir="${classes.dir}"/>
459  </target>
460
461  <target name="clean-dist"
462    description="remove distribution bundles from build folder">
463    <delete dir="${dist.dir}"/>
464  </target>
465
466  <target name="clean-docs" description="remove javadocs from build folder">
467    <delete dir="${docs.dir}"/>
468  </target>
469
470  <target name="clean-jars" description="remove JAR files from build folder">
471    <delete dir="${jar.dir}"/>
472  </target>
473
474  <target name="clean-src" description="remove source files from build folder">
475    <delete dir="${dest.dir}"/>
476  </target>
477
478  <target name="dev-compile" description="compile classes in-place (no copy)">
479    <!-- By default, source files should compile under Java 1.4 -->
480    <javac srcdir="." destdir="." debug="true" classpath="${ext.jars}"
481      deprecation="true" source="1.4" target="1.4">
482      <include name="loci/**"/>
483      <exclude name="${java15.dirs}"/>
484    </javac>
485    <!-- Source files requiring Java 1.5 -->
486    <javac srcdir="." destdir="." debug="true" classpath="${ext.jars}"
487      deprecation="true" source="1.5" target="1.5">
488      <include name="${java15.dirs}"/>
489    </javac>
490  </target>
491
492  <target name="dev-clean" description="remove classes in-place (no copy)">
493    <delete>
494      <fileset dir="." includes="loci/**/*.class"/>
495    </delete>
496  </target>
497
498  <target name="test-all" depends="compile"
499    description="run all automated tests">
500    <testng classpathref="cp-testng" sourceDir="${dest.dir}"
501      annotations="Javadoc" groups="all" testname="All tests"
502      listener="loci.tests.testng.DotTestListener"
503      suitename="LOCI software test suite">
504      <classfileset dir="${classes.dir}" includes="${testng.classes}"/>
505      <sysproperty key="testng.filename" value="${testng.filename}"/>
506      <sysproperty key="testng.directory" value="${testng.directory}"/>
507      <sysproperty key="testng.multiplier" value="${testng.multiplier}"/>
508      <sysproperty key="lurawave.license" value="${lurawave.license}"/>
509      <jvmarg value="-mx${testng.memory}"/>
510    </testng>
511  </target>
512
513  <target name="test-config" depends="compile"
514    description="generate config files for automated test suite">
515    <testng classpathref="cp-testng" sourceDir="${dest.dir}"
516      annotations="Javadoc" groups="config" testname="Config generation"
517      listener="loci.tests.testng.DotTestListener"
518      suitename="LOCI software test suite">
519      <classfileset dir="${classes.dir}" includes="${testng.classes}"/>
520      <sysproperty key="testng.directory" value="${testng.directory}"/>
521      <sysproperty key="testng.multiplier" value="${testng.multiplier}"/>
522      <sysproperty key="lurawave.license" value="${lurawave.license}"/>
523      <jvmarg value="-mx${testng.memory}"/>
524    </testng>
525  </target>
526
527  <target name="test-fast" depends="compile"
528    description="run automated tests in group 'fast'">
529    <testng classpathref="cp-testng" sourceDir="${dest.dir}"
530      annotations="Javadoc" groups="fast" testname="Fast tests"
531      listener="loci.tests.testng.DotTestListener"
532      suitename="LOCI software test suite">
533      <classfileset dir="${classes.dir}" includes="${testng.classes}"/>
534      <sysproperty key="testng.directory" value="${testng.directory}"/>
535      <sysproperty key="testng.multiplier" value="${testng.multiplier}"/>
536      <sysproperty key="lurawave.license" value="${lurawave.license}"/>
537      <jvmarg value="-Xmx${testng.memory}"/>
538    </testng>
539  </target>
540
541  <target name="test-pixels" depends="compile"
542    description="run automated tests in group 'pixels'">
543    <testng classpathref="cp-testng" sourceDir="${dest.dir}"
544      annotations="Javadoc" groups="pixels" testname="Pixels tests"
545      listener="loci.tests.testng.DotTestListener"
546      suitename="LOCI software test suite">
547      <classfileset dir="${classes.dir}" includes="${testng.classes}"/>
548      <sysproperty key="testng.directory" value="${testng.directory}"/>
549      <sysproperty key="testng.multiplier" value="${testng.multiplier}"/>
550      <sysproperty key="lurawave.license" value="${lurawave.license}"/>
551      <jvmarg value="-Xmx${testng.memory}"/>
552    </testng>
553  </target>
554
555  <target name="test-xml" depends="compile"
556    description="run automated tests in group 'xml'">
557    <testng classpathref="cp-testng" sourceDir="${dest.dir}"
558      annotations="Javadoc" groups="xml" testname="XML tests"
559      listener="loci.tests.testng.DotTestListener"
560      suitename="LOCI software test suite">
561      <classfileset dir="${classes.dir}" includes="${testng.classes}"/>
562      <sysproperty key="testng.directory" value="${testng.directory}"/>
563      <sysproperty key="testng.multiplier" value="${testng.multiplier}"/>
564      <sysproperty key="lurawave.license" value="${lurawave.license}"/>
565      <jvmarg value="-Xmx${testng.memory}"/>
566    </testng>
567  </target>
568
569  <!-- Internal build targets -->
570
571  <target name="copy-resources-formats">
572    <copy todir="${classes.dir}" preservelastmodified="true">
573      <fileset dir="${src.dir}" includes="${formats.resources}"/>
574    </copy>
575  </target>
576
577  <target name="copy-resources-visbio">
578    <copy todir="${classes.dir}" preservelastmodified="true">
579      <fileset dir="${src.dir}" includes="${visbio.resources}"/>
580    </copy>
581  </target>
582
583  <target name="copy-resources-plugins">
584    <copy todir="${classes.dir}" preservelastmodified="true">
585      <fileset dir="${src.dir}" includes="${plugins.resources}"/>
586    </copy>
587  </target>
588
589  <target name="copy-resources-notes">
590    <copy todir="${classes.dir}" preservelastmodified="true">
591      <fileset dir="${src.dir}" includes="${notes.resources}"/>
592    </copy>
593  </target>
594
595  <target name="copy-resources-editor">
596    <copy todir="${classes.dir}" preservelastmodified="true">
597      <fileset dir="${src.dir}" includes="${editor.resources}"/>
598    </copy>
599  </target>
600
601  <target name="copy-resources-checks">
602    <copy todir="${classes.dir}" preservelastmodified="true">
603      <fileset dir="${src.dir}" includes="${checks.resources}"/>
604    </copy>
605  </target>
606
607  <target name="copy-source" depends="init, copy-resources-formats,
608    copy-resources-visbio, copy-resources-plugins, copy-resources-notes,
609                copy-resources-editor, copy-resources-checks">
610    <!-- copy binary files without filtering -->
611    <copy todir="${dest.dir}" preservelastmodified="true">
612      <fileset dir="${src.dir}" includes="loci/**"
613        excludes="**/*.java **/*.config **/*.txt ${ignore.source}"/>
614    </copy>
615    <!-- copy source files with filtering -->
616    <filter token="date" value="${DATE}"/>
617    <filter token="year" value="${YEAR}"/>
618    <filter token="visbio.version" value="${visbio.version}"/>
619    <copy todir="${dest.dir}" filtering="true" preservelastmodified="true">
620      <fileset dir="${src.dir}" includes="loci/**"
621        excludes="${ignore.source}"/>
622    </copy>
623  </target>
624
625  <target name="copy-jars">
626    <!-- copy needed external JARs into build jars folder -->
627    <copy todir="${jar.dir}" preservelastmodified="true">
628      <fileset dir="jar"/>
629    </copy>
630  </target>
631
632  <!-- Bio-Formats -->
633
634  <target name="style-formats" depends="copy-source, jar-checks"
635    description="check source code style for Bio-Formats">
636    <checkstyle config="checkstyle.xml" failOnViolation="false">
637      <fileset dir="${dest.dir}" includes="${formats.source}"/>
638    </checkstyle>
639  </target>
640
641  <target name="compile-formats" depends="copy-source"
642    description="compile classes for Bio-Formats">
643    <mkdir dir="${classes.dir}"/>
644    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
645      includes="${formats.source}" excludes="${formats.exclude}"
646      classpath="${ext.jars}"
647      debug="true" deprecation="true" source="1.4" target="1.4"/>
648  </target>
649
650  <target name="jar-formats" depends="compile-formats, copy-jars"
651    description="generate JAR file for Bio-Formats">
652    <mkdir dir="${jar.dir}"/>
653    <jar jarfile="${jar.dir}/${formats.jar}" basedir="${classes.dir}"
654      includes="${formats.files}">
655      <manifest>
656        <attribute name="Main-Class" value="${formats.main}"/>
657        <attribute name="Class-Path" value="${formats.classpath}"/>
658      </manifest>
659    </jar>
660  </target>
661
662  <!-- VisBio -->
663
664  <target name="style-visbio" depends="copy-source, jar-checks"
665    description="check source code style for VisBio">
666    <checkstyle config="checkstyle.xml" failOnViolation="false">
667      <fileset dir="${dest.dir}" includes="${visbio.source}"/>
668    </checkstyle>
669  </target>
670
671  <target name="compile-visbio" depends="copy-source"
672    description="compile classes for VisBio">
673    <mkdir dir="${classes.dir}"/>
674    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
675      includes="${visbio.source}" classpath="${ext.jars}"
676      debug="true" deprecation="true" source="1.4" target="1.4"/>
677  </target>
678
679  <target name="jar-visbio" depends="compile-visbio, copy-jars, jar-formats"
680    description="generate JAR file for VisBio">
681    <jar jarfile="${jar.dir}/${visbio.jar}" basedir="${classes.dir}"
682      includes="${visbio.files}">
683      <manifest>
684        <attribute name="Main-Class" value="${visbio.main}"/>
685        <attribute name="Class-Path" value="${visbio.classpath}"/>
686      </manifest>
687    </jar>
688  </target>
689
690  <target name="source-visbio" depends="copy-source"
691    description="generate source bundle for VisBio">
692    <zip zipfile="${build.dir}/visbio_src.zip" basedir="${dest.dir}"
693      includes="loci/visbio/**"/>
694  </target>
695
696  <target name="docs-visbio" depends="copy-source"
697    description="generate javadocs for VisBio">
698    <javadoc sourcepath="${dest.dir}" destdir="${visbio.docs-dir}/docs/api"
699      classpath="${ext.jars}" author="true" version="true" use="true"
700      nodeprecated="true" windowtitle="LOCI Software API">
701      <packageset dir="${dest.dir}" includes="loci/visbio/**"/>
702      <doctitle><![CDATA[<h1>VisBio</h1>]]></doctitle>
703      <bottom><![CDATA[${copyright.begin} ${YEAR} ${copyright.end}]]></bottom>
704      <link href="http://java.sun.com/j2se/1.4.2/docs/api/"/>
705      <link href="http://www.ssec.wisc.edu/~dglo/docs/"/>
706      <link href="http://rsbweb.nih.gov/ij/developer/api/"/>
707      <link href="http://www.jdocs.com/formlayout/1.0.4/api/"/>
708      <link href="http://www.jdocs.com/looks/1.2.2/api/"/>
709    </javadoc>
710    <zip zipfile="${build.dir}/visbio_docs.zip" basedir="${visbio.docs-dir}"/>
711  </target>
712
713  <target name="dist-visbio"
714    depends="dist-visbio-win32, dist-visbio-win32-nojre, dist-visbio-macosx,
715      dist-visbio-linux, dist-visbio-nojre"
716    description="create distribution bundles for VisBio"/>
717
718  <target name="dist-visbio-win32" depends="jar-visbio, jar-formats"
719    description="create distribution bundle for VisBio: Windows w/ JRE">
720    <copy todir="${visbio.win32-dir}/VisBio" preservelastmodified="true">
721      <fileset dir="dist/visbio/win32"/>
722      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/>
723      <fileset dir="${jar.dir}" includes="${visbio.jar} ${visbio.classpath}"/>
724    </copy>
725    <fixcrlf srcdir="${visbio.win32-dir}/VisBio" eol="dos"
726      includes="${visbio.text-files}"/>
727    <untar src="dist/jre-win32.tar.gz" dest="${visbio.win32-dir}/VisBio"
728      overwrite="false" compression="gzip"/>
729    <zip destfile="${dist.dir}/visbio${visbio.version}_win32.zip"
730      basedir="${visbio.win32-dir}"/>
731  </target>
732
733  <target name="dist-visbio-win32-nojre" depends="jar-visbio, jar-formats"
734    description="create distribution bundle for VisBio: Windows no JRE">
735    <copy todir="${visbio.win32-nojre-dir}/VisBio"
736      preservelastmodified="true">
737      <fileset dir="dist/visbio/win32" excludes="launcher.cfg"/>
738      <fileset dir="dist/visbio/win32-nojre"/>
739      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/>
740      <fileset dir="${jar.dir}" includes="${visbio.jar} ${visbio.classpath}"/>
741    </copy>
742    <fixcrlf srcdir="${visbio.win32-nojre-dir}/VisBio" eol="dos"
743      includes="${visbio.text-files}"/>
744    <zip destfile="${dist.dir}/visbio${visbio.version}_win32_nojre.zip"
745      basedir="${visbio.win32-nojre-dir}"/>
746  </target>
747
748  <!-- HACK - limit OS to *nix due to file permission issues -->
749  <target name="dist-visbio-macosx" if="isUnix"
750    depends="jar-visbio, jar-formats"
751    description="create distribution bundle for VisBio: Mac OS X">
752    <copy todir="${visbio.macosx-dir}/VisBio"
753      preservelastmodified="true">
754      <fileset dir="dist/visbio/macosx"/>
755      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/>
756    </copy>
757    <fixcrlf srcdir="${visbio.macosx-dir}/VisBio" eol="mac"
758      includes="${visbio.text-files}"/>
759    <!-- HACK - copy does not preserve permissions; chmod them back -->
760    <chmod perm="+x">
761      <fileset dir="${visbio.macosx-dir}/VisBio"
762        includes="${visbio.macosx-exec}"/>
763    </chmod>
764    <copy
765      todir="${visbio.macosx-dir}/VisBio/VisBio.app/Contents/Resources/Java">
766      <fileset dir="${jar.dir}" includes="${visbio.jar} ${visbio.classpath}"/>
767    </copy>
768<!--
769    <tar destfile="${dist.dir}/visbio${visbio.version}_macosx.tar.gz"
770      basedir="${visbio.macosx-dir}" compression="gzip"/>
771-->
772    <!-- HACK - tar does not preserve permissions; use exec instead -->
773    <echo>Building tar: visbio${visbio.version}_macosx.tar.gz</echo>
774    <exec executable="tar">
775      <arg value="czf"/>
776      <arg value="${dist.dir}/visbio${visbio.version}_macosx.tar.gz"/>
777      <arg value="-C"/>
778      <arg value="${visbio.macosx-dir}"/>
779      <arg value="VisBio"/>
780    </exec>
781  </target>
782
783  <!-- HACK - limit OS to *nix due to file permission issues -->
784  <target name="dist-visbio-linux" if="isUnix"
785    depends="jar-visbio, jar-formats"
786    description="create distribution bundle for VisBio: Linux w/ JRE">
787    <copy todir="${visbio.linux-dir}/visbio${visbio.version}"
788      preservelastmodified="true">
789      <fileset dir="dist/visbio/linux"/>
790      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/>
791      <fileset dir="${jar.dir}" includes="${visbio.jar} ${visbio.classpath}"/>
792    </copy>
793    <fixcrlf srcdir="${visbio.linux-dir}/visbio${visbio.version}" eol="unix"
794      includes="${visbio.text-files}"/>
795    <!-- HACK - copy does not preserve permissions; chmod them back -->
796    <chmod perm="+x">
797      <fileset dir="${visbio.linux-dir}/visbio${visbio.version}"
798        includes="${visbio.linux-exec}"/>
799    </chmod>
800<!--
801    <untar src="dist/jre-linux.tar.gz"
802      dest="${visbio.linux-dir}/visbio${visbio.version}"
803      overwrite="false" compression="gzip"/>
804-->
805    <!-- HACK - untar does not restore permissions; use exec instead -->
806    <echo>Expanding: jre-linux.tar.gz</echo>
807    <exec executable="tar">
808      <arg value="xzf"/>
809      <arg value="dist/jre-linux.tar.gz"/>
810      <arg value="-C"/>
811      <arg value="${visbio.linux-dir}/visbio${visbio.version}"/>
812    </exec>
813<!--
814    <tar destfile="${dist.dir}/visbio${visbio.version}_linux.tar.gz"
815      basedir="${visbio.linux-dir}" compression="gzip"/>
816-->
817    <!-- HACK - tar does not preserve permissions; use exec instead -->
818    <echo>Building tar: visbio${visbio.version}_linux.tar.gz</echo>
819    <exec executable="tar">
820      <arg value="czf"/>
821      <arg value="${dist.dir}/visbio${visbio.version}_linux.tar.gz"/>
822      <arg value="-C"/>
823      <arg value="${visbio.linux-dir}"/>
824      <arg value="visbio${visbio.version}"/>
825    </exec>
826  </target>
827
828  <!-- HACK - limit OS to *nix due to file permission issues -->
829  <target name="dist-visbio-nojre" if="isUnix"
830    depends="jar-visbio, jar-formats"
831    description="create distribution bundle for VisBio: cross-platform">
832    <copy todir="${visbio.nojre-dir}/visbio${visbio.version}"
833      preservelastmodified="true">
834      <fileset dir="dist/visbio/linux"/>
835      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/>
836      <fileset dir="${jar.dir}" includes="${visbio.jar} ${visbio.classpath}"/>
837    </copy>
838    <fixcrlf srcdir="${visbio.nojre-dir}/visbio${visbio.version}" eol="unix"
839      includes="${visbio.text-files}"/>
840    <!-- HACK - copy does not preserve permissions; chmod them back -->
841    <chmod perm="+x">
842      <fileset dir="${visbio.nojre-dir}/visbio${visbio.version}"
843        includes="${visbio.linux-exec}"/>
844    </chmod>
845<!--
846    <tar destfile="${dist.dir}/visbio${visbio.version}.tar.gz"
847      basedir="${visbio.nojre-dir}" compression="gzip"/>
848-->
849    <!-- HACK - tar does not preserve permissions; use exec instead -->
850    <echo>Building tar: visbio${visbio.version}.tar.gz</echo>
851    <exec executable="tar">
852      <arg value="czf"/>
853      <arg value="${dist.dir}/visbio${visbio.version}.tar.gz"/>
854      <arg value="-C"/>
855      <arg value="${visbio.nojre-dir}"/>
856      <arg value="visbio${visbio.version}"/>
857    </exec>
858  </target>
859
860  <!-- LOCI Plugins for ImageJ -->
861
862  <target name="style-plugins" depends="copy-source, jar-checks"
863    description="check source code style for LOCI Plugins for ImageJ">
864    <checkstyle config="checkstyle.xml" failOnViolation="false">
865      <fileset dir="${dest.dir}" includes="${plugins.source}"/>
866    </checkstyle>
867  </target>
868
869  <target name="compile-plugins" depends="copy-source"
870    description="compile classes for LOCI Plugins for ImageJ">
871    <mkdir dir="${classes.dir}"/>
872    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
873      includes="${plugins.source}" classpath="${ext.jars}"
874      debug="true" deprecation="true" source="1.4" target="1.4"/>
875  </target>
876
877  <target name="jar-plugins" depends="compile-plugins, copy-jars, jar-formats"
878    description="generate JAR file for LOCI Plugins for ImageJ">
879    <jar jarfile="${jar.dir}/${plugins.jar}" basedir="${src.dir}/loci/plugins"
880      includes="plugins.config IJ_Props.txt">
881      <manifest>
882        <attribute name="Main-Class" value="${plugins.main}"/>
883      </manifest>
884    </jar>
885    <jar jarfile="${jar.dir}/${plugins.jar}" basedir="${classes.dir}"
886      includes="${plugins.files}"
887      excludes="loci/plugins/plugins.config loci/plugins/IJ_Props.txt"
888      update="true">
889    </jar>
890  </target>
891
892  <!-- OME Notes -->
893
894  <target name="style-notes" depends="copy-source, jar-checks"
895    description="check source code style for OME Notes">
896    <checkstyle config="checkstyle.xml" failOnViolation="false">
897      <fileset dir="${dest.dir}" includes="${notes.source}"/>
898    </checkstyle>
899  </target>
900
901  <target name="compile-notes" depends="copy-source"
902    description="compile classes for OME Notes">
903    <mkdir dir="${classes.dir}"/>
904    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
905      includes="${notes.source}" classpath="${ext.jars}"
906      debug="true" deprecation="true" source="1.4" target="1.4"/>
907  </target>
908
909  <target name="jar-notes"
910    depends="compile-notes, copy-jars, jar-formats"
911    description="generate JAR file for OME Notes">
912    <jar jarfile="${jar.dir}/${notes.jar}" basedir="${classes.dir}"
913      includes="${notes.files}">
914      <manifest>
915        <attribute name="Main-Class" value="${notes.main}"/>
916        <attribute name="Class-Path" value="${notes.classpath}"/>
917      </manifest>
918    </jar>
919  </target>
920
921  <!-- JVMLink -->
922
923  <target name="style-jvmlink" depends="copy-source, jar-checks"
924    description="check source code style for JVMLink">
925    <checkstyle config="checkstyle.xml" failOnViolation="false">
926      <fileset dir="${dest.dir}" includes="${jvmlink.source}"/>
927    </checkstyle>
928  </target>
929
930  <target name="compile-jvmlink" depends="copy-source"
931    description="compile classes for JVMLink">
932    <mkdir dir="${classes.dir}"/>
933    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
934      includes="${jvmlink.source}" classpath="${ext.jars}"
935      debug="true" deprecation="true" source="1.4" target="1.4"/>
936  </target>
937
938  <target name="jar-jvmlink"
939    depends="compile-formats, compile-jvmlink, copy-jars"
940    description="generate JAR file for JVMLink">
941    <jar jarfile="${jar.dir}/${jvmlink.jar}" basedir="${classes.dir}"
942      includes="${jvmlink.files}">
943      <manifest>
944        <attribute name="Main-Class" value="${jvmlink.main}"/>
945        <!--<attribute name="Class-Path" value="${jvmlink.classpath}"/>-->
946      </manifest>
947    </jar>
948  </target>
949
950  <!-- Slim Plotter -->
951
952  <target name="style-slim" depends="copy-source, jar-checks"
953    description="check source code style for Slim Plotter">
954    <checkstyle config="checkstyle.xml" failOnViolation="false">
955      <fileset dir="${dest.dir}" includes="${slim.source}"/>
956    </checkstyle>
957  </target>
958
959  <target name="compile-slim" depends="copy-source"
960    description="compile classes for Slim Plotter">
961    <mkdir dir="${classes.dir}"/>
962    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
963      includes="${slim.source}" classpath="${ext.jars}"
964      debug="true" deprecation="true" source="1.4" target="1.4"/>
965  </target>
966
967  <target name="jar-slim" depends="compile-slim, copy-jars"
968    description="generate JAR file for Slim Plotter">
969    <jar jarfile="${jar.dir}/${slim.jar}" basedir="${classes.dir}"
970      includes="${slim.files}">
971      <manifest>
972        <attribute name="Main-Class" value="${slim.main}"/>
973        <attribute name="Class-Path" value="${slim.classpath}"/>
974      </manifest>
975    </jar>
976  </target>
977
978  <target name="dist-slim" if="isUnix"
979    depends="copy-jars, jar-formats, jar-slim"
980    description="create distribution bundle for Slim Plotter">
981    <copy todir="${slim.dist-dir}" preservelastmodified="true">
982      <fileset dir="dist/slim"/>
983      <fileset dir="${jar.dir}" includes="${slim.jar} ${slim.classpath}"/>
984    </copy>
985    <!-- HACK - copy does not preserve permissions; chmod them back -->
986    <chmod perm="+x">
987      <fileset dir="${slim.dist-dir}" includes="${slim.exec}"/>
988    </chmod>
989<!--
990    <zip destfile="${dist.dir}/slim.zip" basedir="${dist.dir}/slim"/>
991-->
992    <!-- HACK - zip does not preserve permissions; use exec instead -->
993    <exec executable="zip" dir="${dist.dir}/slim">
994      <arg value="-r9"/>
995      <arg value="../slim.zip"/>
996      <arg value="SlimPlotter"/>
997    </exec>
998  </target>
999
1000  <!-- OME Metadata Editor -->
1001
1002  <target name="style-editor" depends="copy-source, jar-checks"
1003    description="check source code style for OME Metadata Editor">
1004    <checkstyle config="checkstyle.xml" failOnViolation="false">
1005      <fileset dir="${dest.dir}" includes="${editor.source}"/>
1006    </checkstyle>
1007  </target>
1008
1009  <target name="compile-editor" depends="copy-source"
1010    description="compile classes for OME Metadata Editor">
1011    <mkdir dir="${classes.dir}"/>
1012    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
1013      includes="${editor.source}" classpath="${ext.jars}"
1014      debug="true" deprecation="true" source="1.4" target="1.4"/>
1015  </target>
1016
1017  <target name="jar-editor"
1018    depends="compile-editor, copy-jars, jar-formats"
1019    description="generate JAR file for OME Metadata Editor">
1020    <jar jarfile="${jar.dir}/${editor.jar}" basedir="${classes.dir}"
1021      includes="${editor.files}">
1022      <manifest>
1023        <attribute name="Main-Class" value="${editor.main}"/>
1024        <attribute name="Class-Path" value="${editor.classpath}"/>
1025      </manifest>
1026    </jar>
1027  </target>
1028
1029  <!-- Automated tests -->
1030
1031  <target name="style-tests" depends="copy-source, jar-checks"
1032    description="check source code style for testing framework">
1033    <checkstyle config="checkstyle.xml" failOnViolation="false">
1034      <fileset dir="${dest.dir}" includes="${tests.source}"/>
1035    </checkstyle>
1036  </target>
1037
1038  <target name="compile-tests" depends="copy-source"
1039    description="compile classes for testing framework">
1040    <mkdir dir="${classes.dir}"/>
1041    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
1042      includes="${tests.source}" classpath="${ext.jars}"
1043      debug="true" deprecation="true" source="1.4" target="1.4"/>
1044  </target>
1045
1046  <!-- LOCI Checkstyle checks -->
1047
1048  <target name="style-checks" depends="copy-source, jar-checks"
1049    description="check source code style for LOCI Checkstyle checks">
1050    <checkstyle config="checkstyle.xml" failOnViolation="false">
1051      <fileset dir="${dest.dir}" includes="${checks.source}"/>
1052    </checkstyle>
1053  </target>
1054
1055  <target name="compile-checks" depends="copy-source"
1056    description="compile classes for LOCI Checkstyle checks">
1057    <mkdir dir="${classes.dir}"/>
1058    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
1059      includes="${checks.source}" classpath="${ext.jars}"
1060      debug="true" deprecation="true" source="1.4" target="1.4"/>
1061  </target>
1062
1063  <target name="jar-checks" depends="compile-checks, copy-jars"
1064    description="generate JAR file for LOCI Checkstyle checks">
1065    <jar jarfile="${jar.dir}/${checks.jar}" basedir="${classes.dir}"
1066      includes="${checks.files}">
1067      <manifest>
1068        <attribute name="Main-Class" value="${checks.main}"/>
1069        <attribute name="Class-Path" value="${checks.classpath}"/>
1070      </manifest>
1071    </jar>
1072  </target>
1073
1074  <!-- ImageJ -->
1075
1076  <target name="ij-jws" depends="tools"
1077    description="create JAR file encompassing ImageJ plus LOCI plugins">
1078    <for list="${ij-jws.libraries}" param="jar" delimiter=" " trim="true">
1079      <sequential>
1080        <unjar src="${jar.dir}/@{jar}" dest="${ij-jws.dir}">
1081          <patternset>
1082            <exclude name="META-INF/**"/>
1083          </patternset>
1084        </unjar>
1085      </sequential>
1086    </for>
1087    <jar jarfile="${jar.dir}/${ij-jws.jar}" basedir="${ij-jws.dir}">
1088      <manifest>
1089        <attribute name="Main-Class" value="${ij-jws.main}"/>
1090      </manifest>
1091    </jar>
1092    <delete dir="${ij-jws.dir}"/>
1093  </target>
1094
1095</project>
Note: See TracBrowser for help on using the repository browser.