From mdaniel@scdi.com Fri Apr 7 22:19:09 2000 Return-Path: Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 60611 invoked from network); 7 Apr 2000 22:19:09 -0000 Received: from ns1.scdi.com (HELO dynamite.scdi.com) (209.86.126.99) by locus.apache.org with SMTP; 7 Apr 2000 22:19:09 -0000 Received: by dynamite.scdi.com (Postfix, from userid 1000) id 500952B007; Fri, 7 Apr 2000 18:19:25 -0400 (EDT) Date: Fri, 7 Apr 2000 18:19:25 -0400 From: Matthew L Daniel To: ant-dev@jakarta.apache.org Subject: [PATCH] JavaDoc -group broken (1.7) Message-ID: <20000407181925.A8924@scdi.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=fdj2RfSjLxBAspz7 X-Mailer: Mutt 0.95.5us X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N --fdj2RfSjLxBAspz7 Content-Type: text/plain; charset=us-ascii I am using the CVS builds (whenever I think to update my system - damn NT box) and I found a little gotcha. I used the group attribute of JavaDoc because I like it, but everytime I would re-ant my docs, it would leave out one of my packages. Removing the group attribute caused the package to reappear. So, a little -verbose (like this message) and I saw that group was being called with {-group "true"}, which is not right because group expects two params. My patch recognizes the syntax group="Group Name, package.name.*,optional.package.name.*" and converts it to the syntax -group "Group name" "package.name.*:optional.package.name.*" and, as a side effect, will still use the old format where group="true" will result in -group "" "" HTH, -- /v\atthew -- Matthew L Daniel I amuse myself by installing multiple Internet Developer, software packages on my computer and Still Current Development, Inc. then watch them try to kill each other. mdaniel@scdi.com.mil -- David Fiedler --fdj2RfSjLxBAspz7 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="javadoc.patch" --- src\main\org\apache\tools\ant\taskdefs\Javadoc.java Fri Mar 03 09:15:42 2000 +++ src\main\org\apache\tools\ant\taskdefs\Javadoc.java.new Fri Apr 07 17:57:56 2000 @@ -207,6 +207,18 @@ public void setLinkoffline(String src) { linkoffline = src; } + /** + * Set the argument to the group attribute. + * + * If you specify + * true, then javadoc will be called as -group "true" + * your.class.path, which will result in your.class.path being + * ignored by javadoc (since it is the second param to the -group flag). + + * @param src A String form + * Group Name, class.path.*, optional.class.path.*, not + * the true that the manual says. + */ public void setGroup(String src) { group = src; } @@ -367,8 +379,35 @@ argList.addElement(linkoffline); } if (group != null) { + String groupHeader = ""; + StringBuffer groups = new StringBuffer(); + int commaPos = group.indexOf(','); + if( commaPos != -1 ) { + StringTokenizer tokenizer = new StringTokenizer(group,","); + if( tokenizer.hasMoreElements() ) { + /** + * The name of this group is up to the first comma + */ + groupHeader = tokenizer.nextElement().toString(); + } + /* + * The actual groups to be included in this + * group list follow the first comma + */ + while( tokenizer.hasMoreElements() ) { + /* + * Convert any remaining commas into a package + * list, which is delimited by colons for javadoc. + */ + groups.append( tokenizer.nextElement().toString().trim() ); + if( tokenizer.hasMoreElements() ) { + groups.append(":"); + } + } + } argList.addElement("-group"); - argList.addElement(group); + argList.addElement(groupHeader); + argList.addElement(groups.toString()); } if (stylesheetfile != null) { argList.addElement("-stylesheetfile"); --fdj2RfSjLxBAspz7--