source: trunk/build.xml @ 1732

Revision 1732, 29.1 KB checked in by curtis, 14 years ago (diff)

Propagate visbio.version variable to source code properly.

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="dev-compile" description="compile classes in-place (no copy)">
309    <javac srcdir="loci" destdir="." debug="true"
310      classpath="${ext.jars}" deprecation="true" source="1.4" target="1.4"/>
311  </target>
312
313  <target name="dev-clean" description="remove classes in-place (no copy)">
314    <delete>
315      <fileset dir="." includes="loci/**/*.class"/>
316    </delete>
317  </target>
318
319  <!-- Internal build targets -->
320
321  <target name="copy-source" depends="init">
322    <!-- copy binary files without filtering -->
323    <copy todir="${dest.dir}" preservelastmodified="true">
324      <fileset dir="${src.dir}" includes="loci/**"
325        excludes="**/*.class **/*.java **/*.config **/*.txt ${ignore.source}"/>
326    </copy>
327    <!-- copy source files with filtering -->
328    <filter token="date" value="${DATE}"/>
329    <filter token="visbio.version" value="${visbio.version}"/>
330    <copy todir="${dest.dir}" filtering="true" preservelastmodified="true">
331      <fileset dir="${src.dir}" includes="loci/**"
332        excludes="**/*.class ${ignore.source}"/>
333    </copy>
334  </target>
335
336  <target name="copy-jars">
337    <!-- copy needed external JARs into build jars folder -->
338    <copy todir="${jar.dir}" preservelastmodified="true">
339      <fileset dir="jar"/>
340    </copy>
341  </target>
342
343  <!-- Bio-Formats -->
344
345  <target name="style-formats" depends="copy-source, jar-checks"
346    description="check source code style for Bio-Formats">
347    <checkstyle config="checkstyle.xml" failOnViolation="false">
348      <fileset dir="${dest.dir}" includes="${formats.source}"/>
349    </checkstyle>
350  </target>
351
352  <target name="compile-formats" depends="copy-source"
353    description="compile classes for Bio-Formats">
354    <mkdir dir="${classes.dir}"/>
355    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
356      includes="${formats.source}" classpath="${ext.jars}"
357      debug="true" deprecation="true" source="1.4" target="1.4"/>
358  </target>
359
360  <target name="jar-formats" depends="compile-formats, copy-jars"
361    description="generate JAR file for Bio-Formats">
362    <copy todir="${classes.dir}" preservelastmodified="true">
363      <fileset dir="${src.dir}" includes="${formats.resources}"/>
364    </copy>
365    <mkdir dir="${jar.dir}"/>
366    <jar jarfile="${jar.dir}/${formats.jar}" basedir="${classes.dir}"
367      includes="${formats.files}">
368      <manifest>
369        <attribute name="Main-Class" value="${formats.main}"/>
370        <attribute name="Class-Path" value="${formats.classpath}"/>
371      </manifest>
372    </jar>
373  </target>
374
375  <!-- VisBio -->
376
377  <target name="style-visbio" depends="copy-source, jar-checks"
378    description="check source code style for VisBio">
379    <checkstyle config="checkstyle.xml" failOnViolation="false">
380      <fileset dir="${dest.dir}" includes="${visbio.source}"/>
381    </checkstyle>
382  </target>
383
384  <target name="compile-visbio" depends="copy-source"
385    description="compile classes for VisBio">
386    <mkdir dir="${classes.dir}"/>
387    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
388      includes="${visbio.source}" classpath="${ext.jars}"
389      debug="true" deprecation="true" source="1.4" target="1.4"/>
390  </target>
391
392  <target name="jar-visbio" depends="compile-visbio, copy-jars, jar-formats"
393    description="generate JAR file for VisBio">
394    <copy todir="${classes.dir}" preservelastmodified="true">
395      <fileset dir="${src.dir}" includes="${visbio.resources}"/>
396    </copy>
397    <jar jarfile="${jar.dir}/${visbio.jar}" basedir="${classes.dir}"
398      includes="${visbio.files}">
399      <manifest>
400        <attribute name="Main-Class" value="${visbio.main}"/>
401        <attribute name="Class-Path" value="${visbio.classpath}"/>
402      </manifest>
403    </jar>
404  </target>
405
406  <target name="source-visbio" depends="copy-source"
407    description="generate source bundle for VisBio">
408    <zip zipfile="${build.dir}/visbio_src.zip" basedir="${dest.dir}"
409      includes="loci/visbio/**"/>
410  </target>
411
412  <target name="docs-visbio" depends="copy-source"
413    description="generate Javadocs for VisBio">
414    <javadoc sourcepath="${dest.dir}" destdir="${visbio.docs-dir}/docs/api"
415      author="true" version="true" use="true" windowtitle="LOCI Software API">
416      <packageset dir="${dest.dir}" includes="loci/visbio/**"/>
417      <doctitle><![CDATA[<h1>VisBio</h1>]]></doctitle>
418      <bottom><![CDATA[${copyright}]]></bottom>
419      <link href="http://java.sun.com/j2se/1.4.2/docs/api/"/>
420    </javadoc>
421    <zip zipfile="${build.dir}/visbio_docs.zip" basedir="${visbio.docs-dir}"/>
422  </target>
423
424  <target name="dist-visbio"
425    depends="dist-visbio-win32, dist-visbio-win32-nojre, dist-visbio-macosx,
426      dist-visbio-linux, dist-visbio-nojre"
427    description="create distribution bundles for VisBio"/>
428
429  <target name="dist-visbio-win32" depends="jar-visbio, jar-formats"
430    description="create distribution bundle for VisBio: Windows w/ JRE">
431    <copy todir="${visbio.win32-dir}/VisBio" preservelastmodified="true">
432      <fileset dir="dist/visbio/win32"/>
433      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/>
434      <fileset dir="${jar.dir}" includes="visbio.jar ${visbio.classpath}"/>
435    </copy>
436    <fixcrlf srcdir="${visbio.win32-dir}/VisBio" eol="dos"
437      includes="${visbio.text-files}"/>
438    <untar src="dist/jre-win32.tar.gz" dest="${visbio.win32-dir}/VisBio"
439      overwrite="false" compression="gzip"/>
440    <zip destfile="${dist.dir}/visbio${visbio.version}_win32.zip"
441      basedir="${visbio.win32-dir}"/>
442  </target>
443
444  <target name="dist-visbio-win32-nojre" depends="jar-visbio, jar-formats"
445    description="create distribution bundle for VisBio: Windows no JRE">
446    <copy todir="${visbio.win32-nojre-dir}/VisBio"
447      preservelastmodified="true">
448      <fileset dir="dist/visbio/win32" excludes="launcher.cfg"/>
449      <fileset dir="dist/visbio/win32-nojre"/>
450      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/>
451      <fileset dir="${jar.dir}" includes="visbio.jar ${visbio.classpath}"/>
452    </copy>
453    <fixcrlf srcdir="${visbio.win32-nojre-dir}/VisBio" eol="dos"
454      includes="${visbio.text-files}"/>
455    <zip destfile="${dist.dir}/visbio${visbio.version}_win32_nojre.zip"
456      basedir="${visbio.win32-nojre-dir}"/>
457  </target>
458
459  <!-- HACK - limit OS to *nix due to file permission issues -->
460  <target name="dist-visbio-macosx" if="isUnix"
461    depends="jar-visbio, jar-formats"
462    description="create distribution bundle for VisBio: Mac OS X">
463    <copy todir="${visbio.macosx-dir}/VisBio"
464      preservelastmodified="true">
465      <fileset dir="dist/visbio/macosx"/>
466      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/>
467    </copy>
468    <fixcrlf srcdir="${visbio.macosx-dir}/VisBio" eol="mac"
469      includes="${visbio.text-files}"/>
470    <!-- HACK - copy does not preserve permissions; chmod them back -->
471    <chmod perm="+x">
472      <fileset dir="${visbio.macosx-dir}/VisBio"
473        includes="${visbio.macosx-exec}"/>
474    </chmod>
475    <copy
476      todir="${visbio.macosx-dir}/VisBio/VisBio.app/Contents/Resources/Java">
477      <fileset dir="${jar.dir}" includes="visbio.jar ${visbio.classpath}"/>
478    </copy>
479<!--
480    <tar destfile="${dist.dir}/visbio${visbio.version}_macosx.tar.gz"
481      basedir="${visbio.macosx-dir}" compression="gzip"/>
482-->
483    <!-- HACK - tar does not preserve permissions; use exec instead -->
484    <echo>Building tar: visbio${visbio.version}_macosx.tar.gz</echo>
485    <exec executable="tar">
486      <arg value="czf"/>
487      <arg value="${dist.dir}/visbio${visbio.version}_macosx.tar.gz"/>
488      <arg value="-C"/>
489      <arg value="${visbio.macosx-dir}"/>
490      <arg value="VisBio"/>
491    </exec>
492  </target>
493
494  <!-- HACK - limit OS to *nix due to file permission issues -->
495  <target name="dist-visbio-linux" if="isUnix"
496    depends="jar-visbio, jar-formats"
497    description="create distribution bundle for VisBio: Linux w/ JRE">
498    <copy todir="${visbio.linux-dir}/visbio${visbio.version}"
499      preservelastmodified="true">
500      <fileset dir="dist/visbio/linux"/>
501      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/>
502      <fileset dir="${jar.dir}" includes="visbio.jar ${visbio.classpath}"/>
503    </copy>
504    <fixcrlf srcdir="${visbio.linux-dir}/visbio${visbio.version}" eol="unix"
505      includes="${visbio.text-files}"/>
506    <!-- HACK - copy does not preserve permissions; chmod them back -->
507    <chmod perm="+x">
508      <fileset dir="${visbio.linux-dir}/visbio${visbio.version}"
509        includes="${visbio.linux-exec}"/>
510    </chmod>
511<!--
512    <untar src="dist/jre-linux.tar.gz"
513      dest="${visbio.linux-dir}/visbio${visbio.version}"
514      overwrite="false" compression="gzip"/>
515-->
516    <!-- HACK - untar does not restore permissions; use exec instead -->
517    <echo>Expanding: jre-linux.tar.gz</echo>
518    <exec executable="tar">
519      <arg value="xzf"/>
520      <arg value="dist/jre-linux.tar.gz"/>
521      <arg value="-C"/>
522      <arg value="${visbio.linux-dir}/visbio${visbio.version}"/>
523    </exec>
524<!--
525    <tar destfile="${dist.dir}/visbio${visbio.version}_linux.tar.gz"
526      basedir="${visbio.linux-dir}" compression="gzip"/>
527-->
528    <!-- HACK - tar does not preserve permissions; use exec instead -->
529    <echo>Building tar: visbio${visbio.version}_linux.tar.gz</echo>
530    <exec executable="tar">
531      <arg value="czf"/>
532      <arg value="${dist.dir}/visbio${visbio.version}_linux.tar.gz"/>
533      <arg value="-C"/>
534      <arg value="${visbio.linux-dir}"/>
535      <arg value="visbio${visbio.version}"/>
536    </exec>
537  </target>
538
539  <!-- HACK - limit OS to *nix due to file permission issues -->
540  <target name="dist-visbio-nojre" if="isUnix"
541    depends="jar-visbio, jar-formats"
542    description="create distribution bundle for VisBio: cross-platform">
543    <copy todir="${visbio.nojre-dir}/visbio${visbio.version}"
544      preservelastmodified="true">
545      <fileset dir="dist/visbio/linux"/>
546      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/>
547      <fileset dir="${jar.dir}" includes="visbio.jar ${visbio.classpath}"/>
548    </copy>
549    <fixcrlf srcdir="${visbio.nojre-dir}/visbio${visbio.version}" eol="unix"
550      includes="${visbio.text-files}"/>
551    <!-- HACK - copy does not preserve permissions; chmod them back -->
552    <chmod perm="+x">
553      <fileset dir="${visbio.nojre-dir}/visbio${visbio.version}"
554        includes="${visbio.linux-exec}"/>
555    </chmod>
556<!--
557    <tar destfile="${dist.dir}/visbio${visbio.version}.tar.gz"
558      basedir="${visbio.nojre-dir}" compression="gzip"/>
559-->
560    <!-- HACK - tar does not preserve permissions; use exec instead -->
561    <echo>Building tar: visbio${visbio.version}.tar.gz</echo>
562    <exec executable="tar">
563      <arg value="czf"/>
564      <arg value="${dist.dir}/visbio${visbio.version}.tar.gz"/>
565      <arg value="-C"/>
566      <arg value="${visbio.nojre-dir}"/>
567      <arg value="visbio${visbio.version}"/>
568    </exec>
569  </target>
570
571  <!-- LOCI Plugins for ImageJ -->
572
573  <target name="style-plugins" depends="copy-source, jar-checks"
574    description="check source code style for LOCI Plugins for ImageJ">
575    <checkstyle config="checkstyle.xml" failOnViolation="false">
576      <fileset dir="${dest.dir}" includes="${plugins.source}"/>
577    </checkstyle>
578  </target>
579
580  <target name="compile-plugins" depends="copy-source"
581    description="compile classes for LOCI Plugins for ImageJ">
582    <mkdir dir="${classes.dir}"/>
583    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
584      includes="${plugins.source}" classpath="${ext.jars}"
585      debug="true" deprecation="true" source="1.4" target="1.4"/>
586  </target>
587
588  <target name="jar-plugins" depends="compile-plugins, copy-jars, jar-formats"
589    description="generate JAR file for LOCI Plugins for ImageJ">
590    <jar jarfile="${jar.dir}/${plugins.jar}" basedir="${src.dir}/loci/plugins"
591      includes="plugins.config IJ_Props.txt">
592      <manifest>
593        <attribute name="Main-Class" value="${plugins.main}"/>
594      </manifest>
595    </jar>
596    <jar jarfile="${jar.dir}/${plugins.jar}" basedir="${classes.dir}"
597      includes="${plugins.files}"
598      excludes="loci/plugins/plugins.config loci/plugins/IJ_Props.txt"
599      update="true">
600    </jar>
601  </target>
602
603  <!-- OME Metadata Notebook -->
604
605  <target name="style-notebook" depends="copy-source, jar-checks"
606    description="check source code style for OME Metadata Notebook">
607    <checkstyle config="checkstyle.xml" failOnViolation="false">
608      <fileset dir="${dest.dir}" includes="${notebook.source}"/>
609    </checkstyle>
610  </target>
611
612  <target name="compile-notebook" depends="copy-source"
613    description="compile classes for OME Metadata Notebook">
614    <mkdir dir="${classes.dir}"/>
615    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
616      includes="${notebook.source}" classpath="${ext.jars}"
617      debug="true" deprecation="true" source="1.4" target="1.4"/>
618  </target>
619
620  <target name="jar-notebook"
621    depends="compile-notebook, copy-jars, jar-formats"
622    description="generate JAR file for OME Metadata Notebook">
623    <copy todir="${classes.dir}" preservelastmodified="true">
624      <fileset dir="${src.dir}" includes="${notebook.resources}"/>
625    </copy>
626    <jar jarfile="${jar.dir}/${notebook.jar}" basedir="${classes.dir}"
627      includes="${notebook.files}">
628      <manifest>
629        <attribute name="Main-Class" value="${notebook.main}"/>
630        <attribute name="Class-Path" value="${notebook.classpath}"/>
631      </manifest>
632    </jar>
633  </target>
634
635  <!-- Leica Converter -->
636
637  <target name="style-leica" depends="copy-source, jar-checks"
638    description="check source code style for Leica Converter">
639    <checkstyle config="checkstyle.xml" failOnViolation="false">
640      <fileset dir="${dest.dir}" includes="${leica.source}"/>
641    </checkstyle>
642  </target>
643
644  <target name="compile-leica" depends="copy-source"
645    description="compile classes for Leica Converter">
646    <mkdir dir="${classes.dir}"/>
647    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
648      includes="${leica.source}" classpath="${ext.jars}"
649      debug="true" deprecation="true" source="1.4" target="1.4"/>
650  </target>
651
652  <target name="jar-leica" depends="compile-leica, copy-jars, jar-formats"
653    description="generate JAR file for Leica Converter">
654    <jar jarfile="${jar.dir}/${leica.jar}" basedir="${classes.dir}"
655      includes="${leica.files}">
656      <manifest>
657        <attribute name="Main-Class" value="${leica.main}"/>
658        <attribute name="Class-Path" value="${leica.classpath}"/>
659      </manifest>
660    </jar>
661  </target>
662
663  <!-- Movie Stitcher -->
664
665  <target name="style-stitcher" depends="copy-source, jar-checks"
666    description="check source code style for Movie Stitcher">
667    <checkstyle config="checkstyle.xml" failOnViolation="false">
668      <fileset dir="${dest.dir}" includes="${stitcher.source}"/>
669    </checkstyle>
670  </target>
671
672  <target name="compile-stitcher" depends="copy-source"
673    description="compile classes for Movie Stitcher">
674    <mkdir dir="${classes.dir}"/>
675    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
676      includes="${stitcher.source}" classpath="${ext.jars}"
677      debug="true" deprecation="true" source="1.4" target="1.4"/>
678  </target>
679
680  <target name="jar-stitcher" depends="compile-stitcher"
681    description="generate JAR file for Movie Stitcher">
682    <mkdir dir="${jar.dir}"/>
683    <jar jarfile="${jar.dir}/${stitcher.jar}" basedir="${classes.dir}"
684      includes="${stitcher.files}">
685      <manifest>
686        <attribute name="Main-Class" value="${stitcher.main}"/>
687        <attribute name="Class-Path" value="${stitcher.classpath}"/>
688      </manifest>
689    </jar>
690  </target>
691
692  <!-- Slim Plotter -->
693
694  <target name="style-slim" depends="copy-source, jar-checks"
695    description="check source code style for Slim Plotter">
696    <checkstyle config="checkstyle.xml" failOnViolation="false">
697      <fileset dir="${dest.dir}" includes="${slim.source}"/>
698    </checkstyle>
699  </target>
700
701  <target name="compile-slim" depends="copy-source"
702    description="compile classes for Slim Plotter">
703    <mkdir dir="${classes.dir}"/>
704    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
705      includes="${slim.source}" classpath="${ext.jars}"
706      debug="true" deprecation="true" source="1.4" target="1.4"/>
707  </target>
708
709  <target name="jar-slim" depends="compile-slim, copy-jars"
710    description="generate JAR file for Slim Plotter">
711    <jar jarfile="${jar.dir}/${slim.jar}" basedir="${classes.dir}"
712      includes="${slim.files}">
713      <manifest>
714        <attribute name="Main-Class" value="${slim.main}"/>
715        <attribute name="Class-Path" value="${slim.classpath}"/>
716      </manifest>
717    </jar>
718  </target>
719
720  <target name="dist-slim" if="isUnix" depends="copy-jars, jar-slim"
721    description="create distribution bundle for Slim Plotter">
722    <copy todir="${slim.dist-dir}" preservelastmodified="true">
723      <fileset dir="${dist.dir}/slim"/>
724      <fileset dir="${jar.dir}" includes="SlimPlotter.jar ${slim.classpath}"/>
725    </copy>
726    <!-- HACK - copy does not preserve permissions; chmod them back -->
727    <chmod perm="+x">
728      <fileset dir="${slim.dist-dir}" includes="${slim.exec}"/>
729    </chmod>
730<!--
731    <zip destfile="${dist.dir}/slim.zip" basedir="${dist.dir}/slim"/>
732-->
733    <!-- HACK - zip does not preserve permissions; use exec instead -->
734    <exec executable="zip" dir="${dist.dir}/slim">
735      <arg value="-r9"/>
736      <arg value="../slim.zip"/>
737      <arg value="SlimPlotter"/>
738    </exec>
739  </target>
740
741  <!-- LOCI Checkstyle checks -->
742
743  <target name="style-checks" depends="copy-source, jar-checks"
744    description="check source code style for LOCI Checkstyle checks">
745    <checkstyle config="checkstyle.xml" failOnViolation="false">
746      <fileset dir="${dest.dir}" includes="${checks.source}"/>
747    </checkstyle>
748  </target>
749
750  <target name="compile-checks" depends="copy-source"
751    description="compile classes for LOCI Checkstyle checks">
752    <mkdir dir="${classes.dir}"/>
753    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
754      includes="${checks.source}" classpath="${ext.jars}"
755      debug="true" deprecation="true" source="1.4" target="1.4"/>
756  </target>
757
758  <target name="jar-checks" depends="compile-checks, copy-jars"
759    description="generate JAR file for LOCI Checkstyle checks">
760    <copy todir="${classes.dir}" preservelastmodified="true">
761      <fileset dir="${src.dir}" includes="${checks.resources}"/>
762    </copy>
763    <jar jarfile="${jar.dir}/${checks.jar}" basedir="${classes.dir}"
764      includes="${checks.files}">
765      <manifest>
766        <attribute name="Main-Class" value="${checks.main}"/>
767        <attribute name="Class-Path" value="${checks.classpath}"/>
768      </manifest>
769    </jar>
770  </target>
771
772  <!-- ImageJ -->
773
774  <target name="ij-jws" depends="jars"
775    description="create JAR file encompassing ImageJ plus LOCI plugins">
776    <for list="${ij-jws.libraries}" param="jar" delimiter=" " trim="true">
777      <sequential>
778        <unjar src="${jar.dir}/@{jar}" dest="${ij-jws.dir}">
779          <patternset>
780            <exclude name="META-INF/**"/>
781          </patternset>
782        </unjar>
783      </sequential>
784    </for>
785    <jar jarfile="${jar.dir}/${ij-jws.jar}" basedir="${ij-jws.dir}">
786      <manifest>
787        <attribute name="Main-Class" value="${ij-jws.main}"/>
788      </manifest>
789    </jar>
790    <delete dir="${ij-jws.dir}"/>
791  </target>
792
793</project>
Note: See TracBrowser for help on using the repository browser.