1 | #!/usr/bin/perl |
---|
2 | use strict; |
---|
3 | |
---|
4 | # scan-deps.pl - Scans source code to determine project interdependencies, |
---|
5 | # as well as dependencies on external libraries. |
---|
6 | |
---|
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. |
---|
10 | |
---|
11 | # TODO - Use this script to autogenerate the LOCI plugins configuration file: |
---|
12 | # components/loci-plugins/src/loci/plugins/config/libraries.txt |
---|
13 | |
---|
14 | # TODO - Use this script to check build.xml's depends clauses. |
---|
15 | |
---|
16 | use 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 |
---|
24 | URL => 7, # URL for each external project (forks, stubs & libs) |
---|
25 | NOTES => 8, # notes for each external project (forks, stubs & libs) |
---|
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 |
---|
32 | ECLIPSE => 15, # Eclipse classpath for each component |
---|
33 | VERSION => 16, # version number for each library |
---|
34 | }; |
---|
35 | |
---|
36 | # -- COMPONENT DEFINITIONS - ACTIVE -- |
---|
37 | |
---|
38 | my %autogen = ( |
---|
39 | NAME => "autogen", |
---|
40 | TITLE => "LOCI code generator", |
---|
41 | PATH => "components/autogen", |
---|
42 | JAR => "loci-autogen.jar", |
---|
43 | PACKAGE => "(none)", |
---|
44 | DESC => <<ZZ, |
---|
45 | Package for generating other code, including the Bio-Formats metadata API, |
---|
46 | related documentation, Ice bindings, and Bio-Formats C++ bindings headers |
---|
47 | ZZ |
---|
48 | LICENSE => "GPL", |
---|
49 | ); |
---|
50 | |
---|
51 | my %bfIce = ( |
---|
52 | NAME => "bf-ice", |
---|
53 | TITLE => "Bio-Formats Ice framework", |
---|
54 | PATH => "components/bf-ice", |
---|
55 | JAR => "bf-ice.jar", |
---|
56 | PACKAGE => "loci.ice.formats", |
---|
57 | DESC => <<ZZ, |
---|
58 | Bindings for Bio-Formats client/server communication enabling cross-language |
---|
59 | interoperability |
---|
60 | ZZ |
---|
61 | LICENSE => "GPL", |
---|
62 | ); |
---|
63 | |
---|
64 | my %bioFormats = ( |
---|
65 | NAME => "bio-formats", |
---|
66 | TITLE => "Bio-Formats", |
---|
67 | PATH => "components/bio-formats", |
---|
68 | JAR => "bio-formats.jar", |
---|
69 | PACKAGE => "loci.formats", |
---|
70 | DESC => <<ZZ, |
---|
71 | A library for reading and writing popular microscopy file formats |
---|
72 | ZZ |
---|
73 | LICENSE => "GPL", |
---|
74 | ); |
---|
75 | |
---|
76 | my %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, |
---|
83 | Server application for flow cytometry with WiscScan using JVMLink |
---|
84 | ZZ |
---|
85 | LICENSE => "BSD", |
---|
86 | ); |
---|
87 | |
---|
88 | my %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, |
---|
95 | LOCI's Checkstyle extensions, for checking source code style |
---|
96 | ZZ |
---|
97 | LICENSE => "Public domain", |
---|
98 | ); |
---|
99 | |
---|
100 | my %lociCommon = ( |
---|
101 | NAME => "common", |
---|
102 | TITLE => "LOCI Common", |
---|
103 | PATH => "components/common", |
---|
104 | JAR => "loci-common.jar", |
---|
105 | PACKAGE => "loci.common", |
---|
106 | DESC => <<ZZ, |
---|
107 | A library containing common I/O and reflection classes |
---|
108 | ZZ |
---|
109 | LICENSE => "GPL", |
---|
110 | ); |
---|
111 | |
---|
112 | my %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, |
---|
119 | A collection of plugins for ImageJ, including the Bio-Formats Importer, |
---|
120 | Bio-Formats Exporter, Bio-Formats Macro Extensions, Data Browser, Stack |
---|
121 | Colorizer and Stack Slicer |
---|
122 | ZZ |
---|
123 | LICENSE => "GPL", |
---|
124 | ); |
---|
125 | |
---|
126 | my %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, |
---|
133 | A library for OME database import, upload and download |
---|
134 | ZZ |
---|
135 | LICENSE => "GPL", |
---|
136 | ); |
---|
137 | |
---|
138 | my %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, |
---|
145 | A collection of plugins for ImageJ, including the Download from OME and Upload |
---|
146 | to OME plugins |
---|
147 | ZZ |
---|
148 | LICENSE => "GPL", |
---|
149 | ); |
---|
150 | |
---|
151 | my %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, |
---|
158 | A library for working with OME-XML metadata structures |
---|
159 | ZZ |
---|
160 | LICENSE => "GPL", |
---|
161 | ); |
---|
162 | |
---|
163 | my %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, |
---|
170 | An application and curve fitting library for visualization and analysis of |
---|
171 | combined spectral lifetime data |
---|
172 | ZZ |
---|
173 | LICENSE => "GPL", |
---|
174 | ); |
---|
175 | |
---|
176 | my %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, |
---|
183 | Framework for automated and manual testing of the LOCI software packages |
---|
184 | ZZ |
---|
185 | LICENSE => "BSD", |
---|
186 | ); |
---|
187 | |
---|
188 | my %visbio = ( |
---|
189 | NAME => "visbio", |
---|
190 | TITLE => "VisBio", |
---|
191 | PATH => "components/visbio", |
---|
192 | JAR => "visbio.jar", |
---|
193 | PACKAGE => "loci.visbio", |
---|
194 | DESC => <<ZZ, |
---|
195 | A multi-purpose biological analysis tool |
---|
196 | ZZ |
---|
197 | LICENSE => "GPL", |
---|
198 | ); |
---|
199 | |
---|
200 | # -- COMPONENT DEFINITIONS - LEGACY -- |
---|
201 | |
---|
202 | my %jvmlink = ( |
---|
203 | NAME => "jvmlink", |
---|
204 | TITLE => "JVMLink", |
---|
205 | PATH => "components/legacy/jvmlink", |
---|
206 | JAR => "jvmlink.jar", |
---|
207 | PACKAGE => "loci.jvmlink", |
---|
208 | DESC => <<ZZ, |
---|
209 | A library for communicating between a Java Virtual Machine and other programs |
---|
210 | (e.g., C++ applications) via IP over localhost (or remotely) |
---|
211 | ZZ |
---|
212 | LICENSE => "BSD", |
---|
213 | ); |
---|
214 | |
---|
215 | my %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, |
---|
222 | A demo application for visually exploring multi-spectral image data |
---|
223 | ZZ |
---|
224 | LICENSE => "Public domain", |
---|
225 | ); |
---|
226 | |
---|
227 | my %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, |
---|
234 | An application for exploration and editing of OME-XML and OME-TIFF metadata |
---|
235 | ZZ |
---|
236 | LICENSE => "LGPL", |
---|
237 | ); |
---|
238 | |
---|
239 | my %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, |
---|
246 | A library for flexible organization and presentation of OME-XML metadata within |
---|
247 | a graphical browser and editor interface |
---|
248 | ZZ |
---|
249 | LICENSE => "LGPL", |
---|
250 | ); |
---|
251 | |
---|
252 | # -- COMPONENT DEFINITIONS - FORKS -- |
---|
253 | |
---|
254 | my %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, |
---|
261 | Java API to handle JPEG and JPEG2000 files |
---|
262 | ZZ |
---|
263 | LICENSE => "BSD", |
---|
264 | URL => "http://jai-imageio.dev.java.net/", |
---|
265 | NOTES => <<ZZ, |
---|
266 | Used by Bio-Formats to read images compressed with JPEG2000 and lossless JPEG. |
---|
267 | Modified from the 2008-10-14 source to include support for the YCbCr color |
---|
268 | space. Several files in the com.sun.media.jai packages were removed, as they |
---|
269 | are not needed by Bio-Formats, and created an additional dependency. This |
---|
270 | component will be removed once our changes have been added to the official JAI |
---|
271 | CVS repository. |
---|
272 | ZZ |
---|
273 | ); |
---|
274 | |
---|
275 | my %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, |
---|
282 | Java API to handle Microsoft MDB format (Access) |
---|
283 | ZZ |
---|
284 | LICENSE => "LGPL", |
---|
285 | URL => "http://sourceforge.net/forum/message.php?msg_id=2550619", |
---|
286 | NOTES => <<ZZ, |
---|
287 | Used by Bio-Formats for Zeiss LSM metadata in MDB files. |
---|
288 | ZZ |
---|
289 | ); |
---|
290 | |
---|
291 | my %poi = ( |
---|
292 | NAME => "poi", |
---|
293 | TITLE => "Apache Jakarta POI", |
---|
294 | PATH => "components/forks/poi", |
---|
295 | JAR => "poi-loci.jar", |
---|
296 | PACKAGE => "loci.poi", |
---|
297 | DESC => <<ZZ, |
---|
298 | Java API to handle Microsoft OLE 2 Compound Document format (Word, Excel) |
---|
299 | ZZ |
---|
300 | LICENSE => "Apache", |
---|
301 | URL => "http://jakarta.apache.org/poi/", |
---|
302 | NOTES => <<ZZ, |
---|
303 | Based on poi-2.5.1-final-20040804.jar, with bugfixes for OLE v2 and memory |
---|
304 | efficiency improvements. Used by Bio-Formats for OLE support (cxd, ipw, oib, |
---|
305 | zvi). Used by VisBio overlays logic for XLS export feature. |
---|
306 | ZZ |
---|
307 | ); |
---|
308 | |
---|
309 | # -- COMPONENT DEFINITIONS - STUBS -- |
---|
310 | |
---|
311 | my %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, |
---|
318 | Stub of proprietary Java API to handle Luratech LWF compression |
---|
319 | ZZ |
---|
320 | LICENSE => "BSD", |
---|
321 | URL => "http://www.luratech.com/", |
---|
322 | NOTES => <<ZZ, |
---|
323 | required to compile Bio-Formats's support for Luratech LWF compression for |
---|
324 | the Opera Flex format |
---|
325 | ZZ |
---|
326 | ); |
---|
327 | |
---|
328 | # -- LIBRARY DEFINITIONS -- |
---|
329 | |
---|
330 | my %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, |
---|
338 | required to compile Mac-specific functionality on non-Mac OS X machines |
---|
339 | ZZ |
---|
340 | ); |
---|
341 | |
---|
342 | my %antContrib = ( |
---|
343 | NAME => "ant-contrib", |
---|
344 | TITLE => "Ant-Contrib", |
---|
345 | JAR => "ant-contrib-1.0b3.jar", |
---|
346 | PACKAGE => "net.sf.antcontrib", |
---|
347 | LICENSE => "Apache", |
---|
348 | URL => "http://ant-contrib.sourceforge.net/", |
---|
349 | NOTES => <<ZZ, |
---|
350 | used by tools target to iterate over JAR files ("for" task) |
---|
351 | ZZ |
---|
352 | VERSION => "1.0b3" |
---|
353 | ); |
---|
354 | |
---|
355 | my %checkstyle = ( |
---|
356 | NAME => "checkstyle", |
---|
357 | TITLE => "Checkstyle", |
---|
358 | JAR => "checkstyle-all-5.0.jar", |
---|
359 | PACKAGE => "com.puppycrawl.tools.checkstyle", |
---|
360 | LICENSE => "LGPL", |
---|
361 | URL => "http://checkstyle.sourceforge.net/", |
---|
362 | NOTES => <<ZZ, |
---|
363 | used by style Ant target to check source code style conventions |
---|
364 | ZZ |
---|
365 | VERSION => "5.0" |
---|
366 | ); |
---|
367 | |
---|
368 | my %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, |
---|
376 | required for OME-Java to communicate with OME servers |
---|
377 | ZZ |
---|
378 | VERSION => "2.0-rc2" |
---|
379 | ); |
---|
380 | |
---|
381 | my %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, |
---|
389 | used by OME-Java |
---|
390 | ZZ |
---|
391 | VERSION => "1.0.3" |
---|
392 | ); |
---|
393 | |
---|
394 | my %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, |
---|
402 | used by findbugs Ant target to check for program bugs |
---|
403 | ZZ |
---|
404 | VERSION => "1.3.9" |
---|
405 | ); |
---|
406 | |
---|
407 | my %forms = ( |
---|
408 | NAME => "forms", |
---|
409 | TITLE => "JGoodies Forms", |
---|
410 | JAR => "forms-1.3.0.jar", |
---|
411 | PACKAGE => "com.jgoodies.forms", |
---|
412 | LICENSE => "BSD", |
---|
413 | URL => "http://www.jgoodies.com/freeware/forms/index.html", |
---|
414 | NOTES => <<ZZ, |
---|
415 | used for layout by VisBio, Data Browser and OME Notes |
---|
416 | ZZ |
---|
417 | VERSION => "1.3.0" |
---|
418 | ); |
---|
419 | |
---|
420 | my %ice = ( |
---|
421 | NAME => "ice", |
---|
422 | TITLE => "Ice", |
---|
423 | JAR => "Ice-3.3.1.jar", |
---|
424 | PACKAGE => "Ice", |
---|
425 | LICENSE => "GPL", |
---|
426 | URL => "http://www.zeroc.com/ice.html", |
---|
427 | NOTES => <<ZZ, |
---|
428 | used by Bio-Formats Ice framework |
---|
429 | ZZ |
---|
430 | VERSIOn => "3.3.1" |
---|
431 | ); |
---|
432 | |
---|
433 | my %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, |
---|
441 | used by LOCI plugins for ImageJ and OME plugins for ImageJ; bundled with VisBio |
---|
442 | to achieve ImageJ interconnectivity |
---|
443 | ZZ |
---|
444 | VERSION => "1.43o" |
---|
445 | ); |
---|
446 | |
---|
447 | my %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, |
---|
455 | used by Bio-Formats via reflection for JPEG2000 support (ND2, JP2) and lossless |
---|
456 | JPEG decompression (DICOM) |
---|
457 | ZZ |
---|
458 | VERSION => "1.1" |
---|
459 | ); |
---|
460 | |
---|
461 | my %junit = ( |
---|
462 | NAME => "junit", |
---|
463 | TITLE => "JUnit", |
---|
464 | JAR => "junit.jar", |
---|
465 | PACKAGE => ".*junit", |
---|
466 | LICENSE => "Common Public License", |
---|
467 | URL => "http://www.junit.org/", |
---|
468 | NOTES => <<ZZ, |
---|
469 | unit testing framework used for a few VisBio unit tests |
---|
470 | ZZ |
---|
471 | VERSION => "3.8.2" |
---|
472 | ); |
---|
473 | |
---|
474 | my %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, |
---|
482 | Levenberg-Marquardt algorithm for exponential curve fitting, used by SLIM |
---|
483 | Plotter |
---|
484 | ZZ |
---|
485 | ); |
---|
486 | |
---|
487 | my %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, |
---|
495 | required by SLF4J implementation |
---|
496 | ZZ |
---|
497 | VERSION => "1.2.15" |
---|
498 | ); |
---|
499 | |
---|
500 | my %looks = ( |
---|
501 | NAME => "looks", |
---|
502 | TITLE => "JGoodies Looks", |
---|
503 | JAR => "looks-2.3.1.jar", |
---|
504 | PACKAGE => "com.jgoodies.looks", |
---|
505 | LICENSE => "BSD", |
---|
506 | URL => "http://www.jgoodies.com/freeware/looks/index.html", |
---|
507 | NOTES => <<ZZ, |
---|
508 | used for a nicer Look & Feel by VisBio and OME Metadata Editor |
---|
509 | ZZ |
---|
510 | VERSION => "2.3.1" |
---|
511 | ); |
---|
512 | |
---|
513 | my %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, |
---|
521 | used by Bio-Formats via reflection for HDF support (Imaris 5.5) |
---|
522 | ZZ |
---|
523 | VERSION => "4.0" |
---|
524 | ); |
---|
525 | |
---|
526 | my %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, |
---|
535 | used by OME I/O to connect to OME servers |
---|
536 | ZZ |
---|
537 | ); |
---|
538 | |
---|
539 | my %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, |
---|
548 | used by OME Notes and OME Metadata Editor to work with OME-XML |
---|
549 | ZZ |
---|
550 | ); |
---|
551 | |
---|
552 | my %omeroClient = ( |
---|
553 | NAME => "omero-client", |
---|
554 | TITLE => "OMERO Client", |
---|
555 | JAR => "omero-client-4.1.1.jar", |
---|
556 | PACKAGE => "ome.system", |
---|
557 | LICENSE => "GPL", |
---|
558 | URL => "http://trac.openmicroscopy.org.uk/omero/wiki/MilestoneDownloads", |
---|
559 | NOTES => <<ZZ, |
---|
560 | used by OME I/O to connect to OMERO servers |
---|
561 | ZZ |
---|
562 | VERSION => "4.1.1" |
---|
563 | ); |
---|
564 | |
---|
565 | my %omeroCommon = ( |
---|
566 | NAME => "omero-common", |
---|
567 | TITLE => "OMERO Common", |
---|
568 | JAR => "omero-common-4.1.1.jar", |
---|
569 | PACKAGE => "ome.api", |
---|
570 | LICENSE => "GPL", |
---|
571 | URL => "http://trac.openmicroscopy.org.uk/omero/wiki/MilestoneDownloads", |
---|
572 | NOTES => <<ZZ, |
---|
573 | used by OME I/O to connect to OMERO servers |
---|
574 | ZZ |
---|
575 | VERSION => "4.1.1" |
---|
576 | ); |
---|
577 | |
---|
578 | my %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, |
---|
586 | not used (may be used in the future for flexible skinning) |
---|
587 | ZZ |
---|
588 | VERSION => "6.7" |
---|
589 | ); |
---|
590 | |
---|
591 | my %slf4j_api = ( |
---|
592 | NAME => "slf4j-api", |
---|
593 | TITLE => "Simple Logging Facade for Java API", |
---|
594 | JAR => "slf4j-api-1.5.10.jar", |
---|
595 | PACKAGE => "org.slf4j", |
---|
596 | LICENSE => "BSD", |
---|
597 | URL => "http://www.slf4j.org/", |
---|
598 | NOTES => <<ZZ, |
---|
599 | used for all logging in loci.* |
---|
600 | ZZ |
---|
601 | VERSION => "1.5.10" |
---|
602 | ); |
---|
603 | |
---|
604 | my %slf4j_impl = ( |
---|
605 | NAME => "slf4j-log4j", |
---|
606 | TITLE => "Simple Logging Facade for Java log4j Binding", |
---|
607 | JAR => "slf4j-log4j12-1.5.10.jar", |
---|
608 | PACKAGE => "org.slf4j.impl", |
---|
609 | LICENSE => "BSD", |
---|
610 | URL => "http://www.slf4j.org/", |
---|
611 | NOTES => <<ZZ, |
---|
612 | used for all logging in loci.* |
---|
613 | ZZ |
---|
614 | VERSION => "1.5.10" |
---|
615 | ); |
---|
616 | |
---|
617 | my %testng = ( |
---|
618 | NAME => "testng", |
---|
619 | TITLE => "TestNG", |
---|
620 | JAR => "testng-5.11-jdk15.jar", |
---|
621 | PACKAGE => "org.testng", |
---|
622 | LICENSE => "Apache", |
---|
623 | URL => "http://testng.org/", |
---|
624 | NOTES => <<ZZ, |
---|
625 | testing framework used for LOCI software automated test suite |
---|
626 | ZZ |
---|
627 | VERSION => "5.7" |
---|
628 | ); |
---|
629 | |
---|
630 | my %velocity = ( |
---|
631 | NAME => "velocity", |
---|
632 | TITLE => "Apache Velocity", |
---|
633 | JAR => "velocity-1.6.3-dep.jar", |
---|
634 | PACKAGE => "org.apache.velocity", |
---|
635 | LICENSE => "Apache", |
---|
636 | URL => "http://velocity.apache.org/", |
---|
637 | NOTES => <<ZZ, |
---|
638 | used to autogenerate the loci.formats.meta and loci.formats.ome Bio-Formats |
---|
639 | packages |
---|
640 | ZZ |
---|
641 | VERSION => "1.6.3" |
---|
642 | ); |
---|
643 | |
---|
644 | my %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, |
---|
652 | stripped down VisAD library used by VisBio and SLIM Plotter for interactive |
---|
653 | visualization |
---|
654 | ZZ |
---|
655 | ); |
---|
656 | |
---|
657 | my %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, |
---|
665 | used by OME-Java library to communicate with OME servers |
---|
666 | ZZ |
---|
667 | VERSION => "1.2-b1" |
---|
668 | ); |
---|
669 | |
---|
670 | my %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, |
---|
678 | used for OME-XML transformations |
---|
679 | ZZ |
---|
680 | VERSION => "2.7.1" |
---|
681 | ); |
---|
682 | |
---|
683 | my %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, |
---|
691 | used for OME-XML transformations |
---|
692 | ZZ |
---|
693 | VERSION => "2.7.1" |
---|
694 | ); |
---|
695 | |
---|
696 | |
---|
697 | |
---|
698 | # -- DATA STRUCTURES -- |
---|
699 | |
---|
700 | # List of active LOCI software components |
---|
701 | my @active = ( |
---|
702 | \%autogen, |
---|
703 | # \%bfIce, |
---|
704 | \%bioFormats, |
---|
705 | \%flowCytometry, |
---|
706 | \%lociChecks, |
---|
707 | \%lociCommon, |
---|
708 | \%lociPlugins, |
---|
709 | \%omeIO, |
---|
710 | \%omePlugins, |
---|
711 | \%omeXML, |
---|
712 | \%slimPlotter, |
---|
713 | \%testSuite, |
---|
714 | \%visbio, |
---|
715 | ); |
---|
716 | |
---|
717 | # List of legacy components (no longer supported) |
---|
718 | my @legacy = ( |
---|
719 | \%jvmlink, |
---|
720 | \%multiLUT, |
---|
721 | \%omeEditor, |
---|
722 | # \%omeNotes, |
---|
723 | ); |
---|
724 | |
---|
725 | # List of external project forks |
---|
726 | my @forks = ( |
---|
727 | \%jai, |
---|
728 | \%mdbtools, |
---|
729 | \%poi, |
---|
730 | ); |
---|
731 | |
---|
732 | # List of external project stubs |
---|
733 | my @stubs = ( |
---|
734 | \%lwfStubs, |
---|
735 | ); |
---|
736 | |
---|
737 | # List of all LOCI software components |
---|
738 | my @components = (@active, @legacy, @forks, @stubs); |
---|
739 | |
---|
740 | # List of external libraries |
---|
741 | my @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, |
---|
754 | \%log4j, |
---|
755 | \%looks, |
---|
756 | \%netcdf, |
---|
757 | \%slf4j_api, |
---|
758 | \%slf4j_impl, |
---|
759 | \%omeJava, |
---|
760 | \%omeJavaDeprecated, |
---|
761 | \%omeroClient, |
---|
762 | \%omeroCommon, |
---|
763 | \%serializer, |
---|
764 | \%skinlf, |
---|
765 | \%testng, |
---|
766 | \%velocity, |
---|
767 | \%visad, |
---|
768 | \%xalan, |
---|
769 | \%xmlrpc, |
---|
770 | ); |
---|
771 | |
---|
772 | my $programErrors = 0; |
---|
773 | |
---|
774 | # -- ARGUMENT PARSING -- |
---|
775 | |
---|
776 | my $skipSummary = 0; |
---|
777 | foreach my $arg (@ARGV) { |
---|
778 | if ($arg eq '-nosummary') { |
---|
779 | $skipSummary = 1; |
---|
780 | } |
---|
781 | } |
---|
782 | |
---|
783 | # -- DATA COLLECTION -- |
---|
784 | |
---|
785 | # verify that all JAR files exist -- if not, this file is probably out of date |
---|
786 | print STDERR "--== VERIFYING JAR FILE EXISTENCE ==--\n\n"; |
---|
787 | foreach my $c (@components) { |
---|
788 | my $jar = $$c{JAR}; |
---|
789 | unless (-e "artifacts/$jar") { |
---|
790 | die "Component $jar does not exist"; |
---|
791 | } |
---|
792 | } |
---|
793 | foreach my $l (@libs) { |
---|
794 | my $jar = $$l{JAR}; |
---|
795 | unless (-e "jar/$jar") { |
---|
796 | die "Library $jar does not exist"; |
---|
797 | } |
---|
798 | } |
---|
799 | |
---|
800 | # scan for project dependencies |
---|
801 | print STDERR "--== SCANNING PROJECT DEPENDENCIES ==--\n\n"; |
---|
802 | foreach my $c (@components) { |
---|
803 | my $path = $$c{PATH}; |
---|
804 | print STDERR "[$$c{TITLE}]\n"; |
---|
805 | my @deps = (); |
---|
806 | my @opt = (); |
---|
807 | foreach my $c2 (@components) { |
---|
808 | if ($c eq $c2) { next; } |
---|
809 | my $name = $$c2{TITLE}; |
---|
810 | my $package = $$c2{PACKAGE}; |
---|
811 | if (checkDirect($package, $path)) { |
---|
812 | push (@deps, $c2); |
---|
813 | print STDERR "$name\n"; |
---|
814 | } |
---|
815 | elsif (checkReflect($package, $path)) { |
---|
816 | push (@opt, $c2); |
---|
817 | print STDERR "$name [reflected]\n"; |
---|
818 | } |
---|
819 | } |
---|
820 | $$c{PROJ_DEPS} = \@deps; |
---|
821 | $$c{PROJ_OPT} = \@opt; |
---|
822 | print STDERR "\n"; |
---|
823 | } |
---|
824 | |
---|
825 | print STDERR "--== SCANNING LIBRARY DEPENDENCIES ==--\n\n"; |
---|
826 | foreach my $c (@components) { |
---|
827 | my @deps = (); |
---|
828 | my @opt = (); |
---|
829 | my $path = $$c{PATH}; |
---|
830 | print STDERR "[$$c{TITLE}]\n"; |
---|
831 | foreach my $l (@libs) { |
---|
832 | my $name = $$l{TITLE}; |
---|
833 | my $package = $$l{PACKAGE}; |
---|
834 | if (checkDirect($package, $path)) { |
---|
835 | push (@deps, $l); |
---|
836 | print STDERR "$name\n"; |
---|
837 | } |
---|
838 | elsif (checkReflect($package, $path)) { |
---|
839 | push (@opt, $l); |
---|
840 | print STDERR "$name [reflected]\n"; |
---|
841 | } |
---|
842 | } |
---|
843 | $$c{LIB_DEPS} = \@deps; |
---|
844 | $$c{LIB_OPT} = \@opt; |
---|
845 | print STDERR "\n"; |
---|
846 | } |
---|
847 | |
---|
848 | print STDERR "--== GATHERING COMPONENT CLASSPATHS ==--\n\n"; |
---|
849 | foreach my $c (@components) { |
---|
850 | my $path = $$c{PATH}; |
---|
851 | |
---|
852 | # read compile-time and runtime classpaths from properties file |
---|
853 | open FILE, "$path/build.properties" |
---|
854 | or die "$path/build.properties: $!"; |
---|
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 | } |
---|
867 | elsif ($line =~ /^component.runtime-cp/) { |
---|
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/[ :\\]*$//; |
---|
875 | $line =~ s/.*[ =]+//; |
---|
876 | if ($line ne '(none)' && $line ne '') { |
---|
877 | if ($inCompile) { |
---|
878 | push(@compile, $line); |
---|
879 | } |
---|
880 | elsif ($inManifest) { |
---|
881 | if ($line =~ /\${component.classpath}/) { |
---|
882 | push(@runtime, @compile); |
---|
883 | } |
---|
884 | else { |
---|
885 | push(@runtime, $line); |
---|
886 | } |
---|
887 | } |
---|
888 | } |
---|
889 | if ($end) { |
---|
890 | # line does not end with a backslash; end of variable |
---|
891 | $inCompile = $inManifest = 0; |
---|
892 | } |
---|
893 | } |
---|
894 | } |
---|
895 | $$c{COMPILE} = \@compile; |
---|
896 | $$c{RUNTIME} = \@runtime; |
---|
897 | } |
---|
898 | |
---|
899 | print STDERR "--== GATHERING ECLIPSE DEPENDENCIES ==--\n\n"; |
---|
900 | foreach 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 | |
---|
922 | # -- DATA VERIFICATION -- |
---|
923 | |
---|
924 | print STDERR "--== VERIFYING CLASSPATH MATCHES ==--\n\n"; |
---|
925 | foreach my $c (@components) { |
---|
926 | my @projDeps = @{$$c{PROJ_DEPS}}; |
---|
927 | my @libDeps = @{$$c{LIB_DEPS}}; |
---|
928 | my @projOpt = @{$$c{PROJ_OPT}}; |
---|
929 | my @libOpt = @{$$c{LIB_OPT}}; |
---|
930 | my $name = $$c{TITLE}; |
---|
931 | my $path = $$c{PATH}; |
---|
932 | my @deps; |
---|
933 | |
---|
934 | # verify compile-time classpath |
---|
935 | my @compile = (); |
---|
936 | foreach my $dep (@projDeps) { |
---|
937 | push(@compile, "\${artifact.dir}/$$dep{JAR}"); |
---|
938 | } |
---|
939 | foreach my $dep (@libDeps) { |
---|
940 | push(@compile, "\${lib.dir}/$$dep{JAR}"); |
---|
941 | } |
---|
942 | @compile = sort @compile; |
---|
943 | my @cp = @{$$c{COMPILE}}; |
---|
944 | my $compileError = 0; |
---|
945 | if (@compile != @cp) { |
---|
946 | print STDERR "Dependency mismatch for $name compile time classpath:\n"; |
---|
947 | $compileError = 1; |
---|
948 | } |
---|
949 | else { |
---|
950 | for (my $i = 0; $i < @cp; $i++) { |
---|
951 | my $depJar = $compile[$i]; |
---|
952 | my $cpJar = $cp[$i]; |
---|
953 | if ($cpJar ne $depJar) { |
---|
954 | print STDERR "Dependency mismatch for $name compile time classpath:\n"; |
---|
955 | print STDERR " #$i: $depJar != $cpJar\n"; |
---|
956 | $compileError = 1; |
---|
957 | last; |
---|
958 | } |
---|
959 | } |
---|
960 | } |
---|
961 | if ($compileError) { |
---|
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 ="; |
---|
967 | foreach my $q (@projDeps) { |
---|
968 | print STDERR " $$q{NAME}"; |
---|
969 | } |
---|
970 | print STDERR "\n"; |
---|
971 | print STDERR " library deps ="; |
---|
972 | foreach my $q (@libDeps) { |
---|
973 | print STDERR " $$q{NAME}"; |
---|
974 | } |
---|
975 | print STDERR "\n"; |
---|
976 | $programErrors++; |
---|
977 | } |
---|
978 | |
---|
979 | # verify Eclipse classpath |
---|
980 | @deps = (); |
---|
981 | push(@deps, "src"); |
---|
982 | if (-e "$path/test") { |
---|
983 | push(@deps, "test"); |
---|
984 | } |
---|
985 | push(@deps, "org.eclipse.jdt.launching.JRE_CONTAINER"); |
---|
986 | foreach my $dep (@projDeps) { |
---|
987 | push(@deps, "/$$dep{NAME}"); |
---|
988 | } |
---|
989 | if (@libDeps > 0) { |
---|
990 | push(@deps, "/External libraries"); |
---|
991 | foreach my $q (@libDeps) { |
---|
992 | if ($$q{NAME} eq $testng{NAME}) { |
---|
993 | push(@deps, "org.testng.TESTNG_CONTAINER"); |
---|
994 | } |
---|
995 | if ($$q{NAME} eq $junit{NAME}) { |
---|
996 | push(@deps, "org.eclipse.jdt.junit.JUNIT_CONTAINER/4"); |
---|
997 | } |
---|
998 | } |
---|
999 | } |
---|
1000 | push(@deps, "build-eclipse"); |
---|
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) { |
---|
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 ="; |
---|
1026 | foreach my $q (@projDeps) { |
---|
1027 | print STDERR " $$q{NAME}"; |
---|
1028 | } |
---|
1029 | print STDERR "\n"; |
---|
1030 | print STDERR " library deps ="; |
---|
1031 | foreach my $q (@libDeps) { |
---|
1032 | print STDERR " $$q{NAME}"; |
---|
1033 | } |
---|
1034 | print STDERR "\n"; |
---|
1035 | $programErrors++; |
---|
1036 | } |
---|
1037 | |
---|
1038 | # verify runtime classpath |
---|
1039 | my @runtime = (); |
---|
1040 | foreach my $dep (@projOpt) { |
---|
1041 | push(@runtime, "\${artifact.dir}/$$dep{JAR}"); |
---|
1042 | } |
---|
1043 | foreach my $dep (@libOpt) { |
---|
1044 | push(@runtime, "\${lib.dir}/$$dep{JAR}"); |
---|
1045 | } |
---|
1046 | @runtime = sort @runtime; |
---|
1047 | @deps = (@compile, @runtime); |
---|
1048 | @cp = @{$$c{RUNTIME}}; |
---|
1049 | my $runtimeError = 0; |
---|
1050 | if (@deps != @cp) { |
---|
1051 | print STDERR "Dependency mismatch for $name runtime classpath:\n"; |
---|
1052 | $runtimeError = 1; |
---|
1053 | } |
---|
1054 | else { |
---|
1055 | for (my $i = 0; $i < @cp; $i++) { |
---|
1056 | my $depJar = $deps[$i]; |
---|
1057 | my $cpJar = $cp[$i]; |
---|
1058 | if ($cpJar ne $depJar) { |
---|
1059 | print STDERR "Dependency mismatch for $name runtime classpath:\n"; |
---|
1060 | print STDERR " #$i: $depJar != $cpJar\n"; |
---|
1061 | $runtimeError = 1; |
---|
1062 | last; |
---|
1063 | } |
---|
1064 | } |
---|
1065 | } |
---|
1066 | if ($runtimeError) { |
---|
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 ="; |
---|
1072 | foreach my $q (@projDeps) { |
---|
1073 | print STDERR " $$q{NAME}"; |
---|
1074 | } |
---|
1075 | print STDERR "\n"; |
---|
1076 | print STDERR " reflected projects ="; |
---|
1077 | foreach my $q (@projOpt) { |
---|
1078 | print STDERR " $$q{NAME}"; |
---|
1079 | } |
---|
1080 | print STDERR "\n"; |
---|
1081 | print STDERR " library deps ="; |
---|
1082 | foreach my $q (@libDeps) { |
---|
1083 | print STDERR " $$q{NAME}"; |
---|
1084 | } |
---|
1085 | print STDERR "\n"; |
---|
1086 | print STDERR " reflected libraries ="; |
---|
1087 | foreach my $q (@libOpt) { |
---|
1088 | print STDERR " $$q{NAME}"; |
---|
1089 | } |
---|
1090 | $programErrors++; |
---|
1091 | } |
---|
1092 | } |
---|
1093 | |
---|
1094 | if ($skipSummary) { |
---|
1095 | exit $programErrors; |
---|
1096 | } |
---|
1097 | |
---|
1098 | # -- FORMATTED DATA OUTPUT -- |
---|
1099 | |
---|
1100 | print STDERR "--== DUMPING RESULTS TO STDOUT ==--\n\n"; |
---|
1101 | |
---|
1102 | my $div = <<ZZ; |
---|
1103 | =============================================================================== |
---|
1104 | ZZ |
---|
1105 | |
---|
1106 | # components - active |
---|
1107 | print "$div"; |
---|
1108 | print "This build file handles the following components.\n"; |
---|
1109 | print "For more information on a component, see the\n"; |
---|
1110 | print "build.properties file in that component's subtree.\n"; |
---|
1111 | print "Run ./scan-deps.pl to programmatically generate this list.\n\n"; |
---|
1112 | foreach my $c (@active) { |
---|
1113 | print "$$c{TITLE}\n"; |
---|
1114 | smartSplit(" ", " ", split(/[ \n]/, $$c{DESC})); |
---|
1115 | print " -=-\n"; |
---|
1116 | print " JAR file: $$c{JAR}\n"; |
---|
1117 | print " Path: $$c{PATH}\n"; |
---|
1118 | |
---|
1119 | my $lead = " "; |
---|
1120 | |
---|
1121 | my @projDeps = @{$$c{PROJ_DEPS}}; |
---|
1122 | my @prettyDeps = (); |
---|
1123 | foreach my $q (@projDeps) { |
---|
1124 | push(@prettyDeps, $$q{TITLE}); |
---|
1125 | } |
---|
1126 | smartSplit(" Project deps: ", ", ", @prettyDeps); |
---|
1127 | |
---|
1128 | my @libDeps = @{$$c{LIB_DEPS}}; |
---|
1129 | @prettyDeps = (); |
---|
1130 | foreach my $q (@libDeps) { |
---|
1131 | push(@prettyDeps, $$q{TITLE}); |
---|
1132 | } |
---|
1133 | smartSplit(" Library deps: ", ", ", @prettyDeps); |
---|
1134 | |
---|
1135 | my @projOpt = @{$$c{PROJ_OPT}}; |
---|
1136 | my @prettyOpt = (); |
---|
1137 | foreach my $q (@projOpt) { |
---|
1138 | push(@prettyOpt, $$q{TITLE}); |
---|
1139 | } |
---|
1140 | my @libOpt = @{$$c{LIB_OPT}}; |
---|
1141 | foreach my $q (@libOpt) { |
---|
1142 | push(@prettyOpt, $$q{TITLE}); |
---|
1143 | } |
---|
1144 | smartSplit(" Optional: ", ", ", @prettyOpt); |
---|
1145 | |
---|
1146 | print " License: $$c{LICENSE}\n"; |
---|
1147 | print "\n"; |
---|
1148 | } |
---|
1149 | |
---|
1150 | # components - legacy |
---|
1151 | print "$div"; |
---|
1152 | print "The following components are considered \"legacy\" but still " . |
---|
1153 | "available:\n\n"; |
---|
1154 | foreach my $c (@legacy) { |
---|
1155 | print "$$c{TITLE}\n"; |
---|
1156 | smartSplit(" ", " ", split(/[ \n]/, $$c{DESC})); |
---|
1157 | print " -=-\n"; |
---|
1158 | print " JAR file: $$c{JAR}\n"; |
---|
1159 | print " Path: $$c{PATH}\n"; |
---|
1160 | |
---|
1161 | my $lead = " "; |
---|
1162 | |
---|
1163 | my @deps = @{$$c{PROJ_DEPS}}; |
---|
1164 | my @prettyDeps = (); |
---|
1165 | foreach my $q (@deps) { |
---|
1166 | push(@prettyDeps, $$q{TITLE}); |
---|
1167 | } |
---|
1168 | smartSplit(" Project deps: ", ", ", @prettyDeps); |
---|
1169 | |
---|
1170 | my @opt = @{$$c{PROJ_OPT}}; |
---|
1171 | my @prettyOpt = (); |
---|
1172 | foreach my $q (@opt) { |
---|
1173 | push(@prettyOpt, $$q{TITLE}); |
---|
1174 | } |
---|
1175 | smartSplit(" Optional: ", ", ", @prettyOpt); |
---|
1176 | |
---|
1177 | print " License: $$c{LICENSE}\n"; |
---|
1178 | print "\n"; |
---|
1179 | } |
---|
1180 | |
---|
1181 | # components - forks |
---|
1182 | for (my $i = 0; $i < 2; $i++) { |
---|
1183 | print "$div"; |
---|
1184 | my @list; |
---|
1185 | if ($i == 0) { |
---|
1186 | @list = @forks; |
---|
1187 | print "The following components are forks of third party projects:\n\n"; |
---|
1188 | } |
---|
1189 | else { |
---|
1190 | @list = @stubs; |
---|
1191 | print "The following components are stubs of third party projects:\n\n"; |
---|
1192 | } |
---|
1193 | foreach my $c (@list) { |
---|
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"; |
---|
1199 | |
---|
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"; |
---|
1218 | } |
---|
1219 | } |
---|
1220 | |
---|
1221 | # libraries |
---|
1222 | print "$div"; |
---|
1223 | print "The following external dependencies (in the jar folder) may be " . |
---|
1224 | "required:\n"; |
---|
1225 | foreach my $l (@libs) { |
---|
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"; |
---|
1231 | print "\n"; |
---|
1232 | } |
---|
1233 | |
---|
1234 | exit $programErrors; |
---|
1235 | |
---|
1236 | # -- SUBROUTINES -- |
---|
1237 | |
---|
1238 | sub checkDirect { |
---|
1239 | my ($package, $path) = @_; |
---|
1240 | return `find $path -name '*.java' | xargs grep -l "^import $package\\."`; |
---|
1241 | } |
---|
1242 | |
---|
1243 | sub checkReflect { |
---|
1244 | my ($package, $path) = @_; |
---|
1245 | return `find $path -name '*.java' | xargs grep -l "optional $package"`; |
---|
1246 | } |
---|
1247 | |
---|
1248 | sub smartSplit { |
---|
1249 | my ($front, $div, @list) = @_; |
---|
1250 | my $lead = $front; |
---|
1251 | $lead =~ s/./ /g; |
---|
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]; |
---|
1261 | if ($item eq '') { next; } |
---|
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 | |
---|
1284 | sub rtrim { |
---|
1285 | my $string = shift; |
---|
1286 | $string =~ s/\s+$//; |
---|
1287 | return $string; |
---|
1288 | } |
---|