source: trunk/build.xml @ 1289

Revision 1289, 18.3 KB checked in by curtis, 14 years ago (diff)

Migrate VisBio distribution build system into build.xml.

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