source: trunk/build.xml @ 1916

Revision 1916, 30.4 KB checked in by curtis, 13 years ago (diff)

Change JJ2000 to JAI Image I/O in ant build files.

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