source: trunk/build.xml @ 1313

Revision 1313, 17.7 KB checked in by curtis, 14 years ago (diff)

Add targets for VisBio source and docs; split properties into separate file.

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:  None
17    Targets:       jar-formats
18
19VisBio
20    JAR file:      visbio.jar
21    Folders:       loci/visbio
22                   loci/visbio/*
23    Main class:    loci.visbio.VisBio
24    Dependencies:  bio-formats.jar
25                   commons-httpclient-2.0-rc2.jar (ome-java.jar)
26                   commons-logging.jar (ome-java.jar)
27                   forms-1.0.4.jar
28                   ij.jar
29                   looks-1.2.2.jar
30                   ome-java.jar
31                   visad-lite.jar
32                   xmlrpc-1.2-b1.jar (ome-java.jar)
33    Targets:       jar-visbio
34                   source-visbio
35                   docs-visbio
36                   dist-visbio
37
38LOCI Plugins for ImageJ
39    JAR file:      loci_plugins.jar
40    Folders:       loci/plugins
41                   loci/plugins/*
42                   loci/ome/viewer (temporary)
43    Main class:    loci.plugins.About
44    IJ plugins:    loci.plugins.browser.LociDataBrowser
45                   loci.plugins.LociImporter
46                   loci.plugins.LociExporter
47                   loci.plugins.ome.OMEPlugin
48    Dependencies:  bio-formats.jar
49                   commons-httpclient-2.0-rc2.jar (ome-java.jar)
50                   commons-logging.jar (ome-java.jar)
51                   ome-java.jar
52                   xmlrpc-1.2-b1.jar (ome-java.jar)
53    Targets:       jar-plugins
54
55OME Metadata Notebook
56    JAR file:      ome-notebook.jar
57    Folders:       loci/ome/notebook
58                   loci/ome/viewer (temporary)
59    Main class:    loci.ome.notebook.MetadataNotebook
60    Dependencies:  bio-formats.jar
61                   commons-httpclient-2.0-rc2.jar (ome-java.jar)
62                   commons-logging.jar (ome-java.jar)
63                   forms-1.0.4.jar
64                   ome-java.jar
65                   xmlrpc-1.2-b1.jar (ome-java.jar)
66    Targets:       jar-notebook
67
68Leica Converter
69    JAR file:      LeicaConverter.jar
70    Folders:       loci/apps/leica
71    Main class:    loci.apps.leica.LeicaConverter
72    Dependencies:  bio-formats.jar
73                   ome-java.jar
74    Targets:       jar-leica
75
76QT TIFF Converter
77    JAR file:      QTConverter.jar
78    Folders:       loci/apps/qt
79                   some loci/formats
80    Main class:    loci.apps.qt.QTConverter
81    Dependencies:  None (custom built)
82    Targets:       jar-qt
83
84Slim Plotter
85    JAR file:      SlimPlotter.jar
86    Folders:       loci/apps/slim
87                   some loci/formats and loci/visbio
88    Main class:    loci.apps.slim.SlimPlotter
89    Dependencies:  visad-lite.jar
90    Targets:       jar-slim
91                   dist-slim
92
93===============================================================================
94The following external dependencies (in the jar folder) may be required:
95
96Apple eAWT stubs
97    JAR file:  AppleJavaExtensions.jar
98    URL:       http://developer.apple.com/samplecode/AppleJavaExtensions/
99    Notes:     Required to compile VisBio on non-Mac OS X machines
100
101Apache Jakarta Commons HttpClient
102    JAR file:  commons-httpclient-2.0-rc2.jar
103    URL:       http://jakarta.apache.org/commons/httpclient/
104    Notes:     Required for OME Java to communicate with OME servers
105
106Apache Jakarta Commons Logging
107    JAR file:  commons-logging.jar
108    URL:       http://jakarta.apache.org/commons/logging/
109    Notes:     Used by OME Java
110
111JGoodies Forms
112    JAR file:  forms-1.0.4.jar
113    URL:       http://www.jgoodies.com/freeware/forms/index.html
114    Notes:     Used for layout by VisBio and OME Metadata Notebook
115
116ImageJ
117    JAR file:  ij.jar
118    URL:       http://rsb.info.nih.gov/ij/
119    Notes:     Bundled with VisBio to achieve ImageJ interconnectivity
120
121JGoodies Looks
122    JAR file:  looks-1.2.2.jar
123    URL:       http://www.jgoodies.com/freeware/looks/index.html
124    Notes:     Used for a nicer Look & Feel by VisBio
125
126OME Java
127    JAR file:  ome-java.jar
128    URL:       http://openmicroscopy.org/api/java/
129    Notes:     Used by VisBio and the OME Plugin for ImageJ to connect to OME;
130               used by Bio-Formats and the OME Notebook to work with OME-XML
131
132Apache Jakarta POI
133    JAR file:  poi-2.5.1-final-20040804.jar
134    URL:       http://jakarta.apache.org/poi/
135    Notes:     Not used (previously used by Bio-Formats)
136
137Skin Look and Feel
138    JAR file:  skinlf.jar
139    URL:       http://skinlf.l2fprod.com/
140    Notes:     Not used (may be used in the future for flexible skinning)
141
142VisAD
143    JAR file:  visad-lite.jar
144    URL:       http://www.ssec.wisc.edu/~billh/visad.html
145    Notes:     Stripped down VisAD library used by VisBio and Slim Plotter
146
147Apache XML-RPC
148    JAR file:  xmlrpc-1.2-b1.jar
149    URL:       http://ws.apache.org/xmlrpc/
150    Notes:     Required for OME Java to communicate with OME servers
151-->
152
153<project name="LOCI Software" default="compile" basedir=".">
154  <description>
155    Master build file for all Java software projects at LOCI
156  </description>
157
158  <property resource="build.properties"/>
159  <property file="${user.home}/.ant-global.properties"/>
160
161  <condition property="isUnix"><os family="unix"/></condition>
162
163  <!-- Global build targets -->
164
165  <target name="init">
166    <tstamp>
167      <format property="DATE" pattern="d MMMMM yyyy"/>
168      <format property="YEAR" pattern="yyyy"/>
169    </tstamp>
170  </target>
171
172  <target name="compile" depends="copy-source"
173    description="compile LOCI software packages from source">
174    <mkdir dir="${classes.dir}"/>
175    <javac srcdir="${dest.dir}" destdir="${classes.dir}"
176      classpath="${ext.jars}" deprecation="true" source="1.4" target="1.4"/>
177  </target>
178
179  <target name="jars"
180    depends="jar-formats, jar-visbio, jar-plugins, jar-notebook, jar-leica, jar-qt, jar-slim"
181    description="generate JAR files for LOCI software packages"/>
182
183  <target name="docs" depends="copy-source"
184    description="generate Javadocs for LOCI software packages">
185    <javadoc sourcepath="${dest.dir}" destdir="${docs.dir}/api"
186      author="true" version="true" use="true" windowtitle="LOCI Software API">
187      <packageset dir="${dest.dir}"/>
188      <doctitle><![CDATA[<h1>LOCI Software</h1>]]></doctitle>
189      <bottom><![CDATA[${copyright}]]></bottom>
190      <link href="http://java.sun.com/j2se/1.4.2/docs/api/"/>
191    </javadoc>
192  </target>
193
194  <target name="clean" description="remove all build files">
195    <delete dir="${build.dir}"/>
196  </target>
197
198  <!-- Internal build targets -->
199
200  <target name="copy-source" depends="init">
201    <!-- copy binary files without filtering -->
202    <copy todir="${dest.dir}" preservelastmodified="true">
203      <fileset dir="${src.dir}" includes="loci/**"
204        excludes="**/*.class **/*.java **/*.config **/*.txt ${ignore.source}"/>
205    </copy>
206    <!-- copy source files with filtering -->
207    <filter token="date" value="${DATE}"/>
208    <copy todir="${dest.dir}" filtering="true" preservelastmodified="true">
209      <fileset dir="${src.dir}" includes="loci/**"
210        excludes="**/*.class ${ignore.source}"/>
211    </copy>
212  </target>
213
214  <target name="copy-jars">
215    <!-- copy needed external JARs into build jars folder -->
216    <copy todir="${jar.dir}" preservelastmodified="true">
217      <fileset dir="jar"/>
218    </copy>
219  </target>
220
221  <!-- Bio-Formats -->
222
223  <target name="jar-formats" depends="compile"
224    description="generate JAR file for Bio-Formats">
225    <copy todir="${classes.dir}" preservelastmodified="true">
226      <fileset dir="${src.dir}" includes="${formats.resources}"/>
227    </copy>
228    <mkdir dir="${jar.dir}"/>
229    <jar jarfile="${jar.dir}/bio-formats.jar" basedir="${classes.dir}"
230      includes="${formats.files}">
231      <manifest>
232        <attribute name="Main-Class" value="loci.formats.ImageViewer"/>
233      </manifest>
234    </jar>
235  </target>
236
237  <!-- VisBio -->
238
239  <target name="jar-visbio" depends="compile, copy-jars, jar-formats"
240    description="generate JAR file for VisBio">
241    <copy todir="${classes.dir}" preservelastmodified="true">
242      <fileset dir="${src.dir}" includes="${visbio.resources}"/>
243    </copy>
244    <jar jarfile="${jar.dir}/visbio.jar" basedir="${classes.dir}"
245      includes="${visbio.files}">
246      <manifest>
247        <attribute name="Main-Class" value="loci.visbio.VisBio"/>
248        <attribute name="Class-Path" value="${visbio.classpath}"/>
249      </manifest>
250    </jar>
251  </target>
252
253  <target name="source-visbio" depends="copy-source"
254    description="generate source bundle for VisBio">
255    <zip zipfile="${build.dir}/visbio_src.zip" basedir="${dest.dir}"
256      includes="loci/visbio/**"/>
257  </target>
258
259  <target name="docs-visbio" depends="copy-source"
260    description="generate Javadocs for VisBio">
261    <javadoc sourcepath="${dest.dir}" destdir="${visbio.docs-dir}/docs/api"
262      author="true" version="true" use="true" windowtitle="LOCI Software API">
263      <packageset dir="${dest.dir}" includes="loci/visbio/**"/>
264      <doctitle><![CDATA[<h1>VisBio</h1>]]></doctitle>
265      <bottom><![CDATA[${copyright}]]></bottom>
266      <link href="http://java.sun.com/j2se/1.4.2/docs/api/"/>
267    </javadoc>
268    <zip zipfile="${build.dir}/visbio_docs.zip" basedir="${visbio.docs-dir}"/>
269  </target>
270
271  <target name="dist-visbio" depends="dist-visbio-win32, dist-visbio-win32-nojre, dist-visbio-macosx, dist-visbio-linux, dist-visbio-nojre"/>
272
273  <target name="dist-visbio-win32" depends="jar-visbio, jar-formats">
274    <copy todir="${visbio.win32-dir}" preservelastmodified="true">
275      <fileset dir="dist/visbio/win32"/>
276      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/>
277      <fileset dir="${jar.dir}" includes="visbio.jar ${visbio.classpath}"/>
278    </copy>
279    <fixcrlf srcdir="${visbio.win32-dir}" eol="dos"
280      includes="*.txt *.cpp *.m plugins/*.txt"/>
281    <untar src="dist/jre-win32.tar.gz" dest="${visbio.win32-dir}"
282      overwrite="false" compression="gzip"/>
283    <zip destfile="${dist.dir}/visbio${visbio.version}_win32.zip"
284      basedir="${dist.dir}/visbio/win32"/>
285  </target>
286
287  <target name="dist-visbio-win32-nojre" depends="jar-visbio, jar-formats">
288    <copy todir="${visbio.win32-nojre-dir}"
289      preservelastmodified="true">
290      <fileset dir="dist/visbio/win32" excludes="launcher.cfg"/>
291      <fileset dir="dist/visbio/win32-nojre"/>
292      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/>
293      <fileset dir="${jar.dir}" includes="visbio.jar ${visbio.classpath}"/>
294    </copy>
295    <fixcrlf srcdir="${visbio.win32-nojre-dir}" eol="dos"
296      includes="*.txt *.cpp *.m plugins/*.txt"/>
297    <zip destfile="${dist.dir}/visbio${visbio.version}_win32_nojre.zip"
298      basedir="${dist.dir}/visbio/win32-nojre"/>
299  </target>
300
301  <!-- HACK - limit OS to *nix due to file permission issues -->
302  <target name="dist-visbio-macosx" if="isUnix"
303    depends="jar-visbio, jar-formats">
304    <copy todir="${visbio.macosx-dir}"
305      preservelastmodified="true">
306      <fileset dir="dist/visbio/macosx"/>
307      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/>
308    </copy>
309    <fixcrlf srcdir="${visbio.macosx-dir}" eol="mac"
310      includes="*.txt *.cpp *.m plugins/*.txt"/>
311    <!-- HACK - copy does not preserve permissions; chmod them back -->
312    <chmod perm="+x">
313      <fileset dir="${visbio.macosx-dir}"
314        includes="visbio omeul VisBio.app/Contents/MacOS/JavaApplicationStub"/>
315    </chmod>
316    <copy todir="${visbio.macosx-dir}/VisBio.app/Contents/Resources/Java">
317      <fileset dir="${jar.dir}" includes="visbio.jar ${visbio.classpath}"/>
318    </copy>
319<!--
320    <tar destfile="${dist.dir}/visbio${visbio.version}_macosx.tar.gz"
321      basedir="${dist.dir}/visbio/macosx" compression="gzip"/>
322-->
323    <!-- HACK - tar does not preserve permissions; use exec instead -->
324    <exec executable="tar">
325      <arg value="czf"/>
326      <arg value="${dist.dir}/visbio${visbio.version}_macosx.tar.gz"/>
327      <arg value="-C"/>
328      <arg value="${dist.dir}/visbio/macosx VisBio"/>
329    </exec>
330  </target>
331
332  <!-- HACK - limit OS to *nix due to file permission issues -->
333  <target name="dist-visbio-linux" if="isUnix"
334    depends="jar-visbio, jar-formats">
335    <copy todir="${visbio.linux-dir}" preservelastmodified="true">
336      <fileset dir="dist/visbio/linux"/>
337      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/>
338      <fileset dir="${jar.dir}" includes="visbio.jar ${visbio.classpath}"/>
339    </copy>
340    <fixcrlf srcdir="${visbio.linux-dir}" eol="unix"
341      includes="*.txt *.cpp *.m plugins/*.txt"/>
342    <!-- HACK - copy does not preserve permissions; chmod them back -->
343    <chmod perm="+x">
344      <fileset dir="${visbio.linux-dir}" includes="visbio omeul"/>
345    </chmod>
346<!--
347    <untar src="dist/jre-linux.tar.gz" dest="${visbio.linux-dir}"
348      overwrite="false" compression="gzip"/>
349-->
350    <!-- HACK - untar does not restore permissions; use exec instead -->
351    <exec executable="tar">
352      <arg value="xzf"/>
353      <arg value="dist/jre-linux.tar.gz"/>
354      <arg value="-C"/>
355      <arg value="${visbio.linux-dir}"/>
356    </exec>
357<!--
358    <tar destfile="${dist.dir}/visbio${visbio.version}_linux.tar.gz"
359      basedir="${dist.dir}/visbio/linux" compression="gzip"/>
360-->
361    <!-- HACK - tar does not preserve permissions; use exec instead -->
362    <exec executable="tar">
363      <arg value="czf"/>
364      <arg value="${dist.dir}/visbio${visbio.version}_linux.tar.gz"/>
365      <arg value="-C"/>
366      <arg value="${dist.dir}/visbio/linux visbio${visbio.version}"/>
367    </exec>
368  </target>
369
370  <!-- HACK - limit OS to *nix due to file permission issues -->
371  <target name="dist-visbio-nojre" if="isUnix"
372    depends="jar-visbio, jar-formats">
373    <copy todir="${visbio.nojre-dir}" preservelastmodified="true">
374      <fileset dir="dist/visbio/linux"/>
375      <fileset dir="loci/visbio" includes="${visbio.dist-files}"/>
376      <fileset dir="${jar.dir}" includes="visbio.jar ${visbio.classpath}"/>
377    </copy>
378    <fixcrlf srcdir="${visbio.nojre-dir}" eol="unix"
379      includes="*.txt *.cpp *.m plugins/*.txt"/>
380    <!-- HACK - copy does not preserve permissions; chmod them back -->
381    <chmod perm="+x">
382      <fileset dir="${visbio.nojre-dir}" includes="visbio omeul"/>
383    </chmod>
384<!--
385    <tar destfile="${dist.dir}/visbio${visbio.version}.tar.gz"
386      basedir="${dist.dir}/visbio/nojre" compression="gzip"/>
387-->
388    <!-- HACK - tar does not preserve permissions; use exec instead -->
389    <exec executable="tar">
390      <arg value="czf"/>
391      <arg value="${dist.dir}/visbio${visbio.version}.tar.gz"/>
392      <arg value="-C"/>
393      <arg value="${dist.dir}/visbio/nojre visbio${visbio.version}"/>
394    </exec>
395  </target>
396
397  <!-- LOCI Plugins for ImageJ -->
398
399  <target name="jar-plugins" depends="compile, copy-jars, jar-formats"
400    description="generate JAR file for LOCI Plugins for ImageJ">
401    <jar jarfile="${jar.dir}/loci_plugins.jar"
402      basedir="${src.dir}/loci/plugins" includes="plugins.config">
403      <manifest>
404        <attribute name="Main-Class" value="loci.plugins.About"/>
405      </manifest>
406    </jar>
407    <jar jarfile="${jar.dir}/loci_plugins.jar" basedir="${classes.dir}"
408      includes="${plugins.files}" excludes="loci/plugins/plugins.config"
409      update="true">
410    </jar>
411  </target>
412
413  <!-- OME Metadata Notebook -->
414
415  <target name="jar-notebook" depends="compile, copy-jars, jar-formats"
416    description="generate JAR file for OME Metadata Notebook">
417    <copy todir="${classes.dir}" preservelastmodified="true">
418      <fileset dir="${src.dir}" includes="${notebook.resources}"/>
419    </copy>
420    <jar jarfile="${jar.dir}/ome-notebook.jar" basedir="${classes.dir}"
421      includes="${notebook.files}">
422      <manifest>
423        <attribute name="Main-Class"
424          value="loci.ome.notebook.MetadataNotebook"/>
425        <attribute name="Class-Path" value="${notebook.classpath}"/>
426      </manifest>
427    </jar>
428  </target>
429
430  <!-- Leica Converter -->
431
432  <target name="jar-leica" depends="compile, copy-jars, jar-formats"
433    description="generate JAR file for Leica Converter">
434    <jar jarfile="${jar.dir}/LeicaConverter.jar" basedir="${classes.dir}"
435      includes="${leica.files}">
436      <manifest>
437        <attribute name="Main-Class" value="loci.apps.leica.LeicaConverter"/>
438        <attribute name="Class-Path" value="${leica.classpath}"/>
439      </manifest>
440    </jar>
441  </target>
442
443  <!-- QT TIFF Converter -->
444
445  <target name="jar-qt" depends="compile"
446    description="generate JAR file for QT TIFF Converter">
447    <mkdir dir="${jar.dir}"/>
448    <jar jarfile="${jar.dir}/QTConverter.jar" basedir="${classes.dir}"
449      includes="${qt.files}">
450      <manifest>
451        <attribute name="Main-Class" value="loci.apps.qt.QTConverter"/>
452      </manifest>
453    </jar>
454  </target>
455
456  <!-- Slim Plotter -->
457
458  <target name="jar-slim" depends="compile, copy-jars"
459    description="generate JAR file for Slim Plotter">
460    <jar jarfile="${jar.dir}/SlimPlotter.jar" basedir="${classes.dir}"
461      includes="${slim.files}">
462      <manifest>
463        <attribute name="Main-Class" value="loci.apps.slim.SlimPlotter"/>
464        <attribute name="Class-Path" value="${slim.classpath}"/>
465      </manifest>
466    </jar>
467  </target>
468
469  <target name="dist-slim" if="isUnix" depends="copy-jars, jar-slim">
470    <copy todir="${slim.dist-dir}" preservelastmodified="true">
471      <fileset dir="dist/slim"/>
472      <fileset dir="${jar.dir}" includes="SlimPlotter.jar ${slim.classpath}"/>
473    </copy>
474    <!-- HACK - copy does not preserve permissions; chmod them back -->
475    <chmod perm="+x">
476      <fileset dir="${slim.dist-dir}" includes="slim"/>
477    </chmod>
478<!--
479    <zip destfile="${dist.dir}/slim.zip" basedir="${dist.dir}/slim"/>
480-->
481    <!-- HACK - zip does not preserve permissions; use exec instead -->
482    <exec executable="zip" dir="${dist.dir}/slim">
483      <arg value="-r9"/>
484      <arg value="../slim.zip"/>
485      <arg value="SlimPlotter"/>
486    </exec>
487  </target>
488
489</project>
Note: See TracBrowser for help on using the repository browser.