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. 
[EMAIL PROTECTED]               -- David Fiedler
--- 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 <CODE>group</CODE> attribute.
+        * 
+        * If you specify 
+        * <CODE>true</CODE>, then javadoc will be called as <CODE>-group 
"true" 
+        * your.class.path</CODE>, 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 
+        * <CODE>Group Name, class.path.*, optional.class.path.*</CODE>, not
+        * the <CODE>true</CODE> 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");

Reply via email to