diff --git a/docs/manual/CoreTasks/javadoc.html b/docs/manual/CoreTasks/javadoc.html index 496410c40..073defe90 100644 --- a/docs/manual/CoreTasks/javadoc.html +++ b/docs/manual/CoreTasks/javadoc.html @@ -246,7 +246,8 @@ instead.
yes
| no
); default excludes are used when omitted.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.
+If you need to specify more than one group, or a group whose title +contains a comma or a space character, using nested group elements is highly +recommended.
+E.g., +
group="XSLT_Packages org.apache.xalan.xslt*,XPath_Packages org.apache.xalan.xpath*" ++
Create link to javadoc output at the given URL. This performs the @@ -387,7 +414,7 @@ specify multiple occurrences of the arguments.
-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 @@ respectively.
<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 @@ respectively. doctitle="<h1>Test</h1>" bottom="<i>Copyright © 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>diff --git a/src/main/org/apache/tools/ant/taskdefs/Javadoc.java b/src/main/org/apache/tools/ant/taskdefs/Javadoc.java index ab2e02cf2..3fd77252c 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Javadoc.java +++ b/src/main/org/apache/tools/ant/taskdefs/Javadoc.java @@ -206,7 +206,7 @@ public class Javadoc extends Task { 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 @@ public class Javadoc extends Task { 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 @@ public class Javadoc extends Task { 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 @@ public class Javadoc extends Task { // 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 @@ public class Javadoc extends Task { } } - 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,8 +784,24 @@ public class Javadoc extends Task { 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