source: trunk/build.xml @ 1742

Revision 1742, 29.7 KB checked in by curtis, 14 years ago (diff)

Fix bug in dist-slim target.

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