source: trunk/scan-deps.pl @ 6521

Revision 6521, 31.9 KB checked in by curtis, 10 years ago (diff)

Use explicit version number for JUnit JAR.

  • Property svn:executable set to *
RevLine 
[4531]1#!/usr/bin/perl
2use strict;
3
4# scan-deps.pl - Scans source code to determine project interdependencies,
[4608]5#                as well as dependencies on external libraries.
[4531]6
[4532]7# This script was used to autogenerate the project dependency documentation in
8# the build.xml file's top-level comment, as well as verify the correctness of
9# the component.classpath field in each component's build.properties file.
[4531]10
[4533]11# TODO - Use this script to autogenerate the LOCI plugins configuration file:
12#   components/loci-plugins/src/loci/plugins/config/libraries.txt
13
[4559]14# TODO - Use this script to check build.xml's depends clauses.
15
[4608]16use constant {
17  NAME      => 0,  # short name, for ease of reference
18  TITLE     => 1,  # human-friendly title for each component and library
19  PATH      => 2,  # source code path for each component
20  JAR       => 3,  # JAR file name for each component and library
21  PACKAGE   => 4,  # base package for each component and library
22  DESC      => 5,  # description for each component
23  LICENSE   => 6,  # license governing each component and library
[6050]24  URL       => 7,  # URL for each external project (forks, stubs & libs)
25  NOTES     => 8,  # notes for each external project (forks, stubs & libs)
[4608]26  PROJ_DEPS => 9,  # compile-time project dependencies for each component
27  PROJ_OPT  => 10, # runtime project dependencies for each component
28  LIB_DEPS  => 11, # compile-time library dependencies for each component
29  LIB_OPT   => 12, # runtime library dependencies for each component
30  COMPILE   => 13, # compile-time classpath for each component
31  RUNTIME   => 14, # runtime classpath for each component
[4609]32  ECLIPSE   => 15, # Eclipse classpath for each component
[6026]33  VERSION   => 16, # version number for each library
[4608]34};
[4532]35
[4608]36# -- COMPONENT DEFINITIONS - ACTIVE --
[4532]37
[5488]38my %autogen = (
39  NAME    => "autogen",
40  TITLE   => "LOCI code generator",
41  PATH    => "components/autogen",
42  JAR     => "loci-autogen.jar",
[4612]43  PACKAGE => "(none)",
[4608]44  DESC    => <<ZZ,
[5488]45Package for generating other code, including the Bio-Formats metadata API,
46related documentation, Ice bindings, and Bio-Formats C++ bindings headers
[4608]47ZZ
48  LICENSE => "GPL",
[4531]49);
50
[5488]51my %bfIce = (
52  NAME    => "bf-ice",
[4608]53  TITLE   => "Bio-Formats Ice framework",
[5488]54  PATH    => "components/bf-ice",
55  JAR     => "bf-ice.jar",
[4608]56  PACKAGE => "loci.ice.formats",
57  DESC    => <<ZZ,
58Bindings for Bio-Formats client/server communication enabling cross-language
59interoperability
60ZZ
61  LICENSE => "GPL",
[4531]62);
63
[6050]64my %bioFormats = (
65  NAME    => "bio-formats",
66  TITLE   => "Bio-Formats",
67  PATH    => "components/bio-formats",
68  JAR     => "bio-formats.jar",
69  PACKAGE => "loci.formats",
[4608]70  DESC    => <<ZZ,
[6050]71A library for reading and writing popular microscopy file formats
[4608]72ZZ
73  LICENSE => "GPL",
[4531]74);
75
[4608]76my %flowCytometry = (
77  NAME    => "flow-cytometry",
78  TITLE   => "WiscScan Flow Cytometry",
79  PATH    => "components/flow-cytometry",
80  JAR     => "flow-cytometry.jar",
81  PACKAGE => "loci.apps.flow",
82  DESC    => <<ZZ,
83Server application for flow cytometry with WiscScan using JVMLink
84ZZ
85  LICENSE => "BSD",
[4531]86);
87
[4608]88my %lociChecks = (
89  NAME    => "loci-checks",
90  TITLE   => "LOCI Checkstyle checks",
91  PATH    => "components/checkstyle",
92  JAR     => "loci-checks.jar",
93  PACKAGE => "loci.checks",
94  DESC    => <<ZZ,
95LOCI's Checkstyle extensions, for checking source code style
96ZZ
97  LICENSE => "Public domain",
[4531]98);
99
[6050]100my %lociCommon = (
101  NAME    => "common",
102  TITLE   => "LOCI Common",
103  PATH    => "components/common",
104  JAR     => "loci-common.jar",
105  PACKAGE => "loci.common",
106  DESC    => <<ZZ,
107A library containing common I/O and reflection classes
108ZZ
109  LICENSE => "GPL",
110);
111
[4608]112my %lociPlugins = (
113  NAME    => "loci-plugins",
114  TITLE   => "LOCI Plugins for ImageJ",
115  PATH    => "components/loci-plugins",
116  JAR     => "loci_plugins.jar",
117  PACKAGE => "loci.plugins",
118  DESC    => <<ZZ,
[4532]119A collection of plugins for ImageJ, including the Bio-Formats Importer,
120Bio-Formats Exporter, Bio-Formats Macro Extensions, Data Browser, Stack
121Colorizer and Stack Slicer
122ZZ
[4608]123  LICENSE => "GPL",
124);
125
126my %omeIO = (
127  NAME    => "ome-io",
128  TITLE   => "OME I/O",
129  PATH    => "components/ome-io",
130  JAR     => "ome-io.jar",
131  PACKAGE => "loci.ome.io",
132  DESC    => <<ZZ,
[4532]133A library for OME database import, upload and download
134ZZ
[4608]135  LICENSE => "GPL",
136);
137
138my %omePlugins = (
139  NAME    => "ome-plugins",
140  TITLE   => "OME Plugins for ImageJ",
141  PATH    => "components/ome-plugins",
142  JAR     => "ome_plugins.jar",
143  PACKAGE => "loci.plugins.ome",
144  DESC    => <<ZZ,
[4532]145A collection of plugins for ImageJ, including the Download from OME and Upload
146to OME plugins
147ZZ
[4608]148  LICENSE => "GPL",
149);
150
151my %omeXML = (
152  NAME    => "ome-xml",
153  TITLE   => "OME-XML Java library",
154  PATH    => "components/ome-xml",
155  JAR     => "ome-xml.jar",
156  PACKAGE => "ome.xml",
157  DESC    => <<ZZ,
[4532]158A library for working with OME-XML metadata structures
159ZZ
[4608]160  LICENSE => "GPL",
161);
162
163my %slimPlotter = (
164  NAME    => "slim-plotter",
165  TITLE   => "SLIM Plotter",
166  PATH    => "components/slim-plotter",
167  JAR     => "SlimPlotter.jar",
168  PACKAGE => "loci.slim",
169  DESC    => <<ZZ,
[4532]170An application and curve fitting library for visualization and analysis of
171combined spectral lifetime data
172ZZ
[4608]173  LICENSE => "GPL",
174);
175
176my %testSuite = (
177  NAME    => "test-suite",
178  TITLE   => "LOCI testing framework",
179  PATH    => "components/test-suite",
180  JAR     => "loci-testing-framework.jar",
181  PACKAGE => "loci.tests",
182  DESC    => <<ZZ,
[4532]183Framework for automated and manual testing of the LOCI software packages
184ZZ
[4608]185  LICENSE => "BSD",
186);
187
188my %visbio = (
189  NAME    => "visbio",
190  TITLE   => "VisBio",
191  PATH    => "components/visbio",
192  JAR     => "visbio.jar",
193  PACKAGE => "loci.visbio",
194  DESC    => <<ZZ,
[4532]195A multi-purpose biological analysis tool
196ZZ
[4608]197  LICENSE => "GPL",
198);
199
200# -- COMPONENT DEFINITIONS - LEGACY --
201
202my %jvmlink = (
203  NAME    => "jvmlink",
204  TITLE   => "JVMLink",
205  PATH    => "components/legacy/jvmlink",
206  JAR     => "jvmlink.jar",
207  PACKAGE => "loci.jvmlink",
208  DESC    => <<ZZ,
[4532]209A library for communicating between a Java Virtual Machine and other programs
210(e.g., C++ applications) via IP over localhost (or remotely)
211ZZ
[4608]212  LICENSE => "BSD",
213);
214
215my %multiLUT = (
216  NAME    => "multi-lut",
217  TITLE   => "Multi-LUT",
218  PATH    => "components/legacy/multi-lut",
219  JAR     => "MultiLUT.jar",
220  PACKAGE => "loci.apps",
221  DESC    => <<ZZ,
[4532]222A demo application for visually exploring  multi-spectral image data
223ZZ
[4608]224  LICENSE => "Public domain",
225);
226
227my %omeEditor = (
228  NAME    => "ome-editor",
229  TITLE   => "OME Metadata Editor",
230  PATH    => "components/legacy/ome-editor",
231  JAR     => "ome-editor.jar",
232  PACKAGE => "loci.ome.editor",
233  DESC    => <<ZZ,
[4532]234An application for exploration and editing of OME-XML and OME-TIFF metadata
235ZZ
[4608]236  LICENSE => "LGPL",
237);
238
239my %omeNotes = (
240  NAME    => "ome-notes",
241  TITLE   => "OME Notes",
242  PATH    => "components/legacy/ome-notes",
243  JAR     => "ome-notes.jar",
244  PACKAGE => "loci.ome.notes",
245  DESC    => <<ZZ,
[4532]246A library for flexible organization and presentation of OME-XML metadata within
247a graphical browser and editor interface
248ZZ
[4608]249  LICENSE => "LGPL",
[4531]250);
251
[4608]252# -- COMPONENT DEFINITIONS - FORKS --
[4531]253
[4608]254my %jai = (
255  NAME    => "jai",
256  TITLE   => "JAI Image I/O Tools",
257  PATH    => "components/forks/jai",
258  JAR     => "jai_imageio.jar",
259  PACKAGE => "com.sun.media.imageioimpl",
260  DESC    => <<ZZ,
261Java API to handle JPEG and JPEG2000 files
262ZZ
263  LICENSE => "BSD",
264  URL     => "http://jai-imageio.dev.java.net/",
265  NOTES   => <<ZZ,
[4532]266Used by Bio-Formats to read images compressed with JPEG2000 and lossless JPEG.
267Modified from the 2008-10-14 source to include support for the YCbCr color
268space. Several files in the com.sun.media.jai packages were removed, as they
269are not needed by Bio-Formats, and created an additional dependency. This
270component will be removed once our changes have been added to the official JAI
271CVS repository.
272ZZ
[4608]273);
274
275my %mdbtools = (
276  NAME    => "mdbtools",
277  TITLE   => "MDB Tools (Java port)",
278  PATH    => "components/forks/mdbtools",
279  JAR     => "mdbtools-java.jar",
280  PACKAGE => "mdbtools",
281  DESC    => <<ZZ,
282Java API to handle Microsoft MDB format (Access)
283ZZ
284  LICENSE => "LGPL",
285  URL     => "http://sourceforge.net/forum/message.php?msg_id=2550619",
286  NOTES   => <<ZZ,
[4532]287Used by Bio-Formats for Zeiss LSM metadata in MDB files.
288ZZ
[4608]289);
290
291my %poi = (
292  NAME    => "poi",
293  TITLE   => "Apache Jakarta POI",
294  PATH    => "components/forks/poi",
295  JAR     => "poi-loci.jar",
[4779]296  PACKAGE => "loci.poi",
[4608]297  DESC    => <<ZZ,
298Java API to handle Microsoft OLE 2 Compound Document format (Word, Excel)
299ZZ
300  LICENSE => "Apache",
301  URL     => "http://jakarta.apache.org/poi/",
302  NOTES   => <<ZZ,
[4532]303Based on poi-2.5.1-final-20040804.jar, with bugfixes for OLE v2 and memory
304efficiency improvements. Used by Bio-Formats for OLE support (cxd, ipw, oib,
305zvi). Used by VisBio overlays logic for XLS export feature.
306ZZ
[4608]307);
308
[6050]309# -- COMPONENT DEFINITIONS - STUBS --
310
311my %lwfStubs = (
312  NAME    => "lwf-stubs",
313  TITLE   => "Luratech LuraWave stubs",
314  PATH    => "components/stubs/lwf-stubs",
315  JAR     => "lwf-stubs.jar",
316  PACKAGE => "com.luratech.lwf",
317  DESC    => <<ZZ,
318Stub of proprietary Java API to handle Luratech LWF compression
319ZZ
320  LICENSE => "BSD",
321  URL     => "http://www.luratech.com/",
322  NOTES   => <<ZZ,
323required to compile Bio-Formats's support for Luratech LWF compression for
324the Opera Flex format
325ZZ
326);
327
[4608]328# -- LIBRARY DEFINITIONS --
329
330my %appleJavaExtensions = (
331  NAME    => "AppleJavaExtensions",
332  TITLE   => "Apple eAWT stubs",
333  JAR     => "AppleJavaExtensions.jar",
334  PACKAGE => "com.apple",
335  LICENSE => "BSD",
336  URL     => "http://developer.apple.com/samplecode/AppleJavaExtensions/",
337  NOTES   => <<ZZ,
[6045]338required to compile Mac-specific functionality on non-Mac OS X machines
[4532]339ZZ
[4608]340);
341
342my %antContrib = (
343  NAME    => "ant-contrib",
344  TITLE   => "Ant-Contrib",
[6026]345  JAR     => "ant-contrib-1.0b3.jar",
[4608]346  PACKAGE => "net.sf.antcontrib",
347  LICENSE => "Apache",
348  URL     => "http://ant-contrib.sourceforge.net/",
349  NOTES   => <<ZZ,
[4532]350used by tools target to iterate over JAR files ("for" task)
351ZZ
[6026]352  VERSION => "1.0b3"
[4608]353);
354
355my %checkstyle = (
356  NAME    => "checkstyle",
357  TITLE   => "Checkstyle",
[6026]358  JAR     => "checkstyle-all-5.0.jar",
[4608]359  PACKAGE => "com.puppycrawl.tools.checkstyle",
360  LICENSE => "LGPL",
361  URL     => "http://checkstyle.sourceforge.net/",
362  NOTES   => <<ZZ,
[4612]363used by style Ant target to check source code style conventions
[4532]364ZZ
[6026]365  VERSION => "5.0"
[4608]366);
367
368my %commonsHTTPClient = (
369  NAME    => "commons-httpclient",
370  TITLE   => "Apache Jakarta Commons HttpClient",
371  JAR     => "commons-httpclient-2.0-rc2.jar",
372  PACKAGE => "org.apache.commons.httpclient",
373  LICENSE => "Apache",
374  URL     => "http://jakarta.apache.org/commons/httpclient/",
375  NOTES   => <<ZZ,
[4532]376required for OME-Java to communicate with OME servers
377ZZ
[6026]378  VERSION => "2.0-rc2"
[4608]379);
380
381my %commonsLogging = (
382  NAME    => "commons-logging",
383  TITLE   => "Apache Jakarta Commons Logging",
384  JAR     => "commons-logging.jar",
385  PACKAGE => "org.apache.commons.logging",
386  LICENSE => "Apache",
387  URL     => "http://jakarta.apache.org/commons/logging/",
388  NOTES   => <<ZZ,
[4532]389used by OME-Java
390ZZ
[6026]391  VERSION => "1.0.3"
[4608]392);
393
394my %findbugs = (
395  NAME    => "findbugs",
396  TITLE   => "FindBugs Ant task",
397  JAR     => "findbugs-ant.jar",
398  PACKAGE => "edu.umd.cs.findbugs.anttask",
399  LICENSE => "LGPL",
400  URL     => "http://findbugs.sourceforge.net/",
401  NOTES   => <<ZZ,
[4594]402used by findbugs Ant target to check for program bugs
403ZZ
[6026]404  VERSION => "1.3.9"
[4608]405);
406
407my %forms = (
408  NAME    => "forms",
409  TITLE   => "JGoodies Forms",
[6026]410  JAR     => "forms-1.3.0.jar",
[4608]411  PACKAGE => "com.jgoodies.forms",
412  LICENSE => "BSD",
413  URL     => "http://www.jgoodies.com/freeware/forms/index.html",
414  NOTES   => <<ZZ,
[4532]415used for layout by VisBio, Data Browser and OME Notes
416ZZ
[6026]417  VERSION => "1.3.0"
[4608]418);
419
420my %ice = (
421  NAME    => "ice",
422  TITLE   => "Ice",
[5488]423  JAR     => "Ice-3.3.1.jar",
[4608]424  PACKAGE => "Ice",
425  LICENSE => "GPL",
426  URL     => "http://www.zeroc.com/ice.html",
427  NOTES   => <<ZZ,
[4563]428used by Bio-Formats Ice framework
429ZZ
[6026]430  VERSIOn => "3.3.1"
[4608]431);
432
433my %ij = (
434  NAME    => "ij",
435  TITLE   => "ImageJ",
436  JAR     => "ij.jar",
437  PACKAGE => "ij",
438  LICENSE => "Public domain",
439  URL     => "http://rsb.info.nih.gov/ij/",
440  NOTES   => <<ZZ,
[4532]441used by LOCI plugins for ImageJ and OME plugins for ImageJ; bundled with VisBio
442to achieve ImageJ interconnectivity
443ZZ
[6026]444  VERSION => "1.43o"
[4608]445);
446
447my %jiio = (
448  NAME    => "jiio",
449  TITLE   => "JAI ImageIO wrapper",
450  JAR     => "clibwrapper_jiio.jar",
451  PACKAGE => "com.sun.medialib.codec",
452  LICENSE => "BSD",
453  URL     => "https://jai-imageio.dev.java.net/",
454  NOTES   => <<ZZ,
[4532]455used by Bio-Formats via reflection for JPEG2000 support (ND2, JP2) and lossless
456JPEG decompression (DICOM)
457ZZ
[6026]458  VERSION => "1.1"
[4608]459);
460
461my %junit = (
462  NAME    => "junit",
463  TITLE   => "JUnit",
[6521]464  JAR     => "junit-4.8.2.jar",
[6517]465  PACKAGE => ".*junit",
[4608]466  LICENSE => "Common Public License",
467  URL     => "http://www.junit.org/",
468  NOTES   => <<ZZ,
[4532]469unit testing framework used for a few VisBio unit tests
470ZZ
[6521]471  VERSION => "4.8.2"
[4608]472);
473
474my %lma = (
475  NAME    => "lma",
476  TITLE   => "L-M Fit",
477  JAR     => "lma.jar",
478  PACKAGE => "jaolho.data.lma",
479  LICENSE => "LGPL",
480  URL     => "http://users.utu.fi/jaolho/",
481  NOTES   => <<ZZ,
[4532]482Levenberg-Marquardt algorithm for exponential curve fitting, used by SLIM
483Plotter
484ZZ
[4608]485);
486
[6026]487my %log4j = (
488  NAME    => "log4j",
489  TITLE   => "Apache log4j",
490  JAR     => "log4j-1.2.15.jar",
491  PACKAGE => "org.apache.log4j",
492  LICENSE => "Apache",
493  URL     => "http://logging.apache.org/log4j/",
494  NOTES   => <<ZZ,
495required by SLF4J implementation
496ZZ
497  VERSION => "1.2.15"
498);
499
[4608]500my %looks = (
501  NAME    => "looks",
502  TITLE   => "JGoodies Looks",
[6026]503  JAR     => "looks-2.3.1.jar",
504  PACKAGE => "com.jgoodies.looks",
[4608]505  LICENSE => "BSD",
506  URL     => "http://www.jgoodies.com/freeware/looks/index.html",
507  NOTES   => <<ZZ,
[4532]508used for a nicer Look & Feel by VisBio and OME Metadata Editor
509ZZ
[6026]510  VERSION => "2.3.1"
[4608]511);
512
513my %netcdf = (
514  NAME    => "netcdf",
515  TITLE   => "NetCDF",
516  JAR     => "netcdf-4.0.jar",
517  PACKAGE => "ucar.nc2",
518  LICENSE => "LGPL",
519  URL     => "http://www.unidata.ucar.edu/software/netcdf-java/",
520  NOTES   => <<ZZ,
[4532]521used by Bio-Formats via reflection for HDF support (Imaris 5.5)
522ZZ
[6026]523  VERSION => "4.0"
[4608]524);
525
526my %omeJava = (
527  NAME    => "ome-java",
528  TITLE   => "OME-Java",
529  JAR     => "ome-java.jar",
530  PACKAGE => "org.openmicroscopy.[di]s",
531  LICENSE => "LGPL",
532  URL     => "http://www.openmicroscopy.org/site/documents/data-management/".
533             "ome-server/developer/java-api",
534  NOTES   => <<ZZ,
[4532]535used by OME I/O to connect to OME servers
536ZZ
[4608]537);
538
539my %omeJavaDeprecated = (
540  NAME    => "ome-java-deprecated",
541  TITLE   => "OME-Java deprecated classes",
542  JAR     => "ome-java-deprecated.jar",
543  PACKAGE => "org.openmicroscopy.xml",
544  LICENSE => "LGPL",
545  URL     => "http://www.openmicroscopy.org/site/documents/data-management/".
546             "ome-server/developer/java-api",
547  NOTES   => <<ZZ,
[4532]548used by OME Notes and OME Metadata Editor to work with OME-XML
549ZZ
[4608]550);
551
552my %omeroClient = (
553  NAME    => "omero-client",
554  TITLE   => "OMERO Client",
[6026]555  JAR     => "omero-client-4.1.1.jar",
[5503]556  PACKAGE => "ome.system",
[4608]557  LICENSE => "GPL",
558  URL     => "http://trac.openmicroscopy.org.uk/omero/wiki/MilestoneDownloads",
559  NOTES   => <<ZZ,
[4532]560used by OME I/O to connect to OMERO servers
561ZZ
[6026]562  VERSION => "4.1.1"
[4608]563);
564
565my %omeroCommon = (
566  NAME    => "omero-common",
567  TITLE   => "OMERO Common",
[6026]568  JAR     => "omero-common-4.1.1.jar",
[4608]569  PACKAGE => "ome.api",
570  LICENSE => "GPL",
571  URL     => "http://trac.openmicroscopy.org.uk/omero/wiki/MilestoneDownloads",
572  NOTES   => <<ZZ,
[4532]573used by OME I/O to connect to OMERO servers
574ZZ
[6026]575  VERSION => "4.1.1"
[4608]576);
577
578my %skinlf = (
579  NAME    => "skinlf",
580  TITLE   => "Skin Look and Feel",
581  JAR     => "skinlf.jar",
582  PACKAGE => "com.l2fprod",
583  LICENSE => "Custom (BSD-like)",
584  URL     => "http://skinlf.l2fprod.com/",
585  NOTES   => <<ZZ,
[4532]586not used (may be used in the future for flexible skinning)
587ZZ
[6026]588  VERSION => "6.7"
[4608]589);
590
[6026]591my %slf4j_api = (
[6045]592  NAME    => "slf4j-api",
[6026]593  TITLE   => "Simple Logging Facade for Java API",
594  JAR     => "slf4j-api-1.5.10.jar",
[4608]595  PACKAGE => "org.slf4j",
596  LICENSE => "BSD",
597  URL     => "http://www.slf4j.org/",
598  NOTES   => <<ZZ,
[6026]599used for all logging in loci.*
[4608]600ZZ
[6026]601  VERSION => "1.5.10"
[4608]602);
603
[6026]604my %slf4j_impl = (
[6045]605  NAME    => "slf4j-log4j",
[6182]606  TITLE   => "Simple Logging Facade for Java log4j Binding",
[6026]607  JAR     => "slf4j-log4j12-1.5.10.jar",
[6045]608  PACKAGE => "org.slf4j.impl",
[6026]609  LICENSE => "BSD",
610  URL     => "http://www.slf4j.org/",
611  NOTES   => <<ZZ,
612used for all logging in loci.*
613ZZ
614  VERSION => "1.5.10"
615);
616
[4608]617my %testng = (
618  NAME    => "testng",
619  TITLE   => "TestNG",
[6026]620  JAR     => "testng-5.11-jdk15.jar",
[4608]621  PACKAGE => "org.testng",
622  LICENSE => "Apache",
623  URL     => "http://testng.org/",
624  NOTES   => <<ZZ,
[4532]625testing framework used for LOCI software automated test suite
626ZZ
[6026]627  VERSION => "5.7"
[4608]628);
629
630my %velocity = (
631  NAME    => "velocity",
632  TITLE   => "Apache Velocity",
[6026]633  JAR     => "velocity-1.6.3-dep.jar",
[4608]634  PACKAGE => "org.apache.velocity",
635  LICENSE => "Apache",
636  URL     => "http://velocity.apache.org/",
637  NOTES   => <<ZZ,
[4532]638used to autogenerate the loci.formats.meta and loci.formats.ome Bio-Formats
639packages
640ZZ
[6026]641  VERSION => "1.6.3"
[4608]642);
643
644my %visad = (
645  NAME    => "visad",
646  TITLE   => "VisAD",
647  JAR     => "visad-lite.jar",
648  PACKAGE => "visad",
649  LICENSE => "LGPL",
650  URL     => "http://www.ssec.wisc.edu/~billh/visad.html",
651  NOTES   => <<ZZ,
[4532]652stripped down VisAD library used by VisBio and SLIM Plotter for interactive
653visualization
654ZZ
[4608]655);
656
657my %xmlrpc = (
658  NAME    => "xmlrpc",
659  TITLE   => "Apache XML-RPC",
660  JAR     => "xmlrpc-1.2-b1.jar",
661  PACKAGE => "org.apache.xmlrpc",
662  LICENSE => "Apache",
663  URL     => "http://ws.apache.org/xmlrpc/",
664  NOTES   => <<ZZ,
[4532]665used by OME-Java library to communicate with OME servers
666ZZ
[6026]667  VERSION => "1.2-b1"
[4532]668);
669
[6517]670my %serializer = (
671  NAME    => "serializer",
672  TITLE   => "Xalan Serializer",
673  JAR     => "serializer-2.7.1.jar",
674  PACKAGE => "org.apache.xml.serializer",
675  LICENSE => "Apache",
676  URL     => "http://xml.apache.org/xalan-j/",
677  NOTES   => <<ZZ,
678used for OME-XML transformations
679ZZ
680  VERSION => "2.7.1"
681);
682
683my %xalan = (
684  NAME    => "xalan",
685  TITLE   => "Xalan",
686  JAR     => "xalan-2.7.1.jar",
687  PACKAGE => "org.apache.xalan",
688  LICENSE => "Apache",
689  URL     => "http://xml.apache.org/xalan-j/",
690  NOTES   => <<ZZ,
691used for OME-XML transformations
692ZZ
693  VERSION => "2.7.1"
694);
695
696
697
[4608]698# -- DATA STRUCTURES --
[4531]699
[4608]700# List of active LOCI software components
701my @active = (
[5488]702  \%autogen,
[6237]703#  \%bfIce,
[6050]704  \%bioFormats,
705  \%flowCytometry,
706  \%lociChecks,
707  \%lociCommon,
[4608]708  \%lociPlugins,
709  \%omeIO,
710  \%omePlugins,
[6050]711  \%omeXML,
[4608]712  \%slimPlotter,
713  \%testSuite,
[6050]714  \%visbio,
[4608]715);
[4532]716
[4608]717# List of legacy components (no longer supported)
718my @legacy = (
719  \%jvmlink,
720  \%multiLUT,
[6050]721  \%omeEditor,
[6237]722#  \%omeNotes,
[4608]723);
[4533]724
[4608]725# List of external project forks
726my @forks = (
[6050]727  \%jai,
728  \%mdbtools,
[4608]729  \%poi,
730);
731
[6050]732# List of external project stubs
733my @stubs = (
734  \%lwfStubs,
735);
736
[4608]737# List of all LOCI software components
[6050]738my @components = (@active, @legacy, @forks, @stubs);
[4608]739
740# List of external libraries
741my @libs = (
742  \%appleJavaExtensions,
743  \%antContrib,
744  \%checkstyle,
745  \%commonsHTTPClient,
746  \%commonsLogging,
747  \%findbugs,
748  \%forms,
749  \%ice,
750  \%ij,
751  \%jiio,
752  \%junit,
753  \%lma,
[6026]754  \%log4j,
[4608]755  \%looks,
756  \%netcdf,
[6026]757  \%slf4j_api,
758  \%slf4j_impl,
[4608]759  \%omeJava,
760  \%omeJavaDeprecated,
761  \%omeroClient,
762  \%omeroCommon,
[6517]763  \%serializer,
[4608]764  \%skinlf,
765  \%testng,
766  \%velocity,
767  \%visad,
[6517]768  \%xalan,
[4608]769  \%xmlrpc,
770);
771
[6052]772my $programErrors = 0;
773
774# -- ARGUMENT PARSING --
775
776my $skipSummary = 0;
777foreach my $arg (@ARGV) {
778  if ($arg eq '-nosummary') {
779    $skipSummary = 1;
780  }
781}
782
[4531]783# -- DATA COLLECTION --
784
785# verify that all JAR files exist -- if not, this file is probably out of date
[4533]786print STDERR "--== VERIFYING JAR FILE EXISTENCE ==--\n\n";
[4531]787foreach my $c (@components) {
[4608]788  my $jar = $$c{JAR};
[4531]789  unless (-e "artifacts/$jar") {
790    die "Component $jar does not exist";
791  }
792}
793foreach my $l (@libs) {
[4608]794  my $jar = $$l{JAR};
[4531]795  unless (-e "jar/$jar") {
796    die "Library $jar does not exist";
797  }
798}
799
800# scan for project dependencies
[4533]801print STDERR "--== SCANNING PROJECT DEPENDENCIES ==--\n\n";
[4531]802foreach my $c (@components) {
[4608]803  my $path = $$c{PATH};
804  print STDERR "[$$c{TITLE}]\n";
[4531]805  my @deps = ();
806  my @opt = ();
807  foreach my $c2 (@components) {
[4532]808    if ($c eq $c2) { next; }
[4608]809    my $name = $$c2{TITLE};
810    my $package = $$c2{PACKAGE};
[4531]811    if (checkDirect($package, $path)) {
812      push (@deps, $c2);
813      print STDERR "$name\n";
814    }
815    elsif (checkReflect($package, $path)) {
816      push (@opt, $c2);
[6045]817      print STDERR "$name [reflected]\n";
[4531]818    }
819  }
[4608]820  $$c{PROJ_DEPS} = \@deps;
821  $$c{PROJ_OPT} = \@opt;
[4531]822  print STDERR "\n";
823}
824
825print STDERR "--== SCANNING LIBRARY DEPENDENCIES ==--\n\n";
826foreach my $c (@components) {
827  my @deps = ();
828  my @opt = ();
[4608]829  my $path = $$c{PATH};
830  print STDERR "[$$c{TITLE}]\n";
[4531]831  foreach my $l (@libs) {
[4608]832    my $name = $$l{TITLE};
833    my $package = $$l{PACKAGE};
[4531]834    if (checkDirect($package, $path)) {
835      push (@deps, $l);
836      print STDERR "$name\n";
837    }
838    elsif (checkReflect($package, $path)) {
839      push (@opt, $l);
[6045]840      print STDERR "$name [reflected]\n";
[4531]841    }
842  }
[4608]843  $$c{LIB_DEPS} = \@deps;
844  $$c{LIB_OPT} = \@opt;
[4531]845  print STDERR "\n";
846}
847
[4533]848print STDERR "--== GATHERING COMPONENT CLASSPATHS ==--\n\n";
849foreach my $c (@components) {
[4608]850  my $path = $$c{PATH};
[4533]851
[4608]852  # read compile-time and runtime classpaths from properties file
[4609]853  open FILE, "$path/build.properties"
854    or die "$path/build.properties: $!";
[4533]855  my @lines = <FILE>;
856  close(FILE);
857  my $inCompile = 0;
858  my $inManifest = 0;
859  my @compile = ();
860  my @runtime = ();
861  foreach my $line (@lines) {
862    $line = rtrim($line);
863    if ($line =~ /^component.classpath/) {
864      # found the compile-time classpath variable
865      $inCompile = 1;
866    }
[4612]867    elsif ($line =~ /^component.runtime-cp/) {
[4533]868      # found the runtime classpath variable
869      $inManifest = 1;
870    }
871    if ($inCompile || $inManifest) {
872      my $end = $line !~ /\\$/;
873      # append the entry to the classpath list
874      $line =~ s/[ :\\]*$//;
[5495]875      $line =~ s/.*[ =]+//;
876      if ($line ne '(none)' && $line ne '') {
[4533]877        if ($inCompile) {
878          push(@compile, $line);
879        }
880        elsif ($inManifest) {
[4612]881          if ($line =~ /\${component.classpath}/) {
882            push(@runtime, @compile);
883          }
884          else {
885            push(@runtime, $line);
886          }
[4533]887        }
888      }
889      if ($end) {
890        # line does not end with a backslash; end of variable
891        $inCompile = $inManifest = 0;
892      }
893    }
894  }
[4608]895  $$c{COMPILE} = \@compile;
896  $$c{RUNTIME} = \@runtime;
[4533]897}
898
[4609]899print STDERR "--== GATHERING ECLIPSE DEPENDENCIES ==--\n\n";
900foreach my $c (@components) {
901  my $path = $$c{PATH};
902
903  # read Eclipse classpath from classpath file
904  open FILE, "$path/.classpath"
905    or die "$path/.classpath: $!";
906  my @lines = <FILE>;
907  close(FILE);
908  my @eclipse = ();
909  foreach my $line (@lines) {
910    $line = rtrim($line);
911    if ($line =~ /<classpathentry /) {
912      # found a compile-time classpath entry
913      $line =~ s/.* path="//;
914      $line =~ s/"\/>$//;
915      push(@eclipse, $line);
916    }
917  }
918  @eclipse = sort @eclipse;
919  $$c{ECLIPSE} = \@eclipse;
920}
921
[6045]922# -- DATA VERIFICATION --
923
[4533]924print STDERR "--== VERIFYING CLASSPATH MATCHES ==--\n\n";
925foreach my $c (@components) {
[4608]926  my @projDeps = @{$$c{PROJ_DEPS}};
927  my @libDeps = @{$$c{LIB_DEPS}};
928  my @projOpt = @{$$c{PROJ_OPT}};
929  my @libOpt = @{$$c{LIB_OPT}};
[4609]930  my $name = $$c{TITLE};
[6045]931  my $path = $$c{PATH};
932  my @deps;
[4533]933
934  # verify compile-time classpath
[6045]935  my @compile = ();
[4612]936  foreach my $dep (@projDeps) {
[6045]937    push(@compile, "\${artifact.dir}/$$dep{JAR}");
[4612]938  }
939  foreach my $dep (@libDeps) {
[6045]940    push(@compile, "\${lib.dir}/$$dep{JAR}");
[4612]941  }
[6045]942  @compile = sort @compile;
[4608]943  my @cp = @{$$c{COMPILE}};
944  my $compileError = 0;
[6045]945  if (@compile != @cp) {
[4608]946    print STDERR "Dependency mismatch for $name compile time classpath:\n";
947    $compileError = 1;
[4533]948  }
949  else {
950    for (my $i = 0; $i < @cp; $i++) {
[6045]951      my $depJar = $compile[$i];
[4533]952      my $cpJar = $cp[$i];
953      if ($cpJar ne $depJar) {
[4608]954        print STDERR "Dependency mismatch for $name compile time classpath:\n";
[4533]955        print STDERR "  #$i: $depJar != $cpJar\n";
[4608]956        $compileError = 1;
[4533]957        last;
958      }
959    }
960  }
[4608]961  if ($compileError) {
[6224]962    print STDERR "  component.classpath:\n";
963    print STDERR "    Actual    = @cp\n";
964    print STDERR "    Synthetic = @deps\n";
965    print STDERR "\n";
966    print STDERR "  project deps =";
[4608]967    foreach my $q (@projDeps) {
968      print STDERR " $$q{NAME}";
969    }
[6224]970    print STDERR "\n";
971    print STDERR "  library deps =";
[4608]972    foreach my $q (@libDeps) {
973      print STDERR " $$q{NAME}";
974    }
975    print STDERR "\n";
[6052]976    $programErrors++;
[4608]977  }
[4609]978
979  # verify Eclipse classpath
980  @deps = ();
[6045]981  push(@deps, "src");
982  if (-e "$path/test") {
983    push(@deps, "test");
984  }
985  push(@deps, "org.eclipse.jdt.launching.JRE_CONTAINER");
[4609]986  foreach my $dep (@projDeps) {
[4612]987    push(@deps, "/$$dep{NAME}");
[4609]988  }
[5488]989  if (@libDeps > 0) {
990    push(@deps, "/External libraries");
[6165]991    foreach my $q (@libDeps) {
992      if ($$q{NAME} eq $testng{NAME}) {
993        push(@deps, "org.testng.TESTNG_CONTAINER");
994      }
[6517]995      if ($$q{NAME} eq $junit{NAME}) {
996        push(@deps, "org.eclipse.jdt.junit.JUNIT_CONTAINER/4");
997      }
[6165]998    }
[4609]999  }
[6165]1000  push(@deps, "build-eclipse");
[4609]1001  @deps = sort @deps;
1002  @cp = @{$$c{ECLIPSE}};
1003  my $eclipseError = 0;
1004  if (@deps != @cp) {
1005    print STDERR "Dependency mismatch for $name Eclipse classpath:\n";
1006    $eclipseError = 1;
1007  }
1008  else {
1009    for (my $i = 0; $i < @cp; $i++) {
1010      my $depEntry = $deps[$i];
1011      my $cpEntry = $cp[$i];
1012      if ($cpEntry ne $depEntry) {
1013        print STDERR "Dependency mismatch for $name Eclipse classpath:\n";
1014        print STDERR "  #$i: $depEntry != $cpEntry\n";
1015        $eclipseError = 1;
1016        last;
1017      }
1018    }
1019  }
1020  if ($eclipseError) {
[6224]1021    print STDERR "  Eclipse classpath:\n";
1022    print STDERR "    Actual    = @cp\n";
1023    print STDERR "    Synthetic = @deps\n";
1024    print STDERR "\n";
1025    print STDERR "  project deps =";
[4609]1026    foreach my $q (@projDeps) {
1027      print STDERR " $$q{NAME}";
1028    }
[6224]1029    print STDERR "\n";
1030    print STDERR "  library deps =";
[4609]1031    foreach my $q (@libDeps) {
1032      print STDERR " $$q{NAME}";
1033    }
1034    print STDERR "\n";
[6052]1035    $programErrors++;
[4609]1036  }
1037
[4533]1038  # verify runtime classpath
[6045]1039  my @runtime = ();
[4612]1040  foreach my $dep (@projOpt) {
[6045]1041    push(@runtime, "\${artifact.dir}/$$dep{JAR}");
[4612]1042  }
1043  foreach my $dep (@libOpt) {
[6045]1044    push(@runtime, "\${lib.dir}/$$dep{JAR}");
[4612]1045  }
[6045]1046  @runtime = sort @runtime;
1047  @deps = (@compile, @runtime);
[4608]1048  @cp = @{$$c{RUNTIME}};
1049  my $runtimeError = 0;
[4533]1050  if (@deps != @cp) {
[4609]1051    print STDERR "Dependency mismatch for $name runtime classpath:\n";
[4608]1052    $runtimeError = 1;
[4533]1053  }
1054  else {
1055    for (my $i = 0; $i < @cp; $i++) {
[4612]1056      my $depJar = $deps[$i];
[4533]1057      my $cpJar = $cp[$i];
1058      if ($cpJar ne $depJar) {
[4609]1059        print STDERR "Dependency mismatch for $name runtime classpath:\n";
[4533]1060        print STDERR "  #$i: $depJar != $cpJar\n";
[4608]1061        $runtimeError = 1;
[4533]1062        last;
1063      }
1064    }
1065  }
[4608]1066  if ($runtimeError) {
[6224]1067    print STDERR "  component.runtime-cp:\n";
1068    print STDERR "    Actual    = @cp\n";
1069    print STDERR "    Synthetic = @deps\n";
1070    print STDERR "\n";
1071    print STDERR "  project deps        =";
[4608]1072    foreach my $q (@projDeps) {
1073      print STDERR " $$q{NAME}";
1074    }
[6224]1075    print STDERR "\n";
1076    print STDERR "  reflected projects  =";
[4608]1077    foreach my $q (@projOpt) {
1078      print STDERR " $$q{NAME}";
1079    }
[6224]1080    print STDERR "\n";
1081    print STDERR "  library deps        =";
[4608]1082    foreach my $q (@libDeps) {
1083      print STDERR " $$q{NAME}";
1084    }
[6224]1085    print STDERR "\n";
1086    print STDERR "  reflected libraries =";
[4608]1087    foreach my $q (@libOpt) {
1088      print STDERR " $$q{NAME}";
1089    }
[6052]1090    $programErrors++;
[4608]1091  }
[4533]1092}
1093
[6052]1094if ($skipSummary) {
1095  exit $programErrors;
1096}
1097
[4531]1098# -- FORMATTED DATA OUTPUT --
1099
1100print STDERR "--== DUMPING RESULTS TO STDOUT ==--\n\n";
[4532]1101
[4533]1102my $div = <<ZZ;
1103===============================================================================
1104ZZ
[4532]1105
1106# components - active
[4534]1107print "$div";
[4532]1108print "This build file handles the following components.\n";
1109print "For more information on a component, see the\n";
1110print "build.properties file in that component's subtree.\n";
1111print "Run ./scan-deps.pl to programmatically generate this list.\n\n";
1112foreach my $c (@active) {
[4608]1113  print "$$c{TITLE}\n";
1114  smartSplit("    ", " ", split(/[ \n]/, $$c{DESC}));
[4531]1115  print "    -=-\n";
[4608]1116  print "    JAR file:      $$c{JAR}\n";
1117  print "    Path:          $$c{PATH}\n";
[4531]1118
1119  my $lead = "                   ";
1120
[4608]1121  my @projDeps = @{$$c{PROJ_DEPS}};
[4532]1122  my @prettyDeps = ();
1123  foreach my $q (@projDeps) {
[4608]1124    push(@prettyDeps, $$q{TITLE});
[4532]1125  }
1126  smartSplit("    Project deps:  ", ", ", @prettyDeps);
1127
[4608]1128  my @libDeps = @{$$c{LIB_DEPS}};
[4532]1129  @prettyDeps = ();
1130  foreach my $q (@libDeps) {
[4608]1131    push(@prettyDeps, $$q{TITLE});
[4532]1132  }
1133  smartSplit("    Library deps:  ", ", ", @prettyDeps);
1134
[4608]1135  my @projOpt = @{$$c{PROJ_OPT}};
[4532]1136  my @prettyOpt = ();
1137  foreach my $q (@projOpt) {
[4608]1138    push(@prettyOpt, $$q{TITLE});
[4532]1139  }
[4608]1140  my @libOpt = @{$$c{LIB_OPT}};
[4532]1141  foreach my $q (@libOpt) {
[4608]1142    push(@prettyOpt, $$q{TITLE});
[4532]1143  }
1144  smartSplit("    Optional:      ", ", ", @prettyOpt);
1145
[4608]1146  print "    License:       $$c{LICENSE}\n";
[4532]1147  print "\n";
1148}
1149
1150# components - legacy
[4534]1151print "$div";
[4532]1152print "The following components are considered \"legacy\" but still " .
1153      "available:\n\n";
1154foreach my $c (@legacy) {
[4608]1155  print "$$c{TITLE}\n";
1156  smartSplit("    ", " ", split(/[ \n]/, $$c{DESC}));
[4532]1157  print "    -=-\n";
[4608]1158  print "    JAR file:      $$c{JAR}\n";
1159  print "    Path:          $$c{PATH}\n";
[4532]1160
1161  my $lead = "                   ";
1162
[4608]1163  my @deps = @{$$c{PROJ_DEPS}};
[4531]1164  my @prettyDeps = ();
1165  foreach my $q (@deps) {
[4608]1166    push(@prettyDeps, $$q{TITLE});
[4531]1167  }
[4532]1168  smartSplit("    Project deps:  ", ", ", @prettyDeps);
[4531]1169
[4608]1170  my @opt = @{$$c{PROJ_OPT}};
[4531]1171  my @prettyOpt = ();
1172  foreach my $q (@opt) {
[4608]1173    push(@prettyOpt, $$q{TITLE});
[4531]1174  }
[4532]1175  smartSplit("    Optional:      ", ", ", @prettyOpt);
[4531]1176
[4608]1177  print "    License:       $$c{LICENSE}\n";
[4531]1178  print "\n";
1179}
1180
[4532]1181# components - forks
[6050]1182for (my $i = 0; $i < 2; $i++) {
1183  print "$div";
[6052]1184  my @list;
[6050]1185  if ($i == 0) {
[6052]1186    @list = @forks;
[6050]1187    print "The following components are forks of third party projects:\n\n";
[4532]1188  }
[6050]1189  else {
[6052]1190    @list = @stubs;
[6050]1191    print "The following components are stubs of third party projects:\n\n";
1192  }
[6052]1193  foreach my $c (@list) {
[6050]1194    print "$$c{TITLE}\n";
1195    smartSplit("    ", " ", split(/[ \n]/, $$c{DESC}));
1196    print "    -=-\n";
1197    print "    JAR file:      $$c{JAR}\n";
1198    print "    Path:          $$c{PATH}\n";
[4532]1199
[6050]1200    my @deps = @{$$c{PROJ_DEPS}};
1201    my @prettyDeps = ();
1202    foreach my $q (@deps) {
1203      push(@prettyDeps, $$q{TITLE});
1204    }
1205    smartSplit("    Project deps:  ", ", ", @prettyDeps);
1206
1207    my @opt = @{$$c{PROJ_OPT}};
1208    my @prettyOpt = ();
1209    foreach my $q (@opt) {
1210      push(@prettyOpt, $$q{TITLE});
1211    }
1212    smartSplit("    Optional:      ", ", ", @prettyOpt);
1213
1214    print "    License:       $$c{LICENSE}\n";
1215    print "    Project URL:   $$c{URL}\n";
1216    smartSplit("    Notes:         ", " ", split(/[ \n]/, $$c{NOTES}));
1217    print "\n";
[4532]1218  }
1219}
1220
1221# libraries
[4534]1222print "$div";
[4532]1223print "The following external dependencies (in the jar folder) may be " .
1224      "required:\n";
1225foreach my $l (@libs) {
[4608]1226  print "$$l{TITLE}\n";
1227  print "    JAR file:  $$l{JAR}\n";
1228  print "    URL:       $$l{URL}\n";
1229  smartSplit("    Notes:     ", " ", split(/[ \n]/, $$l{NOTES}));
1230  print "    License:   $$l{LICENSE}\n";
[4532]1231  print "\n";
1232}
1233
[6052]1234exit $programErrors;
1235
[4531]1236# -- SUBROUTINES --
1237
1238sub checkDirect {
1239  my ($package, $path) = @_;
[6026]1240  return `find $path -name '*.java' | xargs grep -l "^import $package\\."`;
[4531]1241}
1242
1243sub checkReflect {
1244  my ($package, $path) = @_;
[6045]1245  return `find $path -name '*.java' | xargs grep -l "optional $package"`;
[4531]1246}
1247
1248sub smartSplit {
[4532]1249  my ($front, $div, @list) = @_;
1250  my $lead = $front;
1251  $lead =~ s/./ /g;
[4531]1252  my $tDiv = rtrim($div);
1253  my $end = 79;
1254  my $len = @list;
1255  my $line = $front;
1256  if ($len == 0) {
1257    $line .= "(none)";
1258  }
1259  for (my $i = 0; $i < $len; $i++) {
1260    my $item = $list[$i];
[4532]1261    if ($item eq '') { next; }
[4531]1262    if ($i == 0) {
1263      # first item
1264      $line .= $item;
1265    }
1266    else {
1267      my $q = $line . $div . $item;
1268      my $max = $i == $len - 1 ? $end : $end - length($tDiv);
1269      if (length($q) > $max) {
1270        # line wrap
1271        $line .= $tDiv;
1272        print "$line\n";
1273        $line = $lead . $item;
1274      }
1275      else {
1276        # append
1277        $line = $q;
1278      }
1279    }
1280  }
1281  print "$line\n";
1282}
1283
1284sub rtrim {
1285  my $string = shift;
1286  $string =~ s/\s+$//;
1287  return $string;
1288}
Note: See TracBrowser for help on using the repository browser.