]> gitweb.fperrin.net Git - Dictionary.git/blob - jars/icu4j-4_4_2-src/tools/build/README.txt
go
[Dictionary.git] / jars / icu4j-4_4_2-src / tools / build / README.txt
1 Copyright (C) 1996-2004, International Business Machines Corporation and\r
2 others. All Rights Reserved.\r
3 \r
4 -------------------------------------------\r
5 Using the GatherAPIData and ReportAPI tools\r
6 -------------------------------------------\r
7 \r
8 These two tools are used together to generate reports about changes in\r
9 supported API between versions of ICU4J.\r
10 \r
11 \r
12 GatherAPIData \r
13 \r
14 GatherAPIData uses javadoc to process the ICU4J source files and\r
15 generate a file listing information about the public API, including\r
16 the ICU4J status (draft, stable, deprecated, obsolete).  It excludes\r
17 private API, API marked @internal.  The file is written as text, so it\r
18 is human-readable, but it is a bit verbose.  To save space, the file\r
19 can be zip'd or gzip'd (using flags passed to the tool), which will\r
20 reduce the size by about a factor of 10.\r
21 \r
22 GatherAPIData requires javadoc and is currently based on sun jdk\r
23 1.4.2.  JavaDoc is internal (I believe) so you need a reference jvm\r
24 from Sun to compile the tool, but it can be run against any 1.4 JDK\r
25 (at least, those from Sun).  Instructions in the source file show how\r
26 it can be invoked.\r
27 \r
28 GatherAPIData should be passed all the packages that need reporting.\r
29 Currently, public api is only in the lang, math, text, and util\r
30 subpackages of com.ibm.icu.\r
31 \r
32 \r
33 ReportAPI \r
34 \r
35 ReportAPI takes two api files generated by GatherAPIData and reports\r
36 on removals, changes, and additions to the API.  It does this by\r
37 comparing the API information in the two API files.  When new classes\r
38 are added, only the class is listed, not its entire API, and similarly\r
39 when a class is deleted.  When APIs with the same name and signature\r
40 are changed (visibility, status, inheritance) these changes are listed\r
41 by showing the old and new versions of the API.\r
42 \r
43 ReportAPI is not particularly smart, and in particular, does not know\r
44 about inherited API.  So for example, moving public API from a class\r
45 to a base class is reported as a deletion of API from the original\r
46 class, even though the effective API on the original class is\r
47 unchanged by this.\r
48 \r
49 ReportAPI also does not know about Java class files, so for example it\r
50 cannot be used to compare com.ibm.icu.lang.UCharacter against\r
51 java.lang.Character.  This might be provided in a later release.\r
52 \r
53 For these reasons, in general it is best to compare two successive\r
54 versions of ICU4J against each other, rather than radically different\r
55 versions.  A large number of changes can show up, many of which might\r
56 fall into these 'innocuous' categories.\r
57 \r
58 ReportAPI can generate either plain text or html reports.  Since it\r
59 only requires the data files and does not rely on JavaDoc, it is more\r
60 straightforward to invoke.\r
61 \r
62 ReportAPI uses the file extension to determine how to uncompress the\r
63 api data files.  It expects '.zip' for files that have been compressed\r
64 using zip, and '.gz' for files that have been compressed using gzip.\r
65 The GatherAPIData utility automatically appends these extensions when\r
66 compression is used.\r
67 \r
68 API Data Files\r
69 \r
70 API Data files for ICU4J 2.8 and 3.0 are in this directory.  The\r
71 intent is to store data files for each release version of ICU4J, to\r
72 facilitate comparison using the ReportAPI tool.  Of course, they can\r
73 always be regenerated using the GenerateAPI and the sources of a\r
74 particular ICU4J release.\r
75 \r
76 The format of the API data file is straightforward.  The first line of\r
77 the file is the header, successive lines are the api information.\r
78 Each line consists of a number of tokens, each followed by a\r
79 semi-colon (incuding the last token on the line).\r
80 \r
81 The header line contains the version number, the 'name' of the version\r
82 of ICU4J represented by the file, and a 'base directory' field\r
83 (currently not fully implemented).\r
84 \r
85 The following lines contain data generated by the APIInfo class, one\r
86 line per class or method.  The tokens are status, visibility, static,\r
87 final, synchronized, abstract, type, package, containing class, name,\r
88 and 'signature' (which varies by the type of object).  For classes,\r
89 the 'signature' is the immediate inheritance of the class.  For\r
90 fields, the 'signature' is the type of the field.  For methods, the\r
91 'signature' is the function signature. All fields are always present.\r
92 \r
93 For more information, please see APIInfo.java.\r
94 \r
95 -------\r