source: trunk/build.xml @ 3347

Revision 3347, 31.4 KB checked in by curtis, 12 years ago (diff)

Exclude loci.formats.auto package from bio-formats.jar build.

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