ICU-3743 split icu4j api data gathering from report generation

X-SVN-Rev: 15271
This commit is contained in:
Doug Felt 2004-05-12 05:33:44 +00:00
parent 29c60daad2
commit 3fa725fa20
3 changed files with 21 additions and 5 deletions

View File

@ -30,8 +30,8 @@
* -sourcepath c:/doug/cvsproj/icu4j/src
* -name "ICU4J 3.0"
* -output icu4j30.api
* -zip
* com.ibm.icu.text
* -gzip
* com.ibm.icu.lang com.ibm.icu.math com.ibm.icu.text com.ibm.icu.util
*
* todo: separate generation of data files (which requires taglet) from
* comparison and report generation (which does not require it)
@ -47,6 +47,7 @@ package com.ibm.icu.dev.tool.docs;
import com.sun.javadoc.*;
import java.io.*;
import java.util.*;
import java.util.zip.GZIPOutputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
@ -58,6 +59,7 @@ public class GatherAPIData {
String base; // strip this prefix
String filter; // filter classes by name
boolean zip;
boolean gzip;
public static int optionLength(String option) {
if (option.equals("-name")) {
@ -70,6 +72,8 @@ public class GatherAPIData {
return 2;
} else if (option.equals("-zip")) {
return 1;
} else if (option.equals("-gzip")) {
return 1;
}
return 0;
}
@ -94,6 +98,8 @@ public class GatherAPIData {
this.filter = options[i][1];
} else if (opt.equals("-zip")) {
this.zip = true;
} else if (opt.equals("-gzip")) {
this.gzip = true;
}
}
@ -110,6 +116,8 @@ public class GatherAPIData {
ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(output + ".zip"));
zos.putNextEntry(new ZipEntry(output));
os = zos;
} else if (gzip) {
os = new GZIPOutputStream(new FileOutputStream(output + ".gz"));
} else {
os = new FileOutputStream(output);
}

View File

@ -13,8 +13,8 @@ generate a file listing information about the public API, including
the ICU4J status (draft, stable, deprecated, obsolete). It excludes
private API, API marked @internal. The file is written as text, so it
is human-readable, but it is a bit verbose. To save space, the file
can be zip'd (NOTE: to become gzip'd), which will reduce the size by
about a factor of 10.
can be zip'd or gzip'd (using flags passed to the tool), which will
reduce the size by about a factor of 10.
GatherAPIData requires javadoc and is currently based on sun jdk
1.4.2. JavaDoc is internal (I believe) so you need a reference jvm
@ -56,6 +56,11 @@ ReportAPI can generate either plain text or html reports. Since it
only requires the data files and does not rely on JavaDoc, it is more
straightforward to invoke.
ReportAPI uses the file extension to determine how to uncompress the
api data files. It expects '.zip' for files that have been compressed
using zip, and '.gz' for files that have been compressed using gzip.
The GatherAPIData utility automatically appends these extensions when
compression is used.
API Data Files

View File

@ -74,6 +74,9 @@ public class ReportAPI {
} else {
File f = new File(fileName);
is = new FileInputStream(f);
if (fileName.endsWith(".gz")) {
is = new GZIPInputStream(is);
}
}
InputStreamReader isr = new InputStreamReader(is);
return read(new BufferedReader(isr));