source: trunk/build.xml @ 1793

Revision 1793, 30.3 KB checked in by curtis, 14 years ago (diff)

Propagate year variable.

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