bodewig 01/04/18 07:49:53
Modified: docs/manual/CoreTasks javadoc.html
src/main/org/apache/tools/ant/taskdefs Javadoc.java
Log:
brush up documentation for <javadoc> (adding documentation for the
excludepackagenames attribute in the first place), minor cleanups in
the implementation of this task.
Revision Changes Path
1.6 +32 -3 jakarta-ant/docs/manual/CoreTasks/javadoc.html
Index: javadoc.html
===================================================================
RCS file: /home/cvs/jakarta-ant/docs/manual/CoreTasks/javadoc.html,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- javadoc.html 2001/03/27 23:36:40 1.5
+++ javadoc.html 2001/04/18 14:49:50 1.6
@@ -246,7 +246,8 @@
</tr>
<tr>
<td valign="top">group</td>
- <td valign="top">Group specified packages together in overview page</td>
+ <td valign="top">Group specified packages together in overview
+ page. The format is as described <a
href="#groupattribute">below</a>.</td>
<td align="center" valign="top">1.2</td>
<td align="center" valign="top">No</td>
</tr>
@@ -352,8 +353,34 @@
<td align="center" valign="top">all</td>
<td align="center" valign="top">No</td>
</tr>
+ <tr>
+ <td valign="top">excludepackagenames</td>
+ <td valign="top">comma separated list of packages you don't want
+ docs for.</td>
+ <td align="center" valign="top">all</td>
+ <td valign="top" align="center">No</td>
+ </tr>
+ <tr>
+ <td valign="top">defaultexcludes</td>
+ <td valign="top">indicates whether default excludes should be used
+ (<code>yes</code> | <code>no</code>); default excludes are used when
omitted.</td>
+ <td align="center" valign="top">all</td>
+ <td valign="top" align="center">No</td>
+ </tr>
</table>
+<h4><a name="groupattribute">Format of the group attribute</a></h4>
+<p>The arguments are comma-delimited. Each single argument is 2
+space-delimited strings, where the first one is the group's title and
+the second one a colon delimited list of packages.</p>
+<p>If you need to specify more than one group, or a group whose title
+contains a comma or a space character, using <a
+href="#groupelement">nested group elements</a> is highly
+recommended.</p>
+<p>E.g.,
+<pre> group="XSLT_Packages org.apache.xalan.xslt*,XPath_Packages
org.apache.xalan.xpath*"
+</pre></p>
+
<h3>Parameters specified as nested elements</h3>
<h4>link</h4>
<p>Create link to javadoc output at the given URL. This performs the
@@ -387,7 +414,7 @@
</tr>
</table>
-<h4>groups</h4>
+<h4><a name="groupelement">group</a></h4>
<p>Separates packages on the overview page into whatever groups you
specify, one group per table. This performs the same role as the group
attribute. You can use either syntax (or both at once), but with the
@@ -444,6 +471,8 @@
<h3>Example</h3>
<pre> <javadoc packagenames="com.dummy.test.*"
sourcepath="src"
+ excludepackagenames="com.dummy.test.doc-files.*"
+ defaultexcludes="yes"
destdir="docs/api"
author="true"
version="true"
@@ -452,7 +481,7 @@
doctitle="<h1>Test</h1>"
bottom="<i>Copyright &#169; 2000 Dummy Corp. All
Rights Reserved.</i>">
<group title="Group 1 Packages"
packages="com.dummy.test.a*"/>
- <group title="Group 2 Packages"
packages="com.dummy.test.b*"/>
+ <group title="Group 2 Packages"
packages="com.dummy.test.b*:com.dummy.test.c*"/>
<link offline="true"
href="http://java.sun.com/products/jdk/1.2/docs/api/"
packagelistLoc="C:\tmp"/>
<link
href="http://developer.java.sun.com/developer/products/xml/docs/api/"/>
</javadoc></pre>
1.46 +42 -26
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javadoc.java
Index: Javadoc.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javadoc.java,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- Javadoc.java 2001/03/02 15:58:13 1.45
+++ Javadoc.java 2001/04/18 14:49:52 1.46
@@ -206,7 +206,7 @@
private File destDir = null;
private String sourceFiles = null;
private String packageNames = null;
- private String excludePackageNames = null;
+ private String excludePackageNames = null;
private boolean author = true;
private boolean version = true;
private DocletInfo doclet = null;
@@ -217,7 +217,7 @@
private String packageList = null;
private Vector links = new Vector(2);
private Vector groups = new Vector(2);
- private boolean useDefaultExcludes = true;
+ private boolean useDefaultExcludes = true;
/**
* Sets whether default exclusions should be used or not.
@@ -275,9 +275,9 @@
packageNames = src;
}
- public void setExcludePackageNames(String src) {
- excludePackageNames = src;
- }
+ public void setExcludePackageNames(String src) {
+ excludePackageNames = src;
+ }
public void setOverview(File f) {
if (!javadoc1) {
@@ -682,7 +682,7 @@
// Ant javadoc task rules for group attribute:
// Args are comma-delimited.
// Each arg is 2 space-delimited strings.
- // E.g., group="XSLT_Packages
org.apache.xalan.xslt*,XPath_Packages orgapache.xalan.xpath*"
+ // E.g., group="XSLT_Packages
org.apache.xalan.xslt*,XPath_Packages org.apache.xalan.xpath*"
if (group != null) {
StringTokenizer tok = new StringTokenizer(group, ",", false);
while (tok.hasMoreTokens()) {
@@ -727,13 +727,13 @@
}
}
- Vector excludePackages = new Vector();
- if ((excludePackageNames != null) &&
(excludePackageNames.length() > 0)) {
- StringTokenizer exTok = new
StringTokenizer(excludePackageNames, ",", false);
- while (exTok.hasMoreTokens()) {
-
excludePackages.addElement(exTok.nextToken().trim());
- }
- }
+ Vector excludePackages = new Vector();
+ if ((excludePackageNames != null) &&
(excludePackageNames.length() > 0)) {
+ StringTokenizer exTok = new
StringTokenizer(excludePackageNames, ",", false);
+ while (exTok.hasMoreTokens()) {
+ excludePackages.addElement(exTok.nextToken().trim());
+ }
+ }
if (packages.size() > 0) {
evaluatePackages(toExecute, sourcePath, packages,
excludePackages);
}
@@ -784,9 +784,25 @@
private void evaluatePackages(Commandline toExecute, Path sourcePath,
Vector packages, Vector excludePackages) {
log("Source path = " + sourcePath.toString(), Project.MSG_VERBOSE);
- log("Packages = " + packages, Project.MSG_VERBOSE);
- log("Exclude Packages = " + excludePackages,
Project.MSG_VERBOSE);
+ StringBuffer msg = new StringBuffer("Packages = ");
+ for (int i=0; i<packages.size(); i++) {
+ if (i > 0) {
+ msg.append(",");
+ }
+ msg.append(packages.elementAt(i));
+ }
+ log(msg.toString(), Project.MSG_VERBOSE);
+ msg.setLength(0);
+ msg.append("Exclude Packages = ");
+ for (int i=0; i<excludePackages.size(); i++) {
+ if (i > 0) {
+ msg.append(",");
+ }
+ msg.append(excludePackages.elementAt(i));
+ }
+ log(msg.toString(), Project.MSG_VERBOSE);
+
Vector addedPackages = new Vector();
String[] list = sourcePath.list();
@@ -805,18 +821,18 @@
fs.createInclude().setName(pkg);
} // while
-
- e = excludePackages.elements();
- while (e.hasMoreElements()) {
- String pkg = (String)e.nextElement();
- pkg = pkg.replace('.','/');
- if (pkg.endsWith("*")) {
- pkg += "*";
- }
-
- fs.createExclude().setName(pkg);
- }
+ e = excludePackages.elements();
+ while (e.hasMoreElements()) {
+ String pkg = (String)e.nextElement();
+ pkg = pkg.replace('.','/');
+ if (pkg.endsWith("*")) {
+ pkg += "*";
+ }
+
+ fs.createExclude().setName(pkg);
+ }
+
for (int j=0; j<list.length; j++) {
File source = project.resolveFile(list[j]);
fs.setDir(source);