source: trunk/build.xml @ 3379

Revision 3379, 32.7 KB checked in by curtis, 13 years ago (diff)

Move native code to libs folder; update build script.

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